Cache empty results for adjacent post queries
git-svn-id: http://svn.automattic.com/wordpress/trunk@11243 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
d70e393e86
commit
63620ff895
|
@ -912,6 +912,9 @@ function get_adjacent_post($in_same_cat = false, $excluded_categories = '', $pre
|
||||||
return $result;
|
return $result;
|
||||||
|
|
||||||
$result = $wpdb->get_row("SELECT p.* FROM $wpdb->posts AS p $join $where $sort");
|
$result = $wpdb->get_row("SELECT p.* FROM $wpdb->posts AS p $join $where $sort");
|
||||||
|
if ( null === $result )
|
||||||
|
$result = '';
|
||||||
|
|
||||||
wp_cache_set($query_key, $result, 'counts');
|
wp_cache_set($query_key, $result, 'counts');
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue