mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
Cache user lookups made by nicename. Add get_user_by(). fixes #4170
git-svn-id: https://develop.svn.wordpress.org/trunk@10992 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -2004,6 +2004,9 @@ 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;
|
||||
$whichauthor .= " AND ($wpdb->posts.post_author = ".absint($q['author']).')';
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user