Automattic\WooCommerce\Internal\Admin
Settings::get_order_statuses()
Format order statuses by removing a leading 'wc-' if present.
Method of the class: Settings{}
No Hooks.
Return
Array
. formatted statuses.
Usage
$result = Settings::get_order_statuses( $statuses );
- $statuses(array) (required)
- Order statuses.
Settings::get_order_statuses() Settings::get order statuses code WC 8.7.0
public static function get_order_statuses( $statuses ) { $formatted_statuses = array(); foreach ( $statuses as $key => $value ) { $formatted_key = preg_replace( '/^wc-/', '', $key ); $formatted_statuses[ $formatted_key ] = $value; } return $formatted_statuses; }