pre_delete_post

FILTER wp-includes\post.php (ligne 3811) github
Filters whether a post deletion should take place.

Paramètres

Entrée :
null, $post, $force_delete
Sortie :
@param WP_Post|false|null $check        Whether to go forward with deletion. Anything other than null will short-circuit deletion.
@param WP_Post            $post         Post object.
@param bool               $force_delete Whether to bypass the Trash.

Utilisation

// Modifier la valeur avec le filtre 'pre_delete_post'
add_filter('pre_delete_post', 'ma_fonction_filtre', 10, 1);

function ma_fonction_filtre(null) {
    // Modifier la valeur
    return null;
}

Actualités

Chargement des actualités...