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

Any way to change post/page status when editing page?

When editing a page, click on the cog wheel in the upper right corner to ensure the sidebar displays. There should be two tabs: Document and Block. Make sure Document is selected. There is an accordion item called Status & visibility, among Permalink, Discussion, and Page Attributes. If you click on Status & visibility to … Read more

retrieve post details in loop

First, change those = to === as mentioned by @sally-cj in the comment. On top of that, you’re saving the status as a variable called $stat and are then checking it as $status. So you might want to change $stat = get_post_status($job->ID); into $status = get_post_status($job->ID);. Or better: the $job is already populated with a … Read more