diff --git a/packages/editor/src/components/commands/index.js b/packages/editor/src/components/commands/index.js index 177f914e73db6..5cfa4ba3f45a9 100644 --- a/packages/editor/src/components/commands/index.js +++ b/packages/editor/src/components/commands/index.js @@ -322,7 +322,9 @@ const getSiteEditorCategoryCommands = () => const commands = []; // Check if we are in the Site Editor and editing a category-related template - const isSiteEditor = window.location.href.includes( 'site-editor.php' ); + const isSiteEditor = getPath( window.location.href )?.includes( + 'site-editor.php' + ); if ( isSiteEditor && templateSlug ) { const isCategoryTemplate = templateSlug.includes( 'category' ) ||