[wp-hackers] Dynamic User Pages - How Does BuddyPress do it?

Nikola Nikolov nikolov.tmw at gmail.com
Wed Oct 9 20:04:55 UTC 2013


Well depends on what you want to list about your users.

Is the user data stored as user meta? If so, you can simply do

echo get_user_meta( $_member->ID, 'meta_key1', true ):

You can also try accessing that directly from the $_member object:

echo $_member->meta_key1;

As far as I remember WP_User was using the magical __get() method, which
dynamically loads any un-existing properties of the object.


On Wed, Oct 9, 2013 at 10:52 PM, BenderisGreat <greglancaster71 at gmail.com>wrote:

> Excellent!  That fixed it.   Now for each user I have a dynamic page load,
> but how can I populate that page with each users stored data?  I was
> previously using custom post types, so the data was easy to grab, just get
> the author id of the post and populate the pate with that usermeta.
>
> Since it is now dynamic, I am unsure how I would go about populating the
> page.  I think Iwould need to create a custom query variable when the
> username is grabbed, and then I can use the get_query_var.
>
> Is that right?
>
>
>
> --
> View this message in context:
> http://wordpress-hackers.1065353.n5.nabble.com/Dynamic-User-Pages-How-Does-BuddyPress-do-it-tp42492p42495.html
> Sent from the Wordpress Hackers mailing list archive at Nabble.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