Changeset 10322 for trunk/src/bp-members/bp-members-adminbar.php
- Timestamp:
- 11/02/2015 01:58:52 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-members/bp-members-adminbar.php
r10190 r10322 17 17 * @since 1.6.0 18 18 * 19 * @todo Deprecate WP 3.2 Toolbar compatibility when we drop 3.2 support 19 * @todo Deprecate WP 3.2 Toolbar compatibility when we drop 3.2 support. 20 20 */ 21 21 function bp_members_admin_bar_my_account_menu() { 22 22 global $wp_admin_bar; 23 23 24 // Bail if this is an ajax request 24 // Bail if this is an ajax request. 25 25 if ( defined( 'DOING_AJAX' ) ) 26 26 return; 27 27 28 // Logged in user 28 // Logged in user. 29 29 if ( is_user_logged_in() ) { 30 30 31 31 $bp = buddypress(); 32 32 33 // Stored in the global so we can add menus easily later on 33 // Stored in the global so we can add menus easily later on. 34 34 $bp->my_account_menu_id = 'my-account-buddypress'; 35 35 36 // Create the main 'My Account' menu 36 // Create the main 'My Account' menu. 37 37 $wp_admin_bar->add_menu( array( 38 38 'id' => $bp->my_account_menu_id, … … 44 44 ) ) ); 45 45 46 // Show login and sign-up links 46 // Show login and sign-up links. 47 47 } elseif ( !empty( $wp_admin_bar ) ) { 48 48 49 49 add_filter ( 'show_admin_bar', '__return_true' ); 50 50 51 // Create the main 'My Account' menu 51 // Create the main 'My Account' menu. 52 52 $wp_admin_bar->add_menu( array( 53 53 'id' => 'bp-login', … … 56 56 ) ); 57 57 58 // Sign up 58 // Sign up. 59 59 if ( bp_get_signup_allowed() ) { 60 60 $wp_admin_bar->add_menu( array( … … 76 76 global $wp_admin_bar; 77 77 78 // Only show if viewing a user 78 // Only show if viewing a user. 79 79 if ( !bp_is_user() ) 80 80 return false; 81 81 82 // Don't show this menu to non site admins or if you're viewing your own profile 82 // Don't show this menu to non site admins or if you're viewing your own profile. 83 83 if ( !current_user_can( 'edit_users' ) || bp_is_my_profile() ) 84 84 return false; … … 86 86 $bp = buddypress(); 87 87 88 // Unique ID for the 'My Account' menu 88 // Unique ID for the 'My Account' menu. 89 89 $bp->user_admin_menu_id = 'user-admin'; 90 90 91 // Add the top-level User Admin button 91 // Add the top-level User Admin button. 92 92 $wp_admin_bar->add_menu( array( 93 93 'id' => $bp->user_admin_menu_id, … … 97 97 98 98 if ( bp_is_active( 'xprofile' ) ) { 99 // User Admin > Edit this user's profile 99 // User Admin > Edit this user's profile. 100 100 $wp_admin_bar->add_menu( array( 101 101 'parent' => $bp->user_admin_menu_id, … … 105 105 ) ); 106 106 107 // User Admin > Edit this user's avatar 107 // User Admin > Edit this user's avatar. 108 108 if ( buddypress()->avatar->show_avatars ) { 109 109 $wp_admin_bar->add_menu( array( … … 115 115 } 116 116 117 // User Admin > Edit this user's cover image 117 // User Admin > Edit this user's cover image. 118 118 if ( bp_displayed_user_use_cover_image_header() ) { 119 119 $wp_admin_bar->add_menu( array( … … 128 128 129 129 if ( bp_is_active( 'settings' ) ) { 130 // User Admin > Spam/unspam 130 // User Admin > Spam/unspam. 131 131 $wp_admin_bar->add_menu( array( 132 132 'parent' => $bp->user_admin_menu_id, … … 136 136 ) ); 137 137 138 // User Admin > Delete Account 138 // User Admin > Delete Account. 139 139 $wp_admin_bar->add_menu( array( 140 140 'parent' => $bp->user_admin_menu_id, … … 153 153 * 154 154 * @since 1.5.0 155 * 156 * @return bool 155 157 */ 156 158 function bp_members_admin_bar_notifications_menu() { 157 159 158 // Bail if notifications is not active 160 // Bail if notifications is not active. 159 161 if ( ! bp_is_active( 'notifications' ) ) { 160 162 return false;
Note: See TracChangeset
for help on using the changeset viewer.