/ Database / query.delete_post

Title : query.delete_post
Purpose : Trash or delete a post or page.
Syntax : [query.delete_post post_id=”575512″ force_delete=”true/false” /]
Input Parameters : post_id: (int) (Optional) Post ID. Default 0.
force_delete: (bool) (Optional) Whether to bypass trash and force deletion.
Default value: false
Return Value : It does not return anything
Example 1 :
Code : [query.delete_post post_id=”575512″ force_delete=”true” /]
Output : Deletes the Post.
Description : When the post and page are permanently deleted, everything that is tied to it is deleted also. This includes comments, post meta fields, and terms associated with the post.

The post or page is moved to Trash instead of permanently deleted unless Trash is disabled, the item is already in the Trash, or $force_delete is true.

Most Popular

Leave a Reply

Your email address will not be published.