From 1480b6bc57949202174c18831e2101888c049ca7 Mon Sep 17 00:00:00 2001 From: Marcelo Serpa <81248+fullofcaffeine@users.noreply.github.com> Date: Wed, 24 Jan 2024 12:00:23 -0600 Subject: [PATCH] (editor)(fix) Append the `edit-post-header-toolbar` class in NavigableToolbar 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 --- packages/editor/src/components/document-tools/index.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/editor/src/components/document-tools/index.js b/packages/editor/src/components/document-tools/index.js index cf26fc600a0385..05907654fa9b84 100644 --- a/packages/editor/src/components/document-tools/index.js +++ b/packages/editor/src/components/document-tools/index.js @@ -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.