Remove double-query for Author ID. Props simonwheatley. Fixes #12048

git-svn-id: https://develop.svn.wordpress.org/trunk@14160 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse 2010-04-19 10:50:03 +00:00
parent c79e18467b
commit 6f89c1a63a

View File

@ -2080,7 +2080,6 @@ class WP_Query {
}
}
$q['author_name'] = sanitize_title($q['author_name']);
$q['author'] = $wpdb->get_var("SELECT ID FROM $wpdb->users WHERE user_nicename='".$q['author_name']."'");
$q['author'] = get_user_by('slug', $q['author_name']);
if ( $q['author'] )
$q['author'] = $q['author']->ID;