Changeset 27057
- Timestamp:
- 01/29/2014 06:45:54 AM (11 years ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/comment.php
r27055 r27057 136 136 function get_comment(&$comment, $output = OBJECT) { 137 137 global $wpdb; 138 $null = null;139 138 140 139 if ( empty($comment) ) { … … 152 151 $_comment = $wpdb->get_row($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_ID = %d LIMIT 1", $comment)); 153 152 if ( ! $_comment ) 154 return $null;153 return null; 155 154 wp_cache_add($_comment->comment_ID, $_comment, 'comment'); 156 155 } -
trunk/src/wp-includes/revision.php
r26995 r27057 257 257 */ 258 258 function wp_get_post_revision(&$post, $output = OBJECT, $filter = 'raw') { 259 $null = null;260 259 if ( !$revision = get_post( $post, OBJECT, $filter ) ) 261 260 return $revision; 262 261 if ( 'revision' !== $revision->post_type ) 263 return $null;262 return null; 264 263 265 264 if ( $output == OBJECT ) { -
trunk/src/wp-includes/taxonomy.php
r26912 r27057 936 936 function get_term($term, $taxonomy, $output = OBJECT, $filter = 'raw') { 937 937 global $wpdb; 938 $null = null;939 938 940 939 if ( empty($term) ) { … … 955 954 $term = $term->term_id; 956 955 if ( !$term = (int) $term ) 957 return $null;956 return null; 958 957 if ( ! $_term = wp_cache_get($term, $taxonomy) ) { 959 958 $_term = $wpdb->get_row( $wpdb->prepare( "SELECT t.*, tt.* FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy = %s AND t.term_id = %d LIMIT 1", $taxonomy, $term) ); 960 959 if ( ! $_term ) 961 return $null;960 return null; 962 961 wp_cache_add($term, $_term, $taxonomy); 963 962 }
Note: See TracChangeset
for help on using the changeset viewer.