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

Nikola Nikolov nikolov.tmw at gmail.com
Wed Oct 9 20:33:09 UTC 2013

What I would probably do is to add a drop-down in your plugin's interface,
asking the user to pick a page that would be used as a profile page.

You can then modify the query in the 'parse_request' action(you will be
passed the $wp object and not $wp_query - keep that in mind) and tell
WordPress to load the page with ID of whatever page the admin has chosen to
be profile page. This way WordPress will still load a normal page
template(and not the 404 template) and you will be able to use the
'the_content' filter to put whatever you want there :)

It's a bit late here, but if you can't figure it out or there's no one else
to guide you along, I'll be able to provide you with a sample code tomorrow
at some point.


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

> Right again, I dont know how I missed that.  Now I am faced with one last
> problem - using a template was a bad idea because does not load the header
> and footer properly on all themes.  Is there a way to insert this into the
> content of the page rather than load the template?
> I previously used
> function add_profile( $content ) {
>         if( is_page('')) include_once('member.php');
>         else { echo get_the_content(); }
> }
> add_filter('the_content','add_profile');
> but dont think I can really implement that into the current code.  But this
> worked great because rather than load a whole custom template, it injects
> whatever is inside the member.php inside the_content().  Anyway to repeat
> that with this dynamic profile?
> --
> View this message in context:
> http://wordpress-hackers.1065353.n5.nabble.com/Dynamic-User-Pages-How-Does-BuddyPress-do-it-tp42492p42497.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