Codex tools: Log in
Contents |
Moves a post or page to the Trash
If trash is disabled, the post or page is permanently deleted.
<?php wp_trash_post($post_id); ?>
Trash WP default post "Hello World" which ID is '1'.
<?php wp_trash_post(1); ?>
Since: 2.9.0
wp_delete_post() is located in wp-includes/post.php.
Post, Page, Attachment and Bookmarks Functions: wp_delete_post(), wp_update_post(), wp_delete_attachment(), wp_insert_attachment(), wp_insert_post()