How to update post status to draft if user role is “pending’

You should be able to use the set_user_role action which is triggered when a user’s role is changed. The action function is passed the user’s ID, new role, and old role(s). Something like this: add_action( ‘set_user_role’, ‘wpse161590_set_user_role’, 10, 3 ); function wpse161590_set_user_role( $user_id, $role, $old_roles ) { if ( ‘Pending’ == $role ) { // … Read more

Changing a post status name

I think the only way is to Change it’s translation. From ‘Trash’ to ‘Archive’. But this can have side-effects. As I searched in the core file (modifying core-files is ALWAYS a BAD idea!!) there where no filter called, wich you coul hook into to Bypass…

Submitted for Review back to a Draft page

This is not a permissions issue – contributors can (by default) change a post from pending to draft. To test, submit a post for review, then “quick edit” it – you’ll see that you’re able to change the status back to draft. The issue is that the “save as draft” button in the UI is … Read more

error code: 523