本文整理汇总了PHP中wp_trash_post_comments函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_trash_post_comments函数的具体用法?PHP wp_trash_post_comments怎么用?PHP wp_trash_post_comments使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wp_trash_post_comments函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: wp_trash_post
/**
* Move a post or page to the Trash
*
* If trash is disabled, the post or page is permanently deleted.
*
* @since 2.9.0
*
* @see wp_delete_post()
*
* @param int $post_id Optional. Post ID. Default is ID of the global $post
* if EMPTY_TRASH_DAYS equals true.
* @return false|array|WP_Post|null Post data array, otherwise false.
*/
function wp_trash_post($post_id = 0)
{
if (!EMPTY_TRASH_DAYS) {
return wp_delete_post($post_id, true);
}
if (!($post = get_post($post_id, ARRAY_A))) {
return $post;
}
if ($post['post_status'] == 'trash') {
return false;
}
/**
* Fires before a post is sent to the trash.
*
* @since 3.3.0
*
* @param int $post_id Post ID.
*/
do_action('wp_trash_post', $post_id);
add_post_meta($post_id, '_wp_trash_meta_status', $post['post_status']);
add_post_meta($post_id, '_wp_trash_meta_time', time());
$post['post_status'] = 'trash';
wp_insert_post(wp_slash($post));
wp_trash_post_comments($post_id);
/**
* Fires after a post is sent to the trash.
*
* @since 2.9.0
*
* @param int $post_id Post ID.
*/
do_action('trashed_post', $post_id);
return $post;
}
开发者ID:SayenkoDesign,项目名称:ividf,代码行数:47,代码来源:post.php
示例2: wp_trash_post
/**
* Moves a post or page to the Trash
*
* If trash is disabled, the post or page is permanently deleted.
*
* @since 2.9.0
* @uses do_action() on 'trash_post' before trashing
* @uses do_action() on 'trashed_post' after trashing
* @uses wp_delete_post() if trash is disabled
*
* @param int $post_id Post ID.
* @return mixed False on failure
*/
function wp_trash_post($post_id = 0)
{
if (!EMPTY_TRASH_DAYS) {
return wp_delete_post($post_id, true);
}
if (!($post = wp_get_single_post($post_id, ARRAY_A))) {
return $post;
}
if ($post['post_status'] == 'trash') {
return false;
}
do_action('trash_post', $post_id);
add_post_meta($post_id, '_wp_trash_meta_status', $post['post_status']);
add_post_meta($post_id, '_wp_trash_meta_time', time());
$post['post_status'] = 'trash';
wp_insert_post($post);
wp_trash_post_comments($post_id);
do_action('trashed_post', $post_id);
return $post;
}
开发者ID:BGCX261,项目名称:zombie-craft-svn-to-git,代码行数:33,代码来源:post.php
示例3: trashed_post_comments
public function trashed_post_comments($post_id, $statuses)
{
wp_trash_post_comments($post_id);
}
开发者ID:kanei,项目名称:vantuch.cz,代码行数:4,代码来源:class.jetpack-sync-wp-replicastore.php
注:本文中的wp_trash_post_comments函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论