WordPress.org

Ready to get started?Download WordPress

Forums

Role Scoper
[resolved] Remove Role/Permissions boxes from Edit screens (4 posts)

  1. emirpprime
    Member
    Posted 2 years ago #

    This is probably really obvious but I haven't found the answer yet...

    Is there a global pref to remove the Readers / Contributors / Editors boxes from the Edit screens? I know you can hide them with Screen Options but want a global switch to effect all Admins / Editors so that changes to Role Scooper settings are only made in the Settings section.

    Thanks!

    http://wordpress.org/extend/plugins/role-scoper/

  2. kevinB
    Member
    Plugin Author

    Posted 2 years ago #

    You can hide them with Adminimize using the "Your own post options
    ID or class" in Write Options.

    The ids are rs_private_post_reader, rs_post_contributor, rs_post_editor, rs_private_page_reader, rs_page_contributor, etc.

  3. emirpprime
    Member
    Posted 2 years ago #

    Hi Kevin - thanks for that!
    But I'd prefer not to use a plugin for various reasons - so eventually got it working by adding this to functions.php:

    if (is_admin()) :
    function my_remove_meta_boxes() {
      remove_meta_box('rs_private_post_reader', 'post', 'advanced');
      remove_meta_box('rs_post_contributor', 'post', 'advanced');
      remove_meta_box('rs_post_editor', 'post', 'advanced');
    [...]
    }
    add_action( 'add_meta_boxes', 'my_remove_meta_boxes' );
    endif;

    This works great except on one of my CPTs. In this case the contents of the boxes are replaced with "Warning: call_user_func() expects parameter 1 to be a valid callback, no array or string given in /Applications/MAMP/htdocs/wordpress/wp-admin/includes/template.php on line 975"
    Bizarrely a 4th meta box also appear rather than the 3 that are normally visible.
    This is the code used for the CPT:

    if (is_admin()) :
    function my_remove_meta_boxes() {
      remove_meta_box('rs_private_photo_archive_reader', 'photo_archive', 'advanced');
      remove_meta_box('rs_photo_archive_contributor', 'photo_archive', 'advanced');
      remove_meta_box('rs_photo_archive_editor', 'photo_archive', 'advanced');
    }
    add_action( 'add_meta_boxes', 'my_remove_meta_boxes' );
    endif;

    Do you see any problem or know why this might be happening?

    I might be the only one who think it's necessary - but I'd love to see a toggle in the admin added to control this rather than having to override it like this ;)

    Thanks for the support.

  4. emirpprime
    Member
    Posted 1 year ago #

    My mystery blank box has dissappeared. Either a conflict with another plugin or perhaps due to an upgrade.

    Thanks.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.