_x( 'Refused', 'Order status', 'codwarden' ),
'public' => false,
'exclude_from_search' => false,
'show_in_admin_all_list' => true,
'show_in_admin_status_list' => true,
/* translators: %s: number of orders */
'label_count' => _n_noop( 'Refused (%s)', 'Refused (%s)', 'codwarden' ),
)
);
}
/**
* Add Refused after Failed in the status list.
*
* @param array $statuses Statuses.
* @return array
*/
public static function add_status( $statuses ) {
$out = array();
foreach ( $statuses as $key => $label ) {
$out[ $key ] = $label;
if ( 'wc-failed' === $key ) {
$out['wc-refused'] = _x( 'Refused', 'Order status', 'codwarden' );
}
}
if ( ! isset( $out['wc-refused'] ) ) {
$out['wc-refused'] = _x( 'Refused', 'Order status', 'codwarden' );
}
return $out;
}
/**
* Activation.
*
* @return void
*/
public static function activate() {
CODWarden_Store::install();
if ( ! wp_next_scheduled( self::CRON ) ) {
wp_schedule_event( time() + HOUR_IN_SECONDS, 'daily', self::CRON );
}
}
/**
* Deactivation.
*
* @return void
*/
public static function deactivate() {
wp_clear_scheduled_hook( self::CRON );
}
}