How to Add Reusable Blocks to Admin Menu

Reusable blocks allow you to create and store sections of content that can be inserted into multiple posts or pages.

By default, WordPress does not provide a way to access and edit reusable blocks outside of the individual post-editing screen.

This code snippet adds a new menu item in the WordPress admin sidebar called “Reusable Blocks,” which allows you to edit reusable blocks in a similar way to how you would edit posts or pages.

function my_reusable_blocks_admin_menu() {
	add_menu_page( 'Reusable Blocks', 'Reusable Blocks', 'edit_posts', 'edit.php?post_type=wp_block', '', 'dashicons-editor-table', 22 );
}
add_action( 'admin_menu', 'my_reusable_blocks_admin_menu' );

Keep in mind that if you make changes to a reusable block through this menu, the updates will be applied to all instances of the block within your posts and pages.”

Manuel Campos, English Professor

Manuel Campos

I am José Manuel. I am writing about things I know and things that I am learning about WordPress. I hope you find the content of this blog useful.

WP SURFER

home

about

privacy

contact

© 2024 WP SURFER • Made with Love in Costa Rica