Skip to content

Instantly share code, notes, and snippets.

@ChrisFlannagan
Created January 6, 2017 23:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChrisFlannagan/a5c071398e44ea4ee3d4752ed7840561 to your computer and use it in GitHub Desktop.
Save ChrisFlannagan/a5c071398e44ea4ee3d4752ed7840561 to your computer and use it in GitHub Desktop.
<?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