Created
January 6, 2017 23:50
-
-
Save ChrisFlannagan/a5c071398e44ea4ee3d4752ed7840561 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class BP_SelectHome extends BP_Component { | |
function __construct() { | |
global $bp; | |
parent::start( | |
'bp-select-home', | |
__( 'Select Home', 'fp-stroke-community' ), | |
dirname( __FILE__ ) | |
); | |
/** | |
* BuddyPress-dependent plugins are loaded too late to depend on BP_Component's | |
* hooks, so we must call the function directly. | |
*/ | |
$bp->active_components[ $this->id ] = '1'; | |
var_dump( $bp->active_components ); | |
} | |
function setup_globals( $args = array() ) { | |
global $bp; | |
$globals = array( | |
'slug' => 'bp-select-home', | |
'root_slug' => 'bp-select-home', | |
'has_directory' => true, | |
); | |
parent::setup_globals( $globals ); | |
} | |
} | |
function bp_select_home_load_core_component() { | |
global $bp; | |
$bp->bp_select_home = new BP_SelectHome(); | |
} | |
add_action( 'bp_init', 'bp_select_home_load_core_component' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment