edit_post_{$post->post_type}

ACTION wp-includes\post.php (ligne 5141) github
Fires once an existing post has been updated. The dynamic portion of the hook name, `$post->post_type`, refers to the post type slug. Possible hook names include:  - `edit_post_post`  - `edit_post_page`

Paramètres

Entrée :
$post_id, $post
Sortie :
@param int     $post_id Post ID.
@param WP_Post $post    Post object.

Utilisation

// Ajouter une fonction au hook action 'edit_post_{$post->post_type}'
add_action('edit_post_{$post->post_type}', 'ma_fonction_personnalisee', 10, 1);

function ma_fonction_personnalisee($post_id, $post) {
    // Votre code ici
    error_log('Hook edit_post_{$post->post_type} déclenché');
}

Actualités

Chargement des actualités...