-
Home
-
Custom Post Carousels with Owl
- Tips
How to Hide Custom Post Carousels with Owl Admin Menus
function plt_hide_dd_post_carousel_menus() {
//Hide the "Carousels" menu.
remove_menu_page('edit.php?post_type=owl-carousel');
//Hide the "Carousels → All Carousels" menu.
remove_submenu_page('edit.php?post_type=owl-carousel', 'edit.php?post_type=owl-carousel');
//Hide the "Carousels → Add New Carousel Item" menu.
remove_submenu_page('edit.php?post_type=owl-carousel', 'post-new.php?post_type=owl-carousel');
}
add_action('admin_menu', 'plt_hide_dd_post_carousel_menus', 15);
Where do I put this code?
How to Hide Custom Post Carousels with Owl Meta Boxes
function plt_hide_dd_post_carousel_metaboxes() {
$screen = get_current_screen();
if ( !$screen ) {
return;
}
//Hide the "Carousel Data" meta box.
remove_meta_box('Carousel_Data', $screen->id, 'normal');
//Hide the "Carousel Functionality" meta box.
remove_meta_box('owl-carousel-settings', $screen->id, 'side');
//Hide the "Items Displayed" meta box.
remove_meta_box('owl-items-displayed', $screen->id, 'side');
//Hide the "Shortcode" meta box.
remove_meta_box('owl-shortcode-link', $screen->id, 'side');
}
add_action('add_meta_boxes', 'plt_hide_dd_post_carousel_metaboxes', 20);