• Resolved Stagger Lee

    (@stagger-lee)


    Pages are something that dont change for years. Problem is some change, some not. Some are build by different shortcodes for design/layut and content, and is not good to give other than Admins access to them.

    Can you make a new option in Adminimize to hide (specific, not all) Pages (not Posts) from some roles ?

    If it can help you this snippet hide them from view (they are still editable if accessed, could not find any way to disable them totally from Editors, etc)

    add_action( 'pre_get_posts' ,'exclude_this_page' );
    function exclude_this_page( $query ) {
            if( !is_admin() )
                    return $query;
            global $pagenow;
            if( 'edit.php' == $pagenow && ( get_query_var('post_type') && 'page' == get_query_var('post_type') ) )
                    $query->set( 'post__not_in', array(23,28,30) ); // page id
            return $query;
    }

    https://wordpress.org/plugins/adminimize/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Frank Bueltge

    (@bueltge)

    Hey.
    The topic is not new for me, different requests aver the time.
    The problem is, that it give installs with a lot of pages and then is it a performance topic. You must check each page for the ID and access settings.

    I add this to my issue list on the dev repo, maybe I will add this later.
    https://github.com/bueltge/Adminimize/issues/39

    best.

    Thread Starter Stagger Lee

    (@stagger-lee)

    OK, I understand problem.

    Maybe then hide them with CSS if performance is questionable ?
    We have post-type-page class and for instance <tr id=”post-1246″.

    I mean list them (Pages, not Posts) in Adminimize panel, automate and make easier to disable them with CSS. Collecting all classes would take all much time to finish it, and nothing it can be used on next website as export.

    We already have hide “Edit post” in Admin bar.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Feature request – Hide some Pages for some Roles’ is closed to new replies.