[wp-hackers] Get authors for post category

scribu scribu at gmail.com
Thu Nov 5 15:16:58 UTC 2009


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


More information about the wp-hackers mailing list