Fix hidden acf_after_title meta box drop target corrupting user box order - #1030
Open
rdelbem wants to merge 1 commit into
Open
Fix hidden acf_after_title meta box drop target corrupting user box order#1030rdelbem wants to merge 1 commit into
rdelbem wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.