Languages: English • 日本語 (Add your language)
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 the default WordPress Post, "Hello World," which has an ID of '1'.
<?php wp_trash_post( 1 ); ?>
Since: 2.9.0
wp_trash_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()