WPDev.one
Core Function
View Source on Trac ↗

wp_trash_post()

wp_trash_post( mixed $post_id = 0 )

Moves a post or page to the Trash

Parameters 1 required

Name / Type Description
int

$post_id Optional. Post ID. Default is the ID of the global `$post` if `EMPTY_TRASH_DAYS` equals true.

Required

Return Value

((WP_Post)
| false | null) Post data on success, false or null on failure.

Function Information

Since Version
2.9.0
Source File
wp-includes/post.php
Advertisement