Skip to content

Fix SCF user profile field table layout on profile/edit screens#387

Open
meravi wants to merge 4 commits intoWordPress:trunkfrom
meravi:meravi/meravi-349-user-profile-layout-fix
Open

Fix SCF user profile field table layout on profile/edit screens#387
meravi wants to merge 4 commits intoWordPress:trunkfrom
meravi:meravi/meravi-349-user-profile-layout-fix

Conversation

@meravi
Copy link

@meravi meravi commented Mar 11, 2026

What this PR does

This fixes the layout issue from #349 on user profile/edit screens where SCF fields can look misaligned inside the WordPress form-table.

I moved the styling fix into the normal enqueue flow using wp_add_inline_style() and limited it to user profile/edit admin screens only.

Changes

  • Add scoped layout CSS in ACF_Form_User::admin_enqueue_scripts()
  • Apply only on:
    • profile
    • user-edit
    • profile-network
    • user-edit-network
  • Keep field labels and inputs aligned in table rows
  • Improve mobile behavior (stack label/input on small screens)
  • Limit width rules to text-like inputs, textarea, and select2
  • Add PHPUnit coverage for the generated CSS output

Why

My previous attempt fixed the UI issue, but this version keeps the implementation cleaner and closer to WordPress coding standards, with narrower scope to avoid side effects.

Related

Fixes #349

Fixes https://github.com/WordPress/secure-custom-fields/issues/349

Scope layout CSS to profile/user-edit screens using wp_add_inline_style.

Limit width rules to text-like inputs, textarea, and select2 to avoid side effects.

Add PHPUnit coverage for generated user form layout CSS.

Fixes WordPress#349
@github-actions
Copy link

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, cbravobernal, yanmetelitsa.

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

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.

Field markup issues on edit User page

1 participant