woocommerce_my_account_my_orders_actions хук-фильтрWC 2.0.0

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

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

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 of order actions, keyed by action slug. Each action is an array with 'url' and 'name' keys.
$order(WC_Order)
Order instance.

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

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

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

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 );

Где используется хук в 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 );