Make WordPress Core

Ticket #2160: 2160.diff

File 2160.diff, 843 bytes (added by davidhouse, 18 years ago)
  • wp-includes/template-functions-post.php

     
    198198        if ( isset($post_meta_cache[$id]) ) {
    199199                return $post_meta_cache[$id];
    200200        } else {
     201                echo 'dbing';
    201202                if ( $meta_list = $wpdb->get_results("SELECT post_id, meta_key, meta_value FROM $wpdb->postmeta WHERE post_id = '$id' ORDER BY post_id, meta_key", ARRAY_A) ) {
    202203                        // Change from flat structure to hierarchical:
    203204                        $post_meta_cache = array();
     
    234235function get_post_custom_values($key='') {
    235236        global $id, $post_meta_cache;
    236237
    237         return $post_meta_cache[$id][$key];
     238        if (empty($key)) {
     239                return $post_meta_cache[$id];
     240        } else {
     241                return get_post_custom();
     242        }
    238243}
    239244
    240245