woocommerce_rest_insert_product_attribute

ACTION woocommerce\includes\rest-api\Controllers\Version3\class-wc-rest-product-attributes-controller.php (ligne 101) github
Fires after a single product attribute is created or updated via the REST API.

Paramètres

Entrée :
$attribute, $request, true
Sortie :
@param stdObject       $attribute Inserted attribute object.
@param WP_REST_Request $request   Request object.
@param boolean         $creating  True when creating attribute, false when updating.

Utilisation

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

function ma_fonction_personnalisee($attribute, $request, true) {
    // Votre code ici
    error_log('Hook woocommerce_rest_insert_product_attribute déclenché');
}

Actualités

Chargement des actualités...