Advertisement
Guest User

BuddyPress profile navs

a guest
Apr 15th, 2012
442
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. <?php
  2. function my_test_setup_nav() {
  3. global $bp;
  4. //name, slug, screen, position, default subnav
  5. bp_core_new_nav_item( array( 'name' => __( 'test' ), 'slug' => 'test', 'screen_function' => 'my_profile_page_function_to_show_screen', 'position' => 40, 'default_subnav_slug' => 'test_sub' ) );
  6.  
  7. /* Add the subnav items to the profile */
  8. // name, slug, parent_url, parent slug, screen function
  9. bp_core_new_subnav_item( array( 'name' => __( 'Home' ), 'slug' => 'test_sub', 'parent_url' => $bp->loggedin_user->domain, 'parent_slug' => 'test', 'screen_function' => 'my_profile_page_function_to_show_screen' ) );
  10.  
  11. function my_profile_page_function_to_show_screen() {
  12.  
  13. //add title and content here - last is to call the members plugin.php template
  14. add_action( 'bp_template_title', 'my_profile_page_function_to_show_screen_title' );
  15. add_action( 'bp_template_content', 'my_profile_page_function_to_show_screen_content' );
  16. bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) );
  17. }
  18. function my_profile_page_function_to_show_screen_title() {
  19. echo 'something';
  20. }
  21. function my_profile_page_function_to_show_screen_content() {
  22.  
  23. echo 'weee content';
  24.  
  25. }
  26. }
  27. add_action( 'bp_setup_nav', 'my_test_setup_nav' );
  28.  
  29. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement