Not allow add New Page for role 'editor'

admin2025-06-07  30

Sorry for my English first.

What I want to achive is, that it is possible to change existing posts and not possible to add New Posts for the user role "Editor". Is it possible with wp caps or do I need a ugly JS-Hack... to achive this?

Hi there. Did i missed something? What I've done so far

function fsi_remove_addCap() {

        global $wp_roles;
        $wp_roles->add_cap( 'editor', 'create_pages' );
        $wp_roles->remove_cap( 'editor', 'edit_pages' );

}
add_action( 'init', 'fsi_remove_addCap' );

Result: It's impossible to edit existing pages too.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1749255414a317656.html

最新回复(0)