Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #3409
    APS
    Participant

    Hello,

    I limit an editor’s role to the posts of certain contributors only using “Activate user access management to editing selected posts, pages, custom post types”.

    I don’t allow either editors or contributors to delete published posts. But this means that they can’t delete “drafts” or “pending” posts either. Consequently, there is a multipication of unwanted unpublished posts in the “posts” section of both editors and contributors.

    Is it possible to give editors permission to delete unpublished (pending and draft) posts of contributors they edit, and to give contributors the same permission to delete their own unpublished texts?

    Thanks!

    #3410
    Vladimir
    Keymaster

    Hi,
    Revoke from an editor’s role just a ‘delete_publish_posts’, but still grant to it the rest:
    ‘delete_posts’, ‘delete_others_posts’. This way editor role should be capable to delete draft and pending posts.

    ‘delete_posts’ granted to a ‘contributor’ role allows contributors to delete their own drafts.

    #3411
    APS
    Participant

    Thanks for the reply! The solution for the contributor is perfect.

    However, for the editor, it means that he can FIRST tansform a published post into a draft, and THEN delete it. But I don’t want to give editors the opportunity of deleting published articles.

    Is there any way to avoid this two-step method of deleting published posts?

    Thanks for your help!

    #3412
    Vladimir
    Keymaster

    Editor is a power user. He can edit any attribute of a published post. It means that he can change its status (as you mentioned), he can change its permalink, he can just remove/replace full content of the post.
    So 1st, I would think about stronger selecting of and more trust to so powerful users.

    There is no built in functionality in WordPress to filter posts statuses list or prevent post status change at the post edit page. If user can publish post he can change its status to one of hard coded at wp-admin/includes/meta-boxes.php, function post_submit_meta_box().

    It’s possible to write some code which will make any unpublished post back to the ‘published’ state. But I think that you will not wish to remove from editor this ability in case if he publish some post by mistake and wish return it back to a ‘draft’ or ‘pending’ status.

    An example of changing post status after post saving is available here. You can use it as a starting point.

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