Skip to content

Fix publish-box button layout on classic editor (WP 7.0+)#504

Open
enricobattocchi wants to merge 1 commit into
trunkfrom
fix-classic-publishbox-wp7-flex
Open

Fix publish-box button layout on classic editor (WP 7.0+)#504
enricobattocchi wants to merge 1 commit into
trunkfrom
fix-classic-publishbox-wp7-flex

Conversation

@enricobattocchi
Copy link
Copy Markdown
Member

@enricobattocchi enricobattocchi commented May 26, 2026

Context

  • WP 7.0 made #major-publishing-actions a flex row, so our Copy / Rewrite links ended up squeezed onto the same row as Move to Trash and Update.

Summary

This PR can be summarized in the following changelog entry:

  • Fixes a bug where the Copy and Rewrite links broke the appearance of the Publish meta box in the Classic Editor on WordPress 7.0+.

Relevant technical choices:

  • :has()-scoped flex-wrap: wrap on the core container plus flex-basis: 100% on our two buttons. No-op on WP 6.9 (parent isn't flex), no version check needed.

Test instructions

Test instructions for the acceptance test before the PR gets merged

  • Open a published post in the classic editor on WP 7.0+ and confirm Copy / Rewrite are each on their own row above Trash + Update.
  • Repeat on WP 6.9 if available: layout should be unchanged.

Relevant test scenarios

  • Changes should be tested with the browser console open
  • Changes should be tested on different posts/pages/taxonomies/custom post types/custom taxonomies
  • Changes should be tested on different editors (Default Block/Gutenberg/Classic/Elementor/other)
  • Changes should be tested on different browsers
  • Changes should be tested on multisite

Classic editor only; block editor sidebar untouched.

Test instructions for QA when the code is in the RC

  • QA should use the same steps as above.

QA can test this PR by following these steps:

Impact check

  • Classic editor Publish meta box only.

UI changes

  • This PR changes the UI in the plugin. I have added the 'UI change' label to this PR.

Documentation

  • I have written documentation for this change. For example, comments in the Relevant technical choices, comments in the code, documentation on Confluence / shared Google Drive / Yoast developer portal, or other.

Quality assurance

  • I have tested this code to the best of my abilities
  • I have added unittests to verify the code works as intended

Innovation

  • No innovation project is applicable for this PR.
  • This PR falls under an innovation project. I have attached the innovation label and noted the work hours.

Fixes #

WordPress 7.0 changed #major-publishing-actions to display: flex with
flex-wrap: nowrap, which placed "Copy to a new draft" and
"Rewrite & Republish" on the same row as Move to Trash and Update,
shrinking all four. Scope flex-wrap: wrap to that container only when
our buttons are present (via :has()) and give each duplicate button
flex-basis: 100% so it claims its own row. The properties are no-ops
on WP 6.9 where the parent is not a flex container, keeping the
previous layout intact there.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@enricobattocchi
Copy link
Copy Markdown
Member Author

They are going probably to fix it on the WP side, so let's wait before moving that forward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants