Advertisement
Guest User

From @signed_up — To @DavidM

a guest
Dec 10th, 2013
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.93 KB | None | 0 0
  1. <?php
  2. function add_settings_subnav_tab() {
  3.     global $bp;
  4.     // remove profile menu tab
  5.     unset($bp->bp_nav['profile']);
  6.     // add 'Change profile picture' sub-menu tab
  7.     bp_core_new_subnav_item( array(
  8.         'name' => 'Change Profile Picture',
  9.         'slug' => 'change-profile-picture',
  10.         'parent_url' => $bp->loggedin_user->domain . $bp->bp_nav['settings']['slug'] . '/',
  11.         'parent_slug' => $bp->bp_nav['settings']['slug'],
  12.         'screen_function' => 'change_profile_picture',
  13.         'position' => 30
  14.         )
  15.     );
  16. }
  17.  
  18. function change_profile_picture(){
  19.     add_action( 'bp_template_content', 'change_profile_picture_screen_content' );
  20.     bp_core_load_template( apply_filters( 'xprofile_template_change_avatar', 'members/single/plugins' ) );
  21.     xprofile_screen_change_avatar();
  22. }
  23.  
  24. function change_profile_picture_screen_content() {
  25.     bp_get_template_part( 'members/single/profile/change-avatar' );
  26. }
  27.  
  28. add_action( 'bp_setup_nav', 'add_settings_subnav_tab', 100 );
  29. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement