Docs: Improve local development and contribution instructions#363
Docs: Improve local development and contribution instructions#363meravi wants to merge 5 commits intoWordPress:trunkfrom
Conversation
|
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 Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
| /** | ||
| * 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 | ||
| } | ||
|
|
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
|
Thank you for this PR! I've left two notes. Additionally, would you mind rebasing on |
|
Thanks for the review! I've addressed the notes and rebased the branch on Please let me know if anything else needs adjustment 🙂 |
Adds a small "Local Development & Testing" section to README to help contributors set up and test SCF locally.
Includes:
This should improve onboarding and clarity for contributors.