created_{$taxonomy}

ACTION wp-includes\taxonomy.php (ligne 2747) github
Fires after a new term in a specific taxonomy is created, and after the term cache has been cleaned. The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug. Possible hook names include:  - `created_category`  - `created_post_tag`

Paramètres

Entrée :
$term_id, $tt_id, $args
Sortie :
@param int   $term_id Term ID.
@param int   $tt_id   Term taxonomy ID.
@param array $args    Arguments passed to wp_insert_term().

Utilisation

// Ajouter une fonction au hook action 'created_{$taxonomy}'
add_action('created_{$taxonomy}', 'ma_fonction_personnalisee', 10, 1);

function ma_fonction_personnalisee($term_id, $tt_id, $args) {
    // Votre code ici
    error_log('Hook created_{$taxonomy} déclenché');
}

Actualités

Chargement des actualités...