woocommerce_my_account_my_orders_actions filter-hookWC 2.0.0

Filters the actions available for an order on the My Account orders list.

Usage

add_filter( 'woocommerce_my_account_my_orders_actions', 'wp_kama_woocommerce_my_account_orders_actions_filter', 10, 2 );

/**
 * Function for `woocommerce_my_account_my_orders_actions` filter-hook.
 * 
 * @param array    $actions Array of order actions, keyed by action slug. Each action is an array with 'url' and 'name' keys.
 * @param WC_Order $order   Order instance.
 *
 * @return array
 */
function wp_kama_woocommerce_my_account_orders_actions_filter( $actions, $order ){

	// filter...
	return $actions;
}
$actions(array)
Array of order actions, keyed by action slug. Each action is an array with 'url' and 'name' keys.
$order(WC_Order)
Order instance.

Changelog

Since 2.0.0 Introduced.

Where the hook is called

wc_get_account_orders_actions()
woocommerce_my_account_my_orders_actions
woocommerce/includes/wc-account-functions.php 352
$actions = apply_filters( 'woocommerce_my_account_my_orders_actions', $actions, $order );

Where the hook is used in WooCommerce

woocommerce/includes/gateways/paypal/class-wc-gateway-paypal.php 215
add_filter( 'woocommerce_my_account_my_orders_actions', array( $this, 'hide_action_buttons' ), 10, 2 );