Advertisement
Guest User

from @signed_up

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