WordPress删除文章函数:wp_delete_post
WordPress函数wp_delete_post用于删除指定ID的文章
wp_delete_post( int $postid, bool $force_delete = false )
函数参数
$postid
整数
要删除的文章ID
$force_delete
布尔值,默认值:false
是否绕过回收站直接删除
扩展阅读
wp_delete_post()函数位于:wp-includes/post.php
相关函数:
- pre_delete_post()
- wp_delete_attachment()
- wp_delete_object_term_relationships()
- wp_trash_post()