[wp-hackers] wp_list_authors and DB queries
Bob
wp-hackers at nj-arp.org
Thu Nov 22 02:16:03 GMT 2007
Wow, that's great! Thanks! But how can I change the author's sort order?
It seems to be ordered by ID. Can it be sorted by display_name?
Bob
----- Original Message -----
From: "Alexander Concha" <alex at buayacorp.com>
To: <wp-hackers at lists.automattic.com>
Sent: Wednesday, November 21, 2007 8:14 PM
Subject: Re: [wp-hackers] wp_list_authors and DB queries
> Bob escribió:
>> I wrote my own version of the widget/plugin. I hardcoded an array with
>> the
>> author IDs to display, then called get_userdata() and get_usernumposts()
>> in
>> a foreach loop. That cut the number of queries to 44, still 21 higher
>> than
>> normal, and the time to 0.020 seconds more than normal.
>>
>> That's an improvement over the generic plugin, but I was hoping for
>> better.
>> I'd appreciate it if anyone has any more suggestions.
>
> Look at the changes I made [1], it only uses one query (two if
> "show_fullname" is enabled) to do the same thing, but probably the
> plugin will fail (if database schema changes) in future versions of WP.
>
> [1] http://wordpress.pastebin.com/m6d2e537
>
> Regards
> --
> Alexander Concha
> http://www.buayacorp.com/
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>
More information about the wp-hackers
mailing list