Archived topic
Where are all my reusable blocks?
3 replies · Started by Martin on September 14, 2022
Hi
I created a couple of reusable blocks (I have GeneratePress and GenerateBlocks (both premium).
The only way I know of to access a reusable block is to go into a page that has that block, go to the page structure, locate that block / container and then find 'Manage Reusable Blocks'.
Where can I just go to all Reusable Blocks without having to go to a page that contains one?
Thanks
Martin
Hi Martin,
Reusable Blocks aren't part of GeneratePress or GenerateBlocks. It's a WordPress functionality.
One way to add a link to it is through a PHP snippet:
function add_my_reusable() {
global $submenu;
$permalink = admin_url( 'edit.php' ).'?post_type=wp_block';
$submenu['edit.php'][] = array( __('Reusable Blocks'), 'edit_posts', $permalink );
$submenu['edit.php?post_type=page'][] = array( __('Reusable Blocks'), 'edit_posts', $permalink );
}
add_action( 'admin_menu', 'add_my_reusable' );
Adding PHP: https://docs.generatepress.com/article/adding-php/#code-snippets
OMG! All this time I thought it was part of GP & GB.
Thanks for the info Fernando.
You're welcome Martin! The one part of GB is the Pattern Library and Local Patterns which has a similar functionality: https://docs.generateblocks.com/article/pattern-library-overview/#local-patterns