mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
Resolve table ambiguity.Props filosofo. fixes #3091
git-svn-id: https://develop.svn.wordpress.org/trunk@4155 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -482,7 +482,7 @@ function _max_num_pages() {
|
||||
if ( 'posts' == get_query_var('what_to_show') ) {
|
||||
preg_match('#FROM\s(.*)\sORDER BY#siU', $wp_query->request, $matches);
|
||||
$fromwhere = $matches[1];
|
||||
$numposts = $wpdb->get_var("SELECT COUNT(DISTINCT ID) FROM $fromwhere");
|
||||
$numposts = $wpdb->get_var("SELECT COUNT(DISTINCT $wpdb->posts.ID) FROM $fromwhere");
|
||||
$max_num_pages = ceil($numposts / $posts_per);
|
||||
} else {
|
||||
preg_match('#FROM\s(.*)\sORDER BY#siU', $wp_query->request, $matches);
|
||||
|
||||
Reference in New Issue
Block a user