Make WordPress Core

Changeset 29667


Ignore:
Timestamp:
09/02/2014 07:16:41 AM (10 years ago)
Author:
SergeyBiryukov
Message:

Check $post->post_status directly in _update_posts_count_on_delete() for better performance.

props pento.
fixes #27952.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/ms-blogs.php

    r29319 r29667  
    918918 */
    919919function _update_posts_count_on_delete( $post_id ) {
    920     if ( 'publish' !== get_post_field( 'post_status', $post_id ) ) {
     920    $post = get_post( $post_id );
     921
     922    if ( ! $post || 'publish' !== $post->post_status ) {
    921923        return;
    922924    }
Note: See TracChangeset for help on using the changeset viewer.