Make WordPress Core


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.6/wp-includes/post.php

    r8825 r8640  
    466466        'exclude' => '', 'meta_key' => '',
    467467        'meta_value' =>'', 'post_type' => 'post',
    468         'post_parent' => 0, 'suppress_filters' => true
     468        'post_parent' => 0
    469469    );
    470470
     
    595595    $meta_cache = wp_cache_get($post_id, 'post_meta');
    596596
    597     if ( !$meta_cache ) {
    598         update_postmeta_cache($post_id);
    599         $meta_cache = wp_cache_get($post_id, 'post_meta');
    600     }
    601 
    602597    if ( isset($meta_cache[$key]) ) {
    603598        if ( $single ) {
    604599            return maybe_unserialize( $meta_cache[$key][0] );
    605600        } else {
    606             return array_map('maybe_unserialize', $meta_cache[$key]);
    607         }
    608     }
    609 
    610     return '';
     601            return maybe_unserialize( $meta_cache[$key] );
     602        }
     603    }
     604
     605    if ( !$meta_cache ) {
     606        update_postmeta_cache($post_id);
     607        $meta_cache = wp_cache_get($post_id, 'post_meta');
     608    }
     609
     610    if ( $single ) {
     611        if ( isset($meta_cache[$key][0]) )
     612            return maybe_unserialize($meta_cache[$key][0]);
     613        else
     614            return '';
     615    } else {
     616        return maybe_unserialize($meta_cache[$key]);
     617    }
    611618}
    612619
     
    32913298        return;
    32923299
    3293     if ( isset($post['post_type']) && 'revision' == $post['post_type'] )
     3300    if ( isset($post['post_type']) && 'revision' == $post_post['type'] )
    32943301        return new WP_Error( 'post_type', __( 'Cannot create a revision of a revision' ) );
    32953302
Note: See TracChangeset for help on using the changeset viewer.