wpseek.com
A WordPress-centric search engine for devs and theme authors
_update_posts_count_on_transition_post_status › WordPress Function
Since4.0.0
Deprecatedn/a
› _update_posts_count_on_transition_post_status ( $new_status, $old_status, $post = null )
Parameters: (3) |
|
Defined at: |
|
Codex: | |
Change Log: |
|
Handler for updating the current site's posts count when a post status changes.
Source
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(); }