create_{$taxonomy}

ACTION wp-includes\taxonomy.php (ligne 2697) github
Fires after a new term is created for a specific taxonomy. The dynamic portion of the hook name, `$taxonomy`, refers to the slug of the taxonomy the term was created for. Possible hook names include:  - `create_category`  - `create_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 'create_{$taxonomy}'
add_action('create_{$taxonomy}', 'ma_fonction_personnalisee', 10, 1);

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

Actualités

Chargement des actualités...