woocommerce_before_trash_order

ACTION woocommerce\src\Internal\DataStores\Orders\OrdersTableDataStore.php (ligne 2476) github
Fires immediately before an order is trashed.

Paramètres

Entrée :
$order_id, $order
Sortie :
@param int      $order_id ID of the order about to be trashed.
@param WC_Order $order    Instance of the order that is about to be trashed.

Utilisation

// Ajouter une fonction au hook action 'woocommerce_before_trash_order'
add_action('woocommerce_before_trash_order', 'ma_fonction_personnalisee', 10, 1);

function ma_fonction_personnalisee($order_id, $order) {
    // Votre code ici
    error_log('Hook woocommerce_before_trash_order déclenché');
}

Actualités

Chargement des actualités...