woocommerce_default_order_status
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 | Введена. |
Где вызывается хук
woocommerce_default_order_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' ) );