Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function custom_setup_nav() {
- global $bp;
- bp_core_new_nav_item( array(
- 'name' => __( 'About', 'buddypress' ),
- 'slug' => 'about',
- 'position' => 30,
- 'show_for_displayed_user' => true,
- 'screen_function' => 'about_page',
- 'css_id' => 'about'
- ) );
- bp_core_new_nav_item( array(
- 'name' => __( 'Challenges', 'buddypress' ),
- 'slug' => 'challenges',
- 'position' => 50,
- 'screen_function' => 'challenges_page'
- ) );
- bp_core_new_nav_item( array(
- 'name' => __( 'Contests', 'buddypress' ),
- 'slug' => 'contests',
- 'position' => 60,
- 'screen_function' => 'contests_page'
- ) );
- bp_core_new_nav_item( array(
- 'name' => __( 'Photos', 'buddypress' ),
- 'slug' => 'photos',
- 'position' => 70,
- 'screen_function' => 'photos_page'
- ) );
- bp_core_new_nav_item( array(
- 'name' => __( 'Videos', 'buddypress' ),
- 'slug' => 'videos',
- 'position' => 80,
- 'screen_function' => 'videos_page'
- ) );
- // Change the order of menu items
- $bp->bp_nav['friends']['position'] = 40;
- $bp->bp_nav['groups']['position'] = 90;
- $bp->bp_nav['forums']['position'] = 100;
- $bp->bp_nav['messages']['position'] = 110;
- // Remove a menu item
- $bp->bp_nav['notifications'] = false;
- $bp->bp_nav['settings'] = false;
- // Change name of menu item
- $bp->bp_nav['activity']['name'] = 'Home';
- }
- add_action( 'bp_setup_nav', 'custom_setup_nav' );
- function about_page() {
- add_action( 'bp_template_title', 'about_page_show_screen_title' );
- add_action( 'bp_template_content', 'about_page_show_screen_content' );
- bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) );
- }
- function about_page_show_screen_title() {
- echo 'About Page';
- }
- function about_page_show_screen_content() {
- echo 'the content of the page';
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement