WordPress at Your Fingertips
function is not described


Controller::get_order_statuses() public WC 1.0

Get order statuses without prefixes. Includes unregistered statuses that have been marked "actionable".

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

No Hooks.




$result = Controller::get_order_statuses();

Code of Controller::get_order_statuses() WC 6.1.1

public static function get_order_statuses() {
	// Allow all statuses selected as "actionable" - this may include unregistered statuses.
	// See: https://github.com/woocommerce/woocommerce-admin/issues/5592.
	$actionable_statuses = get_option( 'woocommerce_actionable_order_statuses', array() );

	// See WC_REST_Orders_V2_Controller::get_collection_params() re: any/trash statuses.
	$registered_statuses = array_merge( array( 'any', 'trash' ), array_keys( self::get_order_status_labels() ) );

	// Merge the status arrays (using flip to avoid array_unique()).
	$allowed_statuses = array_keys( array_merge( array_flip( $registered_statuses ), array_flip( $actionable_statuses ) ) );

	return $allowed_statuses;