wp_trash_post

FUNCTION wp-includes\post.php (ligne 3995) github
Moves a post or page to the Trash If Trash is disabled, the post or page is permanently deleted.

Paramètres

Entrée :
$post_id = 0
Sortie :
@param int $post_id Optional. Post ID. Default is the ID of the global `$post`
@return WP_Post|false|null Post data on success, false or null on failure.

Utilisation

// Utilisation de la fonction wp_trash_post
$result = wp_trash_post($post_id = 0);

if ($result) {
    // Votre logique ici
}

Actualités

Chargement des actualités...