Skip to content

Fix hidden acf_after_title meta box drop target corrupting user box order - #1030

Open
rdelbem wants to merge 1 commit into
AdvancedCustomFields:masterfrom
rdelbem:master
Open

Fix hidden acf_after_title meta box drop target corrupting user box order#1030
rdelbem wants to merge 1 commit into
AdvancedCustomFields:masterfrom
rdelbem:master

Conversation

@rdelbem

@rdelbem rdelbem commented Sep 2, 2026

Copy link
Copy Markdown

Fix for #1029

ACF_Form_Post::edit_form_after_title() called do_meta_boxes( ..., 'acf_after_title', ... ) unconditionally, which always emits an empty #acf_after_title-sortables container when no field groups use that position. On block editor screens this container lives inside the hidden .metabox-base-form, yet postboxes.js still registers it as a jQuery UI droppable, so dragging any meta box reveals a phantom drop zone (body.is-dragging-metaboxes styling) and drops are persisted to meta-box-order_{$screen} user meta under acf_after_title. On reload, core re-registers those IDs into a context Gutenberg never renders, permanently hiding the box for that user.

Change
Gate the do_meta_boxes( ..., 'acf_after_title', ... ) call on isset( $wp_meta_boxes[ get_current_screen()->id ]['acf_after_title'] ). acf_form_data() remains unconditional so saving still works.

@rdelbem
rdelbem requested a review from a team as a code owner September 2, 2026 14:59
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.

1 participant