[wp-hackers] Get authors for post category
SoJ Web
sojweb at indiana.edu
Thu Nov 5 19:35:38 UTC 2009
That's what I was afraid of :-). Thanks.
-Jeff
On Nov 5, 2009, at 10:16 AM, scribu wrote:
> There is no "easy" way:
>
> $post_ids = implode(',', get_objects_in_term($term_id, 'category'));
>
> $authors = $wpdb->get_results("
> SELECT DISTINCT *
> FROM $wpdb->users u
> JOIN $wpdb->posts p ON (p.author_id = u.ID)
> WHERE p.ID IN ('$post_ids')
> ");
>
>
> --
> http://scribu.net
> _______________________________________________
> 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