WordPress.org

Ready to get started?Download WordPress

Forums

Restricting Post Deletion Capability for All User roles (1 post)

  1. grantlandram
    Member
    Posted 3 years ago #

    I want to restrict the ability for all user roles to delete a post (for client compliance reasons). I'm in a MS isntallation, and I don't want to use a plugin.

    Using the following code in functions.php:

    $wp_roles->remove_cap( 'administrator', 'delete_posts' );
    $wp_roles->remove_cap( 'editor', 'delete_posts' );
    repeat with every role...

    Not working, and I'm wondering if I'm not using the hook correctly. Any help is appreciated!

Topic Closed

This topic has been closed to new replies.

About this Topic