Site logo

Archived topic

Remove layout options metabox

7 replies · Started by Robert on December 14, 2017

Viewing posts 1–8 of 8

Hello,

I'd like to be able to remove the layout options meta box for non admins so they don't go messing up the pages, is this possible?

Would you be able to supply me with the code to remove the page header meta box that shows just on posts? I would like editors to still be able to select the page header on a page if necessary.

Just the admin. I feel like it's going to confuse editors lol.

The Page Header actually has a separate filter to use: generate_page_header_metabox_capability

So you would use that instead of generate_metabox_capability

For the menu item, try this:

function wpse28782_remove_menu_items() {
    if ( ! current_user_can( 'administrator' ) ) {
        remove_menu_page( 'edit.php?post_type=generate_page_header' );
    }
}
add_action( 'admin_menu', 'wpse28782_remove_menu_items' );
This archived topic is closed to new replies.