Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Apr 18th, 2014  |  syntax: None  |  size: 2.09 KB  |  views: 47  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2. function custom_setup_nav() {
  3.       global $bp;
  4.  
  5.           bp_core_new_nav_item( array(
  6.             'name' => __( 'About', 'buddypress' ),
  7.             'slug' => 'about',
  8.             'position' => 30,
  9.                     'show_for_displayed_user' => true,
  10.             'screen_function' => 'about_page',
  11.                     'css_id' => 'about'
  12.       ) );
  13.  
  14.           bp_core_new_nav_item( array(
  15.             'name' => __( 'Challenges', 'buddypress' ),
  16.             'slug' => 'challenges',
  17.             'position' => 50,
  18.             'screen_function' => 'challenges_page'
  19.       ) );
  20.  
  21.           bp_core_new_nav_item( array(
  22.             'name' => __( 'Contests', 'buddypress' ),
  23.             'slug' => 'contests',
  24.             'position' => 60,
  25.             'screen_function' => 'contests_page'
  26.       ) );
  27.  
  28.           bp_core_new_nav_item( array(
  29.             'name' => __( 'Photos', 'buddypress' ),
  30.             'slug' => 'photos',
  31.             'position' => 70,
  32.             'screen_function' => 'photos_page'
  33.       ) );
  34.  
  35.           bp_core_new_nav_item( array(
  36.             'name' => __( 'Videos', 'buddypress' ),
  37.             'slug' => 'videos',
  38.             'position' => 80,
  39.             'screen_function' => 'videos_page'
  40.       ) );
  41.  
  42.       // Change the order of menu items
  43.       $bp->bp_nav['friends']['position'] = 40;
  44.           $bp->bp_nav['groups']['position'] = 90;
  45.           $bp->bp_nav['forums']['position'] = 100;
  46.           $bp->bp_nav['messages']['position'] = 110;
  47.          
  48.           // Remove a menu item
  49.       $bp->bp_nav['notifications'] = false;
  50.           $bp->bp_nav['settings'] = false;
  51.  
  52.           // Change name of menu item
  53.       $bp->bp_nav['activity']['name'] = 'Home';
  54. }
  55.  
  56. add_action( 'bp_setup_nav', 'custom_setup_nav' );
  57.  
  58. function about_page() {
  59.    add_action( 'bp_template_title', 'about_page_show_screen_title' );
  60.    add_action( 'bp_template_content', 'about_page_show_screen_content' );
  61.    bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) );
  62. }
  63.  
  64. function about_page_show_screen_title() {
  65.     echo 'About Page';
  66. }
  67.  
  68. function about_page_show_screen_content() {
  69.    echo 'the content of the page';
  70. }
  71. ?>
clone this paste RAW Paste Data