• eyeghoti

    (@eyeghoti)


    Is there any way to limit access to Trash to Admin, or at the very least limit the ability to Permanently Delete to Admin.

    I don’t want to stop other roles from Deleting what they create, and am not bothered either way whether they can recover posts / pics etc but I don’t want them to have access to the Permanently Delete function.

    (I’m running Advanced Access Manager, and that can disable Delete capabilities, but there doesn’t seem to be away to limit that to Permanently Delete.)

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    Use the ‘pre_delete_post’ filter. Your callback is passed 3 parameters. The third is true for a request to permanently delete a post. So if that 3rd parm is true and the current user is not an admin, return false. This will cause the deletion to fail and the message ‘Error in deleting.’ displayed. Not very informative, but at least the post was not lost.

    Otherwise return the first passed parm, which should be null

    Thread Starter eyeghoti

    (@eyeghoti)

    Thanks.
    (I think I’m going to have to learn to write my own filters. Ha ha ha!!!)

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Admin only access to trash?’ is closed to new replies.