post_action_{$action}

ACTION wp-admin\post.php (ligne 363) github
Fires for a given custom post action request. The dynamic portion of the hook name, `$action`, refers to the custom post action.

Paramètres

Entrée :
$post_id
Sortie :
@param int $post_id Post ID sent with the request.

Utilisation

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

function ma_fonction_personnalisee($post_id) {
    // Votre code ici
    error_log('Hook post_action_{$action} déclenché');
}

Actualités

Chargement des actualités...