diff --git a/plugins/wporg-5ftf/includes/pledge.php b/plugins/wporg-5ftf/includes/pledge.php index fd4d8d2..bad1f69 100755 --- a/plugins/wporg-5ftf/includes/pledge.php +++ b/plugins/wporg-5ftf/includes/pledge.php @@ -16,10 +16,22 @@ const SLUG = 'pledge'; const SLUG_PL = 'pledges'; const CPT_ID = FiveForTheFuture\PREFIX . '_' . SLUG; -add_action( 'init', __NAMESPACE__ . '\register_custom_post_type', 0 ); +add_action( 'init', __NAMESPACE__ . '\register', 0 ); /** - * Register the post type. + * Register all the things. + * + * @return void + */ +function register() { + register_custom_post_type(); + register_custom_post_status(); +} + +/** + * Register the post type(s). + * + * @return void */ function register_custom_post_type() { $labels = array( @@ -71,3 +83,22 @@ function register_custom_post_type() { register_post_type( CPT_ID, $args ); } + +/** + * Register the post status(es). + * + * @return void + */ +function register_custom_post_status() { + register_post_status( + FiveForTheFuture\PREFIX . '-deactivated', + array( + 'label' => __( 'Deactivated', 'wporg' ), + 'label_count' => _n_noop( 'Deactivated (%s)', 'Deactivated (%s)', 'wporg' ), + 'public' => false, + 'internal' => false, + 'protected' => true, + CPT_ID => true, // Custom parameter to streamline its use with the Pledge CPT. + ) + ); +}