Skip to content

Commit

Permalink
Add manage all custom patterns command
Browse files Browse the repository at this point in the history
  • Loading branch information
ntsekouras committed Jun 23, 2023
1 parent 1464f18 commit e4156b7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
17 changes: 17 additions & 0 deletions packages/core-commands/src/manage-reusable-blocks-command.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* WordPress dependencies
*/
import { useCommand } from '@wordpress/commands';
import { __ } from '@wordpress/i18n';
import { external } from '@wordpress/icons';

export function useManageReusableBlocksCommand() {
useCommand( {
name: 'core/manage-reusable-blocks',
label: __( 'Manage all custom patterns' ),
callback: () => {
document.location.href = 'edit.php?post_type=wp_block';
},
icon: external,
} );
}
2 changes: 2 additions & 0 deletions packages/core-commands/src/private-apis.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
* Internal dependencies
*/
import { useAddPostTypeCommands } from './add-post-type-commands';
import { useManageReusableBlocksCommand } from './manage-reusable-blocks-command';
import { useSiteEditorNavigationCommands } from './site-editor-navigation-commands';
import { lock } from './lock-unlock';

function useCommands() {
useAddPostTypeCommands();
useManageReusableBlocksCommand();
useSiteEditorNavigationCommands();
}

Expand Down

0 comments on commit e4156b7

Please sign in to comment.