Changeset 5211
- Timestamp:
- 10/06/2011 02:41:17 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-members/bp-members-adminbar.php
r4961 r5211 16 16 * 17 17 * @since BuddyPress (r4151) 18 * @todo Deprecate WP 3.2 admin bar compatibility when we drop 3.2 support 18 19 */ 19 20 function bp_members_admin_bar_my_account_menu() { 20 global $bp, $wp_admin_bar ;21 global $bp, $wp_admin_bar, $wp_version; 21 22 22 23 // Bail if this is an ajax request … … 35 36 ) ); 36 37 37 // Unique ID for the 'My Account' menu 38 $bp->my_account_menu_id = ( ! empty( $avatar ) ) ? 'my-account-with-avatar' : 'my-account'; 38 // Some admin bar setup in WP 3.2 differs from WP 3.3+. 39 // Backward-compatibility will be deprecated at some point. 40 if ( version_compare( (float)$wp_version, '3.3', '>=' ) ) { 41 // Stored in the global so we can add menus easily later on 42 $bp->my_account_menu_id = 'my-account'; 43 44 $title = bp_get_loggedin_user_fullname() . $avatar; 45 46 $class = 'opposite'; 47 if ( !empty( $avatar ) ) 48 $class .= ' with-avatar'; 49 50 $meta = array( 51 'class' => $class 52 ); 53 } else { 54 $bp->my_account_menu_id = ( ! empty( $avatar ) ) ? 'my-account-with-avatar' : 'my-account'; 55 $title = $avatar . bp_get_loggedin_user_fullname(); 56 $meta = array(); 57 } 39 58 40 59 // Create the main 'My Account' menu 41 60 $wp_admin_bar->add_menu( array( 42 61 'id' => $bp->my_account_menu_id, 43 'title' => $avatar . bp_get_loggedin_user_fullname(), 44 'href' => $bp->loggedin_user->domain 62 'title' => $title, 63 'href' => $bp->loggedin_user->domain, 64 'meta' => $meta 45 65 ) ); 46 66
Note: See TracChangeset
for help on using the changeset viewer.