Make WordPress Core

Ticket #22448: 22448.3.diff

File 22448.3.diff, 739 bytes (added by scribu, 13 years ago)
  • wp-includes/post.php

    diff --git wp-includes/post.php wp-includes/post.php
    index eecdd7b..24450ce 100644
    final class WP_Post { 
    571571                if ( !$post_id )
    572572                        return false;
    573573
    574                 if ( ! $_post = wp_cache_get( $post_id, 'posts' ) ) {
     574                $_post = wp_cache_get( $post_id, 'posts' );
     575
     576                if ( !$_post ) {
    575577                        $_post = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->posts WHERE ID = %d LIMIT 1", $post_id ) );
    576578
    577579                        if ( ! $_post )
    final class WP_Post { 
    579581
    580582                        $_post = sanitize_post( $_post, 'raw' );
    581583                        wp_cache_add( $_post->ID, $_post, 'posts' );
     584                } elseif ( empty( $_post->filter ) ) {
     585                        $_post = sanitize_post( $_post, 'raw' );
    582586                }
    583587
    584588                return new WP_Post( $_post );