Skip to content

Meta box reordering does not save in user preferences #30071

@peterwilsoncc

Description

@peterwilsoncc

Description

Originally reported as WP#52818 by wordpress.org user terraling

Post edit screens with metaboxes allow for drag and drop re-ordering.

This worked up to WordPress 5.6.2, but stopped working in WP 5.7, though it continues to work if you use the Classic Editor to edit posts rather than the block editor.

When re-ordering the metaboxes, an ajax update with the action 'meta-box-order' occurs, and this reports a succesful response both in the working and non-working cases, so it appears as if updating the metabox order works.

But, when the page is reloaded, the metaboxes are displayed in an unchanged order.

At the moment this is on the WP 5.7.1 milestone but please let me know if this isn't possible.

Step-by-step reproduction instructions

  1. Create a legacy meta box with this code in a plugin https://gist.github.com/peterwilsoncc/65e80a277a1ac1d1d700502638d80fb3
  2. Create a new post
  3. Enable the custom fields panel
  4. You should see two meta boxes at the bottom of the screen
  5. Reordeer the two meta boxes, either by dragging and dropping or clicking the buttons
  6. Refresh the editor
  7. Observe the two meta boxes are not showing in the user's selected order.

Expected behaviour

At the final step the order should reflect the user's preferences.

Actual behaviour

The order of meta boxes is reset to the default WP order each time the editor is loaded.

@desrosj has determined that the page parameter is been left off the AJAX request to the admin-ajax action meta-box-order.

A git bisect shows it was apparently introduced in this package update during the WP 5.7 cycle WordPress/wordpress-develop@bc40569.

Screenshots or screen recording (optional)

ffs-apple.mov

Code snippet (optional)

WordPress information

  • WordPress version: 5.7.0
  • Gutenberg version: latest (built from 49c6fb9 )
  • Are all plugins except Gutenberg deactivated? Yes
  • Are you using a default theme (e.g. Twenty Twenty-One)? Yes, TT1

Device information

  • Device: Desktop
  • Operating system: macOS 11.2.1
  • Browser: Firefox Developer Edition 87

Metadata

Metadata

Labels

[Feature] Meta BoxesA draggable box shown on the post editing screen[Status] In ProgressTracking issues with work in progress[Type] BugAn existing feature does not function as intended

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions