Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: remove editor command to avoid duplicate add post functionality.
  • Loading branch information
Adi-ty committed Aug 21, 2025
commit d94b58a6f86cf32e00af89be5cfd4484a96a279c
34 changes: 12 additions & 22 deletions packages/core-commands/src/admin-navigation-commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import { useCommand, useCommandLoader } from '@wordpress/commands';
import { __ } from '@wordpress/i18n';
import { plus, edit, layout } from '@wordpress/icons';
import { plus, layout } from '@wordpress/icons';
import { getPath } from '@wordpress/url';
import { store as coreStore } from '@wordpress/core-data';
import { useSelect, useDispatch } from '@wordpress/data';
Expand Down Expand Up @@ -102,31 +102,21 @@ const getAdminBasicNavigationCommands = () =>
);

const commands = useMemo( () => {
const result = [];

if ( canCreateTemplate && isBlockBasedTheme ) {
result.push( {
name: 'core/admin/open-site-editor',
label: __( 'Site Editor' ),
icon: layout,
callback: ( { close } ) => {
document.location.assign( 'site-editor.php' );
close();
return [
{
name: 'core/admin/open-site-editor',
label: __( 'Site Editor' ),
icon: layout,
callback: ( { close } ) => {
document.location.assign( 'site-editor.php' );
close();
},
},
} );
];
}

result.push( {
name: 'core/admin/open-post-editor',
label: __( 'Editor' ),
icon: edit,
callback: ( { close } ) => {
document.location.assign( 'post-new.php' );
close();
},
} );

return result;
return [];
}, [ canCreateTemplate, isBlockBasedTheme ] );

return {
Expand Down
Loading