Automattic\WooCommerce\Internal\DataStores\Orders

HposOrderCapabilityHelper::get_wp_status_for_orderprivateWC 1.0

Get the WordPress post status equivalent for an order.

Method of the class: HposOrderCapabilityHelper{}

No Hooks.

Returns

String. Post status.

Usage

// private - for code of main (parent) class only
$result = $this->get_wp_status_for_order( $order ): string;
$order(WC_Abstract_Order) (required)
Order object.

HposOrderCapabilityHelper::get_wp_status_for_order() code WC 11.0.0

private function get_wp_status_for_order( WC_Abstract_Order $order ): string {
	$status = $order->get_status( 'edit' );
	return wc_is_order_status( 'wc-' . $status ) ? 'wc-' . $status : $status;
}