Skip to content

Instantly share code, notes, and snippets.

@javierarques
Last active December 19, 2015 12:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save javierarques/5956890 to your computer and use it in GitHub Desktop.
Save javierarques/5956890 to your computer and use it in GitHub Desktop.
Pagination on Buddypress Components. Buddypress pagination. Buddypress rewrite rules
function bp_component_screen_controller() {
global $bp;
//Are we in the current type
if ( $bp->current_component == BP_YOUR_COMPONENT_SLUG ) {
// The directory.
if ( (empty( $bp->current_action ) || ($bp->current_action == 'page')) &&
(empty( $bp->action_variables ) || is_numeric($bp->action_variables[0]))) {
// LOAD TEMPLATE
// add_action( 'bp_template_content', 'your_component_content' );
// add_action( 'bp_template_title', 'your_component_title');
// bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) );
}
}
}
add_action( 'wp', 'bp_component_screen_controller' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment