Ticket #12016: bmb_0006_t12016.patch
File bmb_0006_t12016.patch, 914 bytes (added by , 15 years ago) |
---|
-
wp-includes/general-template.php
1068 1068 if ( !is_array($cache) ) 1069 1069 $cache = array(); 1070 1070 1071 // Quick check. If we have no posts at all, abort! 1072 if ( !$posts ) { 1071 // Quick check if at least one element in $posts is published post 1072 $flag=false; 1073 if ( $posts ) { 1074 foreach($posts as $post){ 1075 if($post->post_type == 'post' && $post->post_status == 'publish'){ 1076 $flag = true; 1077 break; 1078 } 1079 } 1080 } 1081 // If we have no posts at all or we don't know if we have or no published posts, abort! 1082 if( !$posts || $flag == false ) { 1073 1083 $gotsome = $wpdb->get_var("SELECT 1 as test FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' LIMIT 1"); 1074 1084 if ( !$gotsome ) { 1075 1085 $cache[ $key ] = '';