Skip to content

Instantly share code, notes, and snippets.

@jamesmthornton
Created December 9, 2021 15:44
Show Gist options
  • Save jamesmthornton/c798ed8344a26fbd842a4ddeb415c011 to your computer and use it in GitHub Desktop.
Save jamesmthornton/c798ed8344a26fbd842a4ddeb415c011 to your computer and use it in GitHub Desktop.
add reusable blocks to wp admin
add_action( 'admin_menu', 'add_wp_blocks_to_menu' );
function add_wp_blocks_to_menu(){
global $menu;
add_menu_page( 'global_blocks', 'Global Blocks', 'read', 'wp_block', '', 'dashicons-align-right', 1 );
$menu[1][2] = "/wp-admin/edit.php?post_type=wp_block";
}
// https://indiyoung.wpengine.com/wp-admin/edit.php?post_type=wp_block
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment