Skip to content

Instantly share code, notes, and snippets.

@jom
Last active Jun 27, 2019
Embed
What would you like to do?
WPJM: Add Custom Post Status
add_action( 'init', function() {
global $job_manager;
register_post_status( 'needs_changes', array(
'label' => _x( 'Needs Changes', 'job_listing', 'custom-code-text-domain' ),
'public' => false,
'exclude_from_search' => false,
'show_in_admin_all_list' => false,
'show_in_admin_status_list' => true,
'post_type' => array( 'job_listing' ),
'label_count' => _n_noop( 'Needs Changes <span class="count">(%s)</span>', 'Needs Changes <span class="count">(%s)</span>', 'custom-code-text-domain' ),
) );
add_filter( 'job_listing_post_statuses', function( $statuses ) {
$statuses['needs_changes'] = _x( 'Needs Changes', 'job_listing', 'custom-code-text-domain' );
return $statuses;
} );
add_action( 'needs_changes_to_publish', array( $job_manager->post_types, 'set_expiry' ) );
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment