BP_Component
WPSessions
21 June 2014
Hieroglpyh is a space for writers, scientists, artists and engineers to collaborate on creative, ambitious visions of our near future.
BP_Group_Extension
BP_Component
BP_Component
BP_Component
Only load BuddyPress-specific content on the 'bp-include'
hook, to ensure that BP has been loaded.
BP_Component
Pick a unique class name to extend the abstract BP_Component
.
start()
me upIn your __construct()
method, call parent::start()
with the id
and name
of your component.
setup_globals()
to, er, set up globalsThe minimum information that setup_globals()
needs is your component's slug
, used to build URLs.
Set up a few config arrays, and setup_nav()
will integrate your component into BP's user nav.
plugins.php
template to hold your contentBuddyPress is flexible about how you load your component's content, but using plugins.php
, and hooking your markup-generating function to 'bp_template_content'
, is the best way to ensure compatibility across themes.
The best practice is to invoke your component at the 'bp_loaded'
hook - late enough to know that the rest of BP is loaded, but early enough that you'll be able to set up the page and any necessary redirects.
BP_Component
(see especially this file)BP_Component