Language:

Search

Impedir que los autores publiquen directamente las entradas - WordPress

  • Share this:
Impedir que los autores publiquen directamente las entradas - WordPress

If you're running a blog or a magazine & want your authors not to directly publish posts on your blog or magazine, simply put the following code in your functions.php & your problem is solved.

function remove_author_publish_posts(){

    // $wp_roles is an instance of WP_Roles.
    global $wp_roles;
    $wp_roles->remove_cap( 'author', 'publish_posts' );
}

add_action( 'init', 'remove_author_publish_posts' );

What this piece of code does?

It removes the capability from author to publish posts directly & change the value of the publish button to "Submit for review" for the administrator.

Try it yourself & let us know if you get stuck at any point.

Usama Muneer

Usama Muneer

A web enthusiastic, self-motivated & detail-oriented professional Full-Stack Web Developer from Karachi, Pakistan with experience in developing applications using JavaScript, WordPress & Laravel specifically. Loves to write on different web technologies with an equally useful skill to make some sense out of it.

Su experiencia en este sitio mejorará si permite el uso de cookies. Cookie Policy