WordPress at Your Fingertips
function is not described

WC_Post_Types::register_post_status() public WC 1.0

Register our custom post statuses, used for order status.

{} It's a method of the class: WC_Post_Types{}

Return

null. Nothing.

Usage

$result = WC_Post_Types::register_post_status();

Code of WC_Post_Types::register_post_status() WC 5.6.0

public static function register_post_status() {

	$order_statuses = apply_filters(
		'woocommerce_register_shop_order_post_statuses',
		array(
			'wc-pending'    => array(
				'label'                     => _x( 'Pending payment', 'Order status', 'woocommerce' ),
				'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( 'Pending payment <span class="count">(%s)</span>', 'Pending payment <span class="count">(%s)</span>', 'woocommerce' ),
			),
			'wc-processing' => array(
				'label'                     => _x( 'Processing', 'Order status', 'woocommerce' ),
				'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( 'Processing <span class="count">(%s)</span>', 'Processing <span class="count">(%s)</span>', 'woocommerce' ),
			),
			'wc-on-hold'    => array(
				'label'                     => _x( 'On hold', 'Order status', 'woocommerce' ),
				'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( 'On hold <span class="count">(%s)</span>', 'On hold <span class="count">(%s)</span>', 'woocommerce' ),
			),
			'wc-completed'  => array(
				'label'                     => _x( 'Completed', 'Order status', 'woocommerce' ),
				'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( 'Completed <span class="count">(%s)</span>', 'Completed <span class="count">(%s)</span>', 'woocommerce' ),
			),
			'wc-cancelled'  => array(
				'label'                     => _x( 'Cancelled', 'Order status', 'woocommerce' ),
				'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( 'Cancelled <span class="count">(%s)</span>', 'Cancelled <span class="count">(%s)</span>', 'woocommerce' ),
			),
			'wc-refunded'   => array(
				'label'                     => _x( 'Refunded', 'Order status', 'woocommerce' ),
				'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( 'Refunded <span class="count">(%s)</span>', 'Refunded <span class="count">(%s)</span>', 'woocommerce' ),
			),
			'wc-failed'     => array(
				'label'                     => _x( 'Failed', 'Order status', 'woocommerce' ),
				'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( 'Failed <span class="count">(%s)</span>', 'Failed <span class="count">(%s)</span>', 'woocommerce' ),
			),
		)
	);

	foreach ( $order_statuses as $order_status => $values ) {
		register_post_status( $order_status, $values );
	}
}