0

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

2
  • How are you tracking "followed content"?
    – s_ha_dum
    Commented May 5, 2013 at 13:10
  • I have user metadata that contains folowed-users IDs, followed-tax IDs Commented May 6, 2013 at 7:09

2 Answers 2

1

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

0

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...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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