I figured this out. I am not a coder but this does the job for me.
1) Limit available statuses based on current post status. This is a modified version available on the “extend” page of the plugin.
Basically, $permitted_statuses lists all possible statuses which you want to allow users to choose from at any given stage.
Then, I used $permitted_on_initial, $permitted_on_assigned, and $permitted_on_inprogress to limit available statuses based on these stages.
For instance, I am allowing draft to only show when the status is in progress.
—————–
function efx_limit_custom_statuses_by_role( $custom_statuses ) {
$current_user = wp_get_current_user();
// $post = get_post();
switch( $current_user->roles[0] ) {
// Only allow a contributor to access specific statuses from the dropdown
case 'contributor':
$permitted_statuses = array(
'initial-idea',
'assigned',
'in-progress',
'draft',
);
$permitted_on_initial = 'initial-idea';
$permitted_on_assigned = 'assigned';
$permitted_on_inprogress = array(
'in-progress',
'draft',
);
// Remove the custom status if it's not whitelisted
foreach( $custom_statuses as $key => $custom_status ) {
if (!in_array( $custom_status->slug, $permitted_statuses ) || $custom_status->slug =='initial-idea' && !in_array( $custom_status->slug, $permitted_on_initial ) || $custom_status->slug =='assigned' && !in_array( $custom_status->slug, $permitted_on_assigned ) || $custom_status->slug =='in-progress' && !in_array( $custom_status->slug, $permitted_on_inprogress ) )
unset( $custom_statuses[$key] );
}
break;
}
return $custom_statuses;
}
add_filter( 'ef_custom_status_list', 'efx_limit_custom_statuses_by_role' );