Guest User

Untitled

a guest
Mar 5th, 2015
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.90 KB | None | 0 0
  1. <?php
  2.  
  3. function profile_subnav_tab() {
  4.     bp_core_new_subnav_item( array(
  5.         'name' => __( 'Competencias' ),
  6.         'slug' => 'competencias',
  7.         'parent_url' => trailingslashit( bp_loggedin_user_domain() . 'profile' ),
  8.         'parent_slug' => 'profile',
  9.         'screen_function' => 'profile_subnav_tab_screen',
  10.         'position' => 0
  11.     ));
  12.     bp_core_remove_subnav_item('profile', 'public');
  13.     bp_core_new_subnav_item( array(
  14.         'name' => __( 'View' ),
  15.         'slug' => 'view',
  16.         'parent_url' => trailingslashit( bp_loggedin_user_domain() . 'profile' ),
  17.         'parent_slug' => 'profile',
  18.         'screen_function' => 'profile_subnav_tab_screen_view',
  19.         'position' => 10,
  20.     ) );
  21. }
  22. add_action( 'bp_setup_nav', 'profile_subnav_tab', 15 );
  23.  
  24. function profile_subnav_tab_screen_view() {
  25.     add_action( 'bp_template_content', 'profile_subnav_tab_screen_view_content' );
  26.     bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/profile' ) );
  27. }
  28.  
  29. function profile_subnav_tab_screen_view_content() {
  30.     bp_get_template_part( 'members/single/profile/profile-loop' );
  31. }
  32.  
  33. function profile_subnav_tab_screen() {
  34.     add_action( 'bp_template_title', 'profile_subnav_tab_screen_title' );
  35.     add_action( 'bp_template_content', 'profile_subnav_tab_screen_content' );
  36.     bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) );
  37. }
  38.  
  39. function profile_subnav_tab_screen_title() {
  40.     echo '<div class="hr-title hr-full hr-double"><abbr>Competencias</abbr></div><div class="gap-10"></div>';
  41. }
  42.  
  43. function profile_subnav_tab_screen_content() {
  44.     echo '<p>content</p>';
  45. }
  46.  
  47. function profile_subnav_default() {
  48.     $args = array(
  49.         'parent_slug' => 'profile',
  50.         'screen_function' => 'profile_subnav_tab_screen',
  51.         'subnav_slug' => 'competencias'
  52.     );
  53.     bp_core_new_nav_default($args);
  54. }
  55. add_action('bp_setup_nav', 'profile_subnav_default', 5);
Advertisement
Add Comment
Please, Sign In to add comment