woocommerce_order_actions
Filter: woocommerce_order_actions Allows filtering of the available order actions for an order.
Usage
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(array)
- The available order actions for the order.
- $order(WC_Order|null)
- The order object or null if no order is available.
Changelog
Since 2.1.0 | Introduced. |
Since 2.1.0 | Filter was added. |
Since 5.8.0 | The $order param was added. |
Where the hook is called
woocommerce_order_actions
woocommerce/includes/admin/meta-boxes/class-wc-meta-box-order-actions.php 228
return apply_filters( 'woocommerce_order_actions', $actions, $order );