Advertisement
Guest User

Untitled

a guest
Apr 18th, 2014
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.09 KB | None | 0 0
  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. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement