Fires once a post has been saved. The dynamic portion of the hook name, `$post->post_type`, refers to the post type slug. Possible hook names include: - `save_post_post` - `save_post_page`
$post_id, $post, $update
Sortie :
@param int $post_id Post ID. @param WP_Post $post Post object. @param bool $update Whether this is an existing post being updated.
// Ajouter une fonction au hook action 'save_post_{$post->post_type}'
add_action('save_post_{$post->post_type}', 'ma_fonction_personnalisee', 10, 1);
function ma_fonction_personnalisee($post_id, $post, $update) {
// Votre code ici
error_log('Hook save_post_{$post->post_type} déclenché');
}
Chargement des actualités...