mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-12 19:26:35 +09:00
797bc2fd98
git-subtree-dir: includes/lib/action-scheduler git-subtree-split: c828347715e6c3318c8ab8b4fea2d87b31d51aac
63 lines
1.8 KiB
PHP
63 lines
1.8 KiB
PHP
<?php
|
|
|
|
/**
|
|
* Class ActionScheduler_wpPostStore_PostStatusRegistrar
|
|
* @codeCoverageIgnore
|
|
*/
|
|
class ActionScheduler_wpPostStore_PostStatusRegistrar {
|
|
|
|
/**
|
|
* Registrar.
|
|
*/
|
|
public function register() {
|
|
register_post_status( ActionScheduler_Store::STATUS_RUNNING, array_merge( $this->post_status_args(), $this->post_status_running_labels() ) );
|
|
register_post_status( ActionScheduler_Store::STATUS_FAILED, array_merge( $this->post_status_args(), $this->post_status_failed_labels() ) );
|
|
}
|
|
|
|
/**
|
|
* Build the args array for the post type definition
|
|
*
|
|
* @return array
|
|
*/
|
|
protected function post_status_args() {
|
|
$args = array(
|
|
'public' => false,
|
|
'exclude_from_search' => false,
|
|
'show_in_admin_all_list' => true,
|
|
'show_in_admin_status_list' => true,
|
|
);
|
|
|
|
return apply_filters( 'action_scheduler_post_status_args', $args );
|
|
}
|
|
|
|
/**
|
|
* Build the args array for the post type definition
|
|
*
|
|
* @return array
|
|
*/
|
|
protected function post_status_failed_labels() {
|
|
$labels = array(
|
|
'label' => _x( 'Failed', 'post', 'action-scheduler' ),
|
|
/* translators: %s: count */
|
|
'label_count' => _n_noop( 'Failed <span class="count">(%s)</span>', 'Failed <span class="count">(%s)</span>', 'action-scheduler' ),
|
|
);
|
|
|
|
return apply_filters( 'action_scheduler_post_status_failed_labels', $labels );
|
|
}
|
|
|
|
/**
|
|
* Build the args array for the post type definition
|
|
*
|
|
* @return array
|
|
*/
|
|
protected function post_status_running_labels() {
|
|
$labels = array(
|
|
'label' => _x( 'In-Progress', 'post', 'action-scheduler' ),
|
|
/* translators: %s: count */
|
|
'label_count' => _n_noop( 'In-Progress <span class="count">(%s)</span>', 'In-Progress <span class="count">(%s)</span>', 'action-scheduler' ),
|
|
);
|
|
|
|
return apply_filters( 'action_scheduler_post_status_running_labels', $labels );
|
|
}
|
|
}
|