WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Blocks\Domain\Services

DraftOrders::delete_draft_order_post_status_from_args() public WC 1.0

Remove draft status from the 'status' argument of an $args array.

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

No Hooks.

Return

Array.

Usage

$DraftOrders = new DraftOrders();
$DraftOrders->delete_draft_order_post_status_from_args( $args );
$args(array) (required)
Array of arguments containing statuses in the status key.

Code of DraftOrders::delete_draft_order_post_status_from_args() WC 5.7.0

public function delete_draft_order_post_status_from_args( $args ) {
	if ( ! array_key_exists( 'status', $args ) ) {
		$statuses = [];
		foreach ( wc_get_order_statuses() as $key => $label ) {
			if ( self::DB_STATUS !== $key ) {
				$statuses[] = str_replace( 'wc-', '', $key );
			}
		}
		$args['status'] = $statuses;
	} elseif ( self::DB_STATUS === $args['status'] ) {
		$args['status'] = '';
	} elseif ( is_array( $args['status'] ) ) {
		$args['status'] = array_diff_key( $args['status'], array( self::STATUS => null ) );
	}

	return $args;
}