Skip to content

Commit

Permalink
(editor)(fix) Append the edit-post-header-toolbar class in Navigabl…
Browse files Browse the repository at this point in the history
…eToolbar for backward compatibility with plugin GUI injections (#58154)

* Keep the `edit-post-header-toolbar` CSS class in the `NavigableToolbar` as some plugins use it to append GUIs to it

* Add comment justifying the change
  • Loading branch information
fullofcaffeine committed Jan 24, 2024
1 parent 1340eb7 commit 1480b6b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/editor/src/components/document-tools/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,16 @@ function DocumentTools( {
const shortLabel = ! isInserterOpened ? __( 'Add' ) : __( 'Close' );

return (
// Some plugins expect and use the `edit-post-header-toolbar` CSS class to
// find the toolbar and inject UI elements into it. This is not officially
// supported, but we're keeping it in the list of class names for backwards
// compatibility.
<NavigableToolbar
className={ classnames( 'editor-document-tools', className ) }
className={ classnames(
'editor-document-tools',
'edit-post-header-toolbar',
className
) }
aria-label={ toolbarAriaLabel }
shouldUseKeyboardFocusShortcut={ ! blockToolbarCanBeFocused }
variant="unstyled"
Expand Down

0 comments on commit 1480b6b

Please sign in to comment.