21 June 2014
Hieroglpyh is a space for writers, scientists, artists and engineers to collaborate on creative, ambitious visions of our near future.
Only load BuddyPress-specific content on the
'bp-include' hook, to ensure that BP has been loaded.
Pick a unique class name to extend the abstract
__construct() method, call
parent::start() with the
name of your component.
setup_globals()to, er, set up globals
The 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.phptemplate to hold your content
BuddyPress 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)