Skip to content

Docs: Improve local development and contribution instructions#363

Open
meravi wants to merge 5 commits intoWordPress:trunkfrom
meravi:docs/contributing-improvements
Open

Docs: Improve local development and contribution instructions#363
meravi wants to merge 5 commits intoWordPress:trunkfrom
meravi:docs/contributing-improvements

Conversation

@meravi
Copy link

@meravi meravi commented Feb 21, 2026

Adds a small "Local Development & Testing" section to README to help contributors set up and test SCF locally.

Includes:

  • Basic local setup steps
  • Recommended dev environment
  • PR guidelines checklist

This should improve onboarding and clarity for contributors.

@github-actions
Copy link

github-actions bot commented Feb 21, 2026

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props ravikhadka, bernhard-reiter.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Comment on lines +68 to +143
/**
* Fix SCF field layout on user profile/edit screens.
*
* SCF fields on user screens render inside WordPress `table.form-table` rows,
* so we apply scoped CSS only on profile.php and user-edit.php screens.
*
* @see https://github.com/WordPress/secure-custom-fields/issues/349
*/
function scf_user_form_layout_fix()
{

// Only run in wp-admin, and only on profile/edit user screens.
if (!is_admin()) {
return;
}

$screen = function_exists('get_current_screen') ? get_current_screen() : null;
if (!$screen || !in_array($screen->base, array('profile', 'user-edit'), true)) {
return;
}

?>
<style id="scf-user-form-layout-fix">
/* Labels: consistent width + alignment */
body.profile-php table.form-table tr.acf-field > td.acf-label,
body.user-edit-php table.form-table tr.acf-field > td.acf-label {
width: 200px;
vertical-align: top;
padding-top: 14px;
}

/* Inputs: align to top */
body.profile-php table.form-table tr.acf-field > td.acf-input,
body.user-edit-php table.form-table tr.acf-field > td.acf-input {
vertical-align: top;
}

/* Make text inputs and textareas usable width (WP-like) */
body.profile-php table.form-table tr.acf-field > td.acf-input .acf-input-wrap input,
body.profile-php table.form-table tr.acf-field > td.acf-input textarea,
body.user-edit-php table.form-table tr.acf-field > td.acf-input .acf-input-wrap input,
body.user-edit-php table.form-table tr.acf-field > td.acf-input textarea {
width: 100%;
max-width: 25em;
}

/* Select2: keep full width, not squeezed */
body.profile-php table.form-table tr.acf-field > td.acf-input .select2-container,
body.user-edit-php table.form-table tr.acf-field > td.acf-input .select2-container {
width: 100% !important;
max-width: 25em;
}

/* Mobile: stack label + field */
@media (max-width: 782px) {
body.profile-php table.form-table tr.acf-field > td.acf-label,
body.user-edit-php table.form-table tr.acf-field > td.acf-label,
body.profile-php table.form-table tr.acf-field > td.acf-input,
body.user-edit-php table.form-table tr.acf-field > td.acf-input {
display: block;
width: auto;
}

body.profile-php table.form-table tr.acf-field > td.acf-input .acf-input-wrap input,
body.profile-php table.form-table tr.acf-field > td.acf-input textarea,
body.user-edit-php table.form-table tr.acf-field > td.acf-input .acf-input-wrap input,
body.user-edit-php table.form-table tr.acf-field > td.acf-input textarea,
body.profile-php table.form-table tr.acf-field > td.acf-input .select2-container,
body.user-edit-php table.form-table tr.acf-field > td.acf-input .select2-container {
max-width: 100%;
}
}
</style>
<?php
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes seem unrelated to the doc changes. Maybe commit fac0065 was added accidentally to this PR and should be reverted?


To test Secure Custom Fields locally with WordPress:

1. Clone the repository into your WordPress plugins directory: wp-content/plugins/secure-custom-fields
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this is possible, it might not be the best way to develop SCF. There are other ways to keep the local clone of the repository better separated from the WordPress install that's used to test it with, including wp-env (which is referenced in AGENTS.md -- we might want the README to be consistent with that), or using a different WordPress development environment such as WordPress Studio, and symlinking the repository from that environments wp-content/plugins/ directory.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, thanks for clarifying. I’ll align with wp-env (as referenced in AGENTS.md) or use a separate dev environment with symlinking for future work to keep things consistent.

@ockham
Copy link
Contributor

ockham commented Feb 24, 2026

Thank you for this PR! I've left two notes. Additionally, would you mind rebasing on trunk? (The latter is required to get e2e tests to pass.)

@meravi
Copy link
Author

meravi commented Feb 25, 2026

Thanks for the review!

I've addressed the notes and rebased the branch on trunk so the e2e tests can run cleanly. The PR now only contains the intended documentation change.

Please let me know if anything else needs adjustment 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants