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

Filters the default order status to use when creating a new order.

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

add_filter( 'woocommerce_default_order_status', 'wp_kama_woocommerce_default_order_status_filter' );

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

	// filter...
	return $order_status;
}
$order_status(строка)
Default order status.

Список изменений

С версии 3.7.0 Введена.

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

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

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

woocommerce/src/StoreApi/Utilities/OrderController.php 46
add_filter( 'woocommerce_default_order_status', array( $this, 'default_order_status' ) );
woocommerce/src/StoreApi/Utilities/OrderController.php 53
remove_filter( 'woocommerce_default_order_status', array( $this, 'default_order_status' ) );