diff --git a/packages/base-styles/_z-index.scss b/packages/base-styles/_z-index.scss
index 14c40bdeebd860..3ea074c2723b5d 100644
--- a/packages/base-styles/_z-index.scss
+++ b/packages/base-styles/_z-index.scss
@@ -71,9 +71,6 @@ $z-layers: (
".edit-site-sidebar": 100000,
".edit-widgets-sidebar": 100000,
".edit-post-layout .edit-post-post-publish-panel": 100001,
- // For larger views, the wp-admin navbar dropdown should be at top of
- // the Publish Post sidebar.
- ".edit-post-layout .edit-post-post-publish-panel {greater than small}": 99998,
".entities-saved-states__panel": 100001,
// For larger views, the wp-admin navbar dropdown should be on top of
diff --git a/packages/edit-post/src/components/header/index.js b/packages/edit-post/src/components/header/index.js
index cd5457ff3d29e3..5b57edf175588a 100644
--- a/packages/edit-post/src/components/header/index.js
+++ b/packages/edit-post/src/components/header/index.js
@@ -19,7 +19,8 @@ import HeaderToolbar from './header-toolbar';
import MoreMenu from './more-menu';
import PostPublishButtonOrToggle from './post-publish-button-or-toggle';
import { default as DevicePreview } from '../device-preview';
-import MainDashboardButton from '../header/main-dashboard-button';
+import MainDashboardButton from './main-dashboard-button';
+import TemplateSaveButton from './template-save-button';
function Header( { setEntitiesSavedStatesCallback } ) {
const {
@@ -28,6 +29,7 @@ function Header( { setEntitiesSavedStatesCallback } ) {
isSaving,
showIconLabels,
hasReducedUI,
+ isEditingTemplate,
} = useSelect(
( select ) => ( {
hasActiveMetaboxes: select( 'core/edit-post' ).hasMetaBoxes(),
@@ -41,6 +43,7 @@ function Header( { setEntitiesSavedStatesCallback } ) {
hasReducedUI: select( 'core/edit-post' ).isFeatureActive(
'reducedUI'
),
+ isEditingTemplate: select( 'core/edit-post' ).isEditingTemplate(),
} ),
[]
);
@@ -60,30 +63,35 @@ function Header( { setEntitiesSavedStatesCallback } ) {
- { ! isPublishSidebarOpened && (
- // This button isn't completely hidden by the publish sidebar.
- // We can't hide the whole toolbar when the publish sidebar is open because
- // we want to prevent mounting/unmounting the PostPublishButtonOrToggle DOM node.
- // We track that DOM node to return focus to the PostPublishButtonOrToggle
- // when the publish sidebar has been closed.
-
+ { ! isEditingTemplate && (
+ <>
+ { ! isPublishSidebarOpened && (
+ // This button isn't completely hidden by the publish sidebar.
+ // We can't hide the whole toolbar when the publish sidebar is open because
+ // we want to prevent mounting/unmounting the PostPublishButtonOrToggle DOM node.
+ // We track that DOM node to return focus to the PostPublishButtonOrToggle
+ // when the publish sidebar has been closed.
+
+ ) }
+
+
+
+ >
) }
-
-
-
+ { isEditingTemplate && }
{ ( isLargeViewport || ! showIconLabels ) && (
<>
@@ -92,7 +100,7 @@ function Header( { setEntitiesSavedStatesCallback } ) {
) }
{ showIconLabels && ! isLargeViewport && (
- ) }
+ ) }{ ' ' }