Changes between Initial Version and Version 2 of Ticket #13048
- Timestamp:
- 04/19/10 10:47:10 (3 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #13048 – Description
initial v2 1 1 Currently WP_Query->get_posts does this: 2 2 3 ``` $q['author'] = $wpdb->get_var("SELECT ID FROM $wpdb->users WHERE user_nicename='".$q['author_name']."'"); 3 {{{ 4 $q['author'] = $wpdb->get_var("SELECT ID FROM $wpdb->users WHERE user_nicename='".$q['author_name']."'"); 4 5 $q['author'] = get_user_by('slug', $q['author_name']); 5 ``` 6 }}} 6 7 7 8 Which potentially hits the DB twice for the same info. Looks like an old bit of functionality got left in when the get_user_by call was added. Would be better if it went like this: 8 9 9 ``` $q['author'] = get_user_by('slug', $q['author_name']); 10 ``` 10 {{{ 11 $q['author'] = get_user_by('slug', $q['author_name']); 12 }}}