woocommerce_default_order_status хук-фильтрWC 1.0

In view context, return the default status if no status has been set.

Использование

add_filter( 'woocommerce_default_order_status', 'wp_kama_woocommerce_default_order_status_filter' );

/**
 * Function for `woocommerce_default_order_status` filter-hook.
 * 
 * @param  $string 
 *
 * @return 
 */
function wp_kama_woocommerce_default_order_status_filter( $string ){

	// filter...
	return $string;
}
$string
-

Где вызывается хук

WC_Abstract_Order::get_status()
woocommerce_default_order_status
Abstract_WC_Order_Data_Store_CPT::get_post_status()
woocommerce_default_order_status
woocommerce/includes/abstracts/abstract-wc-order.php 364
$status = apply_filters( 'woocommerce_default_order_status', 'pending' );
woocommerce/includes/data-stores/abstract-wc-order-data-store-cpt.php 245
$order_status = apply_filters( 'woocommerce_default_order_status', 'pending' );

Где используется хук в WooCommerce

woocommerce/packages/woocommerce-blocks/src/StoreApi/Utilities/OrderController.php 29
add_filter( 'woocommerce_default_order_status', array( $this, 'default_order_status' ) );
woocommerce/packages/woocommerce-blocks/src/StoreApi/Utilities/OrderController.php 36
remove_filter( 'woocommerce_default_order_status', array( $this, 'default_order_status' ) );