[Resolved] Author Remove Permission

Home Forums Support [Resolved] Author Remove Permission

Home Forums Support Author Remove Permission

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1618288
    chris

    Hi should this be working correctly to make authors posts require approval?

    function return_publish_permissions() {
    $user = get_role( ‘author’ );
    $user->add_cap( ‘publish_posts’ );
    }
    register_deactivation_hook( __FILE__, ‘return_publish_permissions’ );

    function take_away_publish_permissions() {
    $user = new WP_User(5);
    $user->add_cap(‘publish_posts’,false);
    }
    register_activation_hook( __FILE__, ‘take_away_publish_permissions’ );

    Doesn’t work, quite annoying not sure where im going wrong.

    #1618726
    David
    Staff
    Customer Support

    Hi there,

    maybe the method provided here will do the job:

    https://wordpress.stackexchange.com/a/188000

    #1619170
    chris

    HI thanks sorry it was due to inexperience i dint know all the roles and permissions, i have changed default role to contributor so they can post and edit but without author perms, cheers

    #1619675
    David
    Staff
    Customer Support

    Glad to hear you found the answer!

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.