Fix publish-box button layout on classic editor (WP 7.0+)#504
Merged
Conversation
Member
Author
|
They are going probably to fix it on the WP side, so let's wait before moving that forward. |
795567c to
3c39a08
Compare
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>
3c39a08 to
d3f551a
Compare
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.
Context
#major-publishing-actionsinto a flex row (flex-wrap: nowrap), which squeezed our "Copy to a new draft" and "Rewrite & Republish" links onto the same row as "Move to Trash" and "Update", shrinking all four controls.Summary
This PR can be summarized in the following changelog entry:
Relevant technical choices:
flex-wrap: wrap(on the container) andflex-basis: 100%(on each button) behind a:has(> #duplicate-action)/:has(> #rewrite-republish-action)guard, so the whole fix only applies when our buttons are direct children of#major-publishing-actionsand each one claims its own row.Test instructions
Test instructions for the acceptance test before the PR gets merged
This PR can be acceptance tested by following these steps:
Relevant test scenarios
This change only affects the Classic Editor Publish meta box; the Block Editor sidebar is untouched.
Test instructions for QA when the code is in the RC
Impact check
This PR affects the following parts of the plugin, which may require extra testing:
#major-publishing-actionsflex layout, re-check this meta box: the rules are scoped behind:has()and go inert if the container stops being a flex parent, but a quick visual check confirms our CSS is not redundantly overriding a core fix.UI changes
Documentation
Quality assurance
Innovation
innovationlabel and noted the work hours.Fixes #