Changeset 41665
- Timestamp:
- 10/02/2017 03:08:18 AM (7 years ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/ms-blogs.php
r41661 r41665 1286 1286 $post = get_post( $post_id ); 1287 1287 1288 if ( ! $post || 'publish' !== $post->post_status ) {1288 if ( ! $post || 'publish' !== $post->post_status || 'post' !== $post->post_type ) { 1289 1289 return; 1290 1290 } … … 1297 1297 * 1298 1298 * @since 4.0.0 1299 * 1300 * @param string $new_status The status the post is changing to. 1301 * @param string $old_status The status the post is changing from. 1302 */ 1303 function _update_posts_count_on_transition_post_status( $new_status, $old_status ) { 1299 * @since 4.9.0 Added the `$post` parameter. 1300 * 1301 * @param string $new_status The status the post is changing to. 1302 * @param string $old_status The status the post is changing from. 1303 * @param WP_Post $post Post object 1304 */ 1305 function _update_posts_count_on_transition_post_status( $new_status, $old_status, $post = null ) { 1304 1306 if ( $new_status === $old_status ) { 1305 1307 return; 1306 1308 } 1307 1309 1310 if ( 'post' !== get_post_type( $post ) ) { 1311 return; 1312 } 1313 1308 1314 if ( 'publish' !== $new_status && 'publish' !== $old_status ) { 1309 1315 return; -
trunk/src/wp-includes/ms-default-filters.php
r41625 r41665 55 55 add_action( 'delete_post', '_update_blog_date_on_post_delete' ); 56 56 add_action( 'transition_post_status', '_update_blog_date_on_post_publish', 10, 3 ); 57 add_action( 'transition_post_status', '_update_posts_count_on_transition_post_status', 10, 2);57 add_action( 'transition_post_status', '_update_posts_count_on_transition_post_status', 10, 3 ); 58 58 59 59 // Counts
Note: See TracChangeset
for help on using the changeset viewer.