Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have a site that needs two different tabs: 1. all author written content (Posts, comments, CTP) 2. all author followed content (categories, taxonomies, other users content)

For the first all I could come up with was using unoion on wp_comments and wp_posts filtered by author sorted by date

Have no idea how to do the 2nd one...

Would love some advice

share|improve this question
    
How are you tracking "followed content"? –  s_ha_dum May 5 '13 at 13:10
    
I have user metadata that contains folowed-users IDs, followed-tax IDs –  hannit cohen May 6 '13 at 7:09
add comment

2 Answers

Your question is not very detailed or very clear but get_user_meta will return all of the user metadata for a user. That should have all of your fields.

You could also use get_users for the second tab. I am not dealing with the first since you state that your "have no idea how to do the 2nd one"

$args = array(
   'fields' => 'all_with_meta',
   'orderby' => 'nicename',
   'order' => 'ASC',
   'who' => 0, // all users greater than subscriber
   // 'include' => array(1,2,3), // particular users
   // 'role' => 'rolename'
);
$users = get_users($args);

You could also use WP_User_Query directly.

Reference

http://codex.wordpress.org/Function_Reference/get_users
http://codex.wordpress.org/Class_Reference/WP_User_Query

share|improve this answer
add comment
up vote 0 down vote accepted

Found out the solution for #1. using WP_Query I can specify multiple post_type and an author ID. which gives all author written data...

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.