-
Home
-
Post Grid and Gutenberg Blocks
- Tips
How to Hide Post Grid Gutenberg Blocks Admin Menus
function plt_hide_post_grid_menus() {
//Hide "Combo Blocks".
remove_menu_page('post-grid');
//Hide "Combo Blocks → All Post Grid".
remove_submenu_page('post-grid', 'edit.php?post_type=post_grid');
//Hide "Combo Blocks → All Saved Templates".
remove_submenu_page('post-grid', 'edit.php?post_type=post_grid_template');
//Hide "Combo Blocks → All Saved Layouts".
remove_submenu_page('post-grid', 'edit.php?post_type=post_grid_layout');
//Hide "Combo Blocks → Create New".
remove_submenu_page('post-grid', 'post-new.php?post_type=post_grid');
//Hide "Combo Blocks → Import Layouts".
remove_submenu_page('post-grid', 'import_layouts');
//Hide "Combo Blocks → Settings".
remove_submenu_page('post-grid', 'post-grid-settings');
//Hide "Combo Blocks → Dashboard".
remove_submenu_page('post-grid', 'post-grid-dashboard');
//Hide "Combo Blocks → Overview".
remove_submenu_page('post-grid', 'post-grid-overview');
}
add_action('admin_menu', 'plt_hide_post_grid_menus', 11);
Where do I put this code?
How to Hide Post Grid Gutenberg Blocks Meta Boxes
function plt_hide_post_grid_metaboxes() {
$screen = get_current_screen();
if ( !$screen ) {
return;
}
//Hide the "Post Grid - Post Options" meta box.
remove_meta_box('post-grid-post-option', $screen->id, 'normal');
//Hide the "Post Grid Options" meta box.
remove_meta_box('post-grid', $screen->id, 'normal');
//Hide the "Post Grid Info" meta box.
remove_meta_box('post-grid-side', $screen->id, 'side');
//Hide the "Layout data" meta box.
remove_meta_box('post-grid-layout', $screen->id, 'normal');
}
add_action('add_meta_boxes', 'plt_hide_post_grid_metaboxes', 20);