woocommerce_order_actions
Filter: woocommerce_order_actions Allows filtering of the available order actions for an order.
Использование
add_filter( 'woocommerce_order_actions', 'wp_kama_woocommerce_order_actions_filter', 10, 2 );
/**
* Function for `woocommerce_order_actions` filter-hook.
*
* @param array $actions The available order actions for the order.
* @param WC_Order|null $order The order object or null if no order is available.
*
* @return array
*/
function wp_kama_woocommerce_order_actions_filter( $actions, $order ){
// filter...
return $actions;
}
- $actions(массив)
- The available order actions for the order.
- $order(WC_Order|null)
- The order object or null if no order is available.
Список изменений
| С версии 2.1.0 | Введена. |
| С версии 2.1.0 | Filter was added. |
| С версии 5.8.0 | The $order param was added. |
Где вызывается хук
woocommerce_order_actions
woocommerce/includes/admin/meta-boxes/class-wc-meta-box-order-actions.php 228
return apply_filters( 'woocommerce_order_actions', $actions, $order );