WordPress.org

Ready to get started?Download WordPress

Forums

Hiding a "Post" page box (meta box?) (1 post)

  1. makphisto
    Member
    Posted 10 months ago #

    Hello,

    I'm using a theme that adds several options to the Post pages (where you add a new or edit a post - I believe these are post-new.php and post.php). Because I run a multi author site, I don't want all my users to have access to these options, but I want to retain them as admin.

    I'm trying to follow the Codex to hide this section from all users, except admin, but I can't get it to work.

    I looked at the page elements and it appears that the div ID for that section is "post_options".

    So, in functions.php, I tried the following (and some variations):

    if (is_admin()) :
    function my_remove_meta_boxes() {
     if( !current_user_can('manage_options') ) {
      remove_meta_box('post_options', 'post', 'normal');
     }
    }
    add_action( 'admin_menu', 'my_remove_meta_boxes' );
    endif;

    But that just breaks the site. Perhaps what I'm trying to move isn't a meta box? Any help would be appreciated, I'm a newish user and don't have much experience with actual code. Thanks!

Reply

You must log in to post.

About this Topic