Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
/**
* Reusable Blocks Management
*
* @package Reusable_Block_Management
* @author Bernhard Kau
* @license GPLv3
*
* @wordpress-plugin
* Plugin Name: Reusable Blocks Management
* Plugin URI: https://kau-boys.de
* Description: Adds a submenu item to access the reusable block overview.
* Version: 0.1
* Author: Bernhard Kau
* Author URI: https://kau-boys.de
* License: GPLv3
* License URI: http://www.gnu.org/licenses/gpl-3.0.txt
*/
/**
* Adds a link to the reusable blocks overview
*/
function reusable_blocks_management_add_submenu_page() {
add_submenu_page(
'tools.php',
__( 'Blocks' ),
__( 'Blocks' ),
'edit_pages',
'edit.php?post_type=wp_block'
);
}
add_action( 'admin_init', 'reusable_blocks_management_add_submenu_page' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.