Last active
June 27, 2019 10:22
-
-
Save jom/f0f14a53d100f118cb1450690807f37c to your computer and use it in GitHub Desktop.
WPJM: Add Custom Post Status
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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