_update_posts_count_on_transition_post_status
函数
_update_posts_count_on_transition_post_status ( $new_status, $old_status, $post = null )
- 参数
-
-
(string)
$new_status
The status the post is changing to.- Required: 是
-
(string)
$old_status
The status the post is changing from.- Required: 是
-
(WP_Post)
$post
Post object- Required: 否
- Default: null
-
(string)
- 定义位置
-
-
wp-includes/ms-blogs.php
, line 903
-
wp-includes/ms-blogs.php
- 引入
- 4.0.0
- 弃用
- –
Handler for updating the current site’s posts count when a post status changes.
function _update_posts_count_on_transition_post_status( $new_status, $old_status, $post = null ) { if ( $new_status === $old_status ) { return; } if ( 'post' !== get_post_type( $post ) ) { return; } if ( 'publish' !== $new_status && 'publish' !== $old_status ) { return; } update_posts_count(); }
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。