<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[BuddyPress][5483] branches/1.5: First pass at WordPress 3.3 admin bar compat for 1.5 branch:</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg > ul, #logmsg > ol { margin-left: 0; margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://buddypress.trac.wordpress.org/changeset/5483">5483</a></dd>
<dt>Author</dt> <dd>johnjamesjacoby</dd>
<dt>Date</dt> <dd>2011-12-10 18:16:23 +0000 (Sat, 10 Dec 2011)</dd>
</dl>
<h3>Log Message</h3>
<pre>First pass at WordPress 3.3 admin bar compat for 1.5 branch:
* Introduce version check functions for groups, members, and core components
* Add version checks in the above top level menus to tweak formatting for 3.2/3.3
* See 3828</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#branches15bpcorebpcoreadminbarphp">branches/1.5/bp-core/bp-core-adminbar.php</a></li>
<li><a href="#branches15bpgroupsbpgroupsadminbarphp">branches/1.5/bp-groups/bp-groups-adminbar.php</a></li>
<li><a href="#branches15bpmembersbpmembersadminbarphp">branches/1.5/bp-members/bp-members-adminbar.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="branches15bpcorebpcoreadminbarphp"></a>
<div class="modfile"><h4>Modified: branches/1.5/bp-core/bp-core-adminbar.php (5482 => 5483)</h4>
<pre class="diff"><span>
<span class="info">--- branches/1.5/bp-core/bp-core-adminbar.php        2011-12-10 17:47:24 UTC (rev 5482)
+++ branches/1.5/bp-core/bp-core-adminbar.php        2011-12-10 18:16:23 UTC (rev 5483)
</span><span class="lines">@@ -15,6 +15,21 @@
</span><span class="cx">         return;
</span><span class="cx">
</span><span class="cx"> /**
</span><ins>+ * Adjust the admin bar menus based on which WordPress version this is
+ *
+ * @since BuddyPress (1.5.2)
+ */
+function bp_core_admin_bar_version_check() {
+        if ( '3.2' == bp_get_major_wp_version() ) {
+                add_action( 'bp_setup_admin_bar', 'bp_admin_bar_root_site', 3 );
+                add_action( 'bp_setup_admin_bar', 'bp_admin_bar_comments_menu', 3 );
+                add_action( 'bp_setup_admin_bar', 'bp_admin_bar_appearance_menu', 3 );
+                add_action( 'bp_setup_admin_bar', 'bp_admin_bar_updates_menu', 3 );
+        }
+}
+add_action( 'admin_bar_menu', 'bp_core_admin_bar_version_check', 4 );
+
+/**
</ins><span class="cx"> * Unhook the WordPress core menus.
</span><span class="cx"> *
</span><span class="cx"> * @since BuddyPress (r4151)
</span><span class="lines">@@ -25,23 +40,25 @@
</span><span class="cx"> */
</span><span class="cx"> function bp_admin_bar_remove_wp_menus() {
</span><span class="cx">
</span><del>-        remove_action( 'admin_bar_menu', 'wp_admin_bar_my_account_menu', 10 );
-        remove_action( 'admin_bar_menu', 'wp_admin_bar_my_sites_menu', 20 );
-        remove_action( 'admin_bar_menu', 'wp_admin_bar_dashboard_view_site_menu', 25 );
</del><ins>+        if ( '3.2' == bp_get_major_wp_version() ) {
+                remove_action( 'admin_bar_menu', 'wp_admin_bar_my_account_menu', 10 );
+                remove_action( 'admin_bar_menu', 'wp_admin_bar_my_sites_menu', 20 );
+                remove_action( 'admin_bar_menu', 'wp_admin_bar_dashboard_view_site_menu', 25 );
</ins><span class="cx">
</span><del>-        // Don't show the 'Edit Page' menu on BP pages
-        if ( !bp_is_blog_page() )
-                remove_action( 'admin_bar_menu', 'wp_admin_bar_edit_menu', 30 );
</del><ins>+                // Don't show the 'Edit Page' menu on BP pages
+                if ( !bp_is_blog_page() )
+                        remove_action( 'admin_bar_menu', 'wp_admin_bar_edit_menu', 30 );
</ins><span class="cx">
</span><del>-        remove_action( 'admin_bar_menu', 'wp_admin_bar_shortlink_menu', 80 );
-        remove_action( 'admin_bar_menu', 'wp_admin_bar_updates_menu', 70 );
</del><ins>+                remove_action( 'admin_bar_menu', 'wp_admin_bar_shortlink_menu', 80 );
+                remove_action( 'admin_bar_menu', 'wp_admin_bar_updates_menu', 70 );
</ins><span class="cx">
</span><del>-        if ( !is_network_admin() && !is_user_admin() ) {
-                remove_action( 'admin_bar_menu', 'wp_admin_bar_comments_menu', 50 );
-                remove_action( 'admin_bar_menu', 'wp_admin_bar_appearance_menu', 60 );
</del><ins>+                if ( !is_network_admin() && !is_user_admin() ) {
+                        remove_action( 'admin_bar_menu', 'wp_admin_bar_comments_menu', 50 );
+                        remove_action( 'admin_bar_menu', 'wp_admin_bar_appearance_menu', 60 );
+                }
+
+                remove_action( 'admin_bar_menu', 'wp_admin_bar_updates_menu', 70 );
</ins><span class="cx">         }
</span><del>-
-        remove_action( 'admin_bar_menu', 'wp_admin_bar_updates_menu', 70 );
</del><span class="cx"> }
</span><span class="cx"> add_action( 'bp_init', 'bp_admin_bar_remove_wp_menus', 2 );
</span><span class="cx">
</span><span class="lines">@@ -90,7 +107,6 @@
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx"> }
</span><del>-add_action( 'bp_setup_admin_bar', 'bp_admin_bar_root_site', 3 );
</del><span class="cx">
</span><span class="cx"> /**
</span><span class="cx"> * Add the "My Sites/[Site Name]" menu and all submenus.
</span><span class="lines">@@ -124,7 +140,6 @@
</span><span class="cx">                 $wp_admin_bar->add_menu( array( 'parent' => 'blog-' . $blog->userblog_id, 'id' => 'blog-' . $blog->userblog_id . '-v', 'title' => __( 'Visit Site' ), 'href' => get_home_url( $blog->userblog_id ) ) );
</span><span class="cx">         }
</span><span class="cx"> }
</span><del>-add_action( 'bp_setup_admin_bar', 'bp_admin_bar_my_sites_menu', 3 );
</del><span class="cx">
</span><span class="cx"> /**
</span><span class="cx"> * Add edit comments link with awaiting moderation count bubble
</span><span class="lines">@@ -141,7 +156,6 @@
</span><span class="cx">         $awaiting_mod = $awaiting_mod ? "<span id='ab-awaiting-mod' class='pending-count'>" . number_format_i18n( $awaiting_mod ) . "</span>" : '';
</span><span class="cx">         $wp_admin_bar->add_menu( array( 'parent' => 'dashboard', 'id' => 'comments', 'title' => sprintf( __( 'Comments %s' ), $awaiting_mod ), 'href' => admin_url( 'edit-comments.php' ) ) );
</span><span class="cx"> }
</span><del>-add_action( 'bp_setup_admin_bar', 'bp_admin_bar_comments_menu', 3 );
</del><span class="cx">
</span><span class="cx"> /**
</span><span class="cx"> * Add "Appearance" menu with widget and nav menu submenu
</span><span class="lines">@@ -173,7 +187,6 @@
</span><span class="cx">         if ( current_theme_supports( 'custom-header' ) )
</span><span class="cx">                 $wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'header', 'title' => __( 'Header' ), 'href' => admin_url( 'themes.php?page=custom-header' ) ) );
</span><span class="cx"> }
</span><del>-add_action( 'bp_setup_admin_bar', 'bp_admin_bar_appearance_menu', 3 );
</del><span class="cx">
</span><span class="cx"> /**
</span><span class="cx"> * Provide an update link if theme/plugin/core updates are available
</span><span class="lines">@@ -218,7 +231,6 @@
</span><span class="cx">
</span><span class="cx">         $wp_admin_bar->add_menu( array( 'parent' => 'dashboard', 'id' => 'updates', 'title' => $update_title, 'href' => network_admin_url( 'update-core.php' ) ) );
</span><span class="cx"> }
</span><del>-add_action( 'bp_setup_admin_bar', 'bp_admin_bar_updates_menu', 3 );
</del><span class="cx">
</span><span class="cx"> /**
</span><span class="cx"> * Handle the Admin Bar CSS
</span><span class="lines">@@ -229,6 +241,9 @@
</span><span class="cx">         if ( !bp_use_wp_admin_bar() )
</span><span class="cx">                 return;
</span><span class="cx">
</span><ins>+        if ( '3.3' == bp_get_major_wp_version() )
+                return;
+
</ins><span class="cx">         // Admin bar styles
</span><span class="cx">         if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG )
</span><span class="cx">                 $stylesheet = BP_PLUGIN_URL . '/bp-core/css/admin-bar.dev.css';
</span><span class="lines">@@ -248,4 +263,5 @@
</span><span class="cx">         wp_enqueue_style( 'bp-admin-bar-rtl', apply_filters( 'bp_core_admin_bar_rtl_css', $stylesheet ), array( 'bp-admin-bar' ), '20110723' );
</span><span class="cx"> }
</span><span class="cx"> add_action( 'bp_init', 'bp_core_load_admin_bar_css' );
</span><del>-?>
</del><span class="cx">\ No newline at end of file
</span><ins>+
+?>
</ins></span></pre></div>
<a id="branches15bpgroupsbpgroupsadminbarphp"></a>
<div class="modfile"><h4>Modified: branches/1.5/bp-groups/bp-groups-adminbar.php (5482 => 5483)</h4>
<pre class="diff"><span>
<span class="info">--- branches/1.5/bp-groups/bp-groups-adminbar.php        2011-12-10 17:47:24 UTC (rev 5482)
+++ branches/1.5/bp-groups/bp-groups-adminbar.php        2011-12-10 18:16:23 UTC (rev 5483)
</span><span class="lines">@@ -12,6 +12,21 @@
</span><span class="cx"> if ( !defined( 'ABSPATH' ) ) exit;
</span><span class="cx">
</span><span class="cx"> /**
</span><ins>+ * Adjust the admin bar menus based on which WordPress version this is
+ *
+ * @since BuddyPress (1.5.2)
+ */
+function bp_groups_admin_bar_version_check() {
+        if ( '3.2' == bp_get_major_wp_version() ) {
+                add_action( 'bp_setup_admin_bar', 'bp_groups_group_admin_menu', 99 );
+        } elseif ( '3.3' == bp_get_major_wp_version() ) {
+                remove_action( 'admin_bar_menu', 'wp_admin_bar_edit_menu', 80 );
+                add_action( 'admin_bar_menu', 'bp_groups_group_admin_menu', 400 );
+        }
+}
+add_action( 'admin_bar_menu', 'bp_groups_admin_bar_version_check', 4 );
+
+/**
</ins><span class="cx"> * Adds the Group Admin top-level menu to group pages
</span><span class="cx"> *
</span><span class="cx"> * @package BuddyPress
</span><span class="lines">@@ -30,26 +45,41 @@
</span><span class="cx">         if ( !is_super_admin() && !bp_group_is_admin() )
</span><span class="cx">                 return false;
</span><span class="cx">
</span><del>-        // Group avatar
-        $avatar = bp_core_fetch_avatar( array(
-                'object' => 'group',
-                'type' => 'thumb',
-                'avatar_dir' => 'group-avatars',
-                'item_id' => $bp->groups->current_group->id,
-                'width' => 16,
-                'height' => 16
-        ) );
</del><ins>+        if ( '3.2' == bp_get_major_wp_version() ) {
</ins><span class="cx">
</span><del>-        // Unique ID for the 'My Account' menu
-        $bp->group_admin_menu_id = ( ! empty( $avatar ) ) ? 'group-admin-with-avatar' : 'group-admin';
</del><ins>+                // Group avatar
+                $avatar = bp_core_fetch_avatar( array(
+                        'object' => 'group',
+                        'type' => 'thumb',
+                        'avatar_dir' => 'group-avatars',
+                        'item_id' => $bp->groups->current_group->id,
+                        'width' => 16,
+                        'height' => 16
+                ) );
</ins><span class="cx">
</span><del>-        // Add the top-level Group Admin button
-        $wp_admin_bar->add_menu( array(
-                'id' => $bp->group_admin_menu_id,
-                'title' => $avatar . bp_get_current_group_name(),
-                'href' => bp_get_group_permalink( $bp->groups->current_group )
-        ) );
</del><ins>+                // Unique ID for the 'My Account' menu
+                $bp->group_admin_menu_id = ( ! empty( $avatar ) ) ? 'group-admin-with-avatar' : 'group-admin';
</ins><span class="cx">
</span><ins>+                // Add the top-level Group Admin button
+                $wp_admin_bar->add_menu( array(
+                        'id' => $bp->group_admin_menu_id,
+                        'title' => $avatar . bp_get_current_group_name(),
+                        'href' => bp_get_group_permalink( $bp->groups->current_group )
+                ) );
+
+        } elseif ( '3.3' == bp_get_major_wp_version() ) {
+                
+                // Unique ID for the 'My Account' menu
+                $bp->group_admin_menu_id = 'group-admin';
+
+                // Add the top-level Group Admin button
+                $wp_admin_bar->add_menu( array(
+                        'id' => $bp->group_admin_menu_id,
+                        'title' => __( 'Edit Group', 'buddypress' ),
+                        'href' => bp_get_group_permalink( $bp->groups->current_group )
+                ) );
+        }
+
</ins><span class="cx">         // Group Admin > Edit details
</span><span class="cx">         $wp_admin_bar->add_menu( array(
</span><span class="cx">                 'parent' => $bp->group_admin_menu_id,
</span><span class="lines">@@ -112,6 +142,5 @@
</span><span class="cx">                 'href' => bp_get_groups_action_link( 'admin/delete-group' )
</span><span class="cx">         ) );
</span><span class="cx"> }
</span><del>-add_action( 'bp_setup_admin_bar', 'bp_groups_group_admin_menu', 99 );
</del><span class="cx">
</span><span class="cx"> ?>
</span><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="branches15bpmembersbpmembersadminbarphp"></a>
<div class="modfile"><h4>Modified: branches/1.5/bp-members/bp-members-adminbar.php (5482 => 5483)</h4>
<pre class="diff"><span>
<span class="info">--- branches/1.5/bp-members/bp-members-adminbar.php        2011-12-10 17:47:24 UTC (rev 5482)
+++ branches/1.5/bp-members/bp-members-adminbar.php        2011-12-10 18:16:23 UTC (rev 5483)
</span><span class="lines">@@ -12,12 +12,32 @@
</span><span class="cx"> if ( !defined( 'ABSPATH' ) ) exit;
</span><span class="cx">
</span><span class="cx"> /**
</span><ins>+ * Adjust the admin bar menus based on which WordPress version this is
+ *
+ * @since BuddyPress (1.5.2)
+ */
+function bp_members_admin_bar_version_check() {
+        
+        if ( '3.2' == bp_get_major_wp_version() ) {
+                add_action( 'bp_setup_admin_bar', 'bp_members_admin_bar_my_account_menu', 4 );
+                add_action( 'bp_setup_admin_bar', 'bp_members_admin_bar_notifications_menu', 5 );
+                add_action( 'bp_setup_admin_bar', 'bp_members_admin_bar_user_admin_menu', 99 );
+                add_action( 'bp_setup_admin_bar', 'bp_members_admin_bar_my_account_logout', 9999 );
+        } elseif ( '3.3' == bp_get_major_wp_version() ) {
+                add_action( 'bp_setup_admin_bar', 'bp_members_admin_bar_my_account_menu', 4 );
+                add_action( 'bp_setup_admin_bar', 'bp_members_admin_bar_notifications_menu', 5 );
+                add_action( 'admin_bar_menu', 'bp_members_admin_bar_user_admin_menu', 400 );
+        }
+}
+add_action( 'admin_bar_menu', 'bp_members_admin_bar_version_check', 4 );
+
+/**
</ins><span class="cx"> * Add the "My Account" menu and all submenus.
</span><span class="cx"> *
</span><span class="cx"> * @since BuddyPress (r4151)
</span><span class="cx"> */
</span><span class="cx"> function bp_members_admin_bar_my_account_menu() {
</span><del>-        global $bp, $wp_admin_bar;
</del><ins>+        global $bp, $wp_admin_bar, $wp_version;
</ins><span class="cx">
</span><span class="cx">         // Bail if this is an ajax request
</span><span class="cx">         if ( defined( 'DOING_AJAX' ) )
</span><span class="lines">@@ -26,24 +46,41 @@
</span><span class="cx">         // Logged in user
</span><span class="cx">         if ( is_user_logged_in() ) {
</span><span class="cx">
</span><del>-                // User avatar
-                $avatar = bp_core_fetch_avatar( array(
-                        'item_id' => $bp->loggedin_user->id,
-                        'email' => $bp->loggedin_user->userdata->user_email,
-                        'width' => 16,
-                        'height' => 16
-                ) );
</del><ins>+                if ( '3.2' == bp_get_major_wp_version() ) {
</ins><span class="cx">
</span><del>-                // Unique ID for the 'My Account' menu
-                $bp->my_account_menu_id = ( ! empty( $avatar ) ) ? 'my-account-with-avatar' : 'my-account';
</del><ins>+                        // User avatar
+                        $avatar = bp_core_fetch_avatar( array(
+                                'item_id' => $bp->loggedin_user->id,
+                                'email' => $bp->loggedin_user->userdata->user_email,
+                                'width' => 16,
+                                'height' => 16
+                        ) );
</ins><span class="cx">
</span><del>-                // Create the main 'My Account' menu
-                $wp_admin_bar->add_menu( array(
-                        'id' => $bp->my_account_menu_id,
-                        'title' => $avatar . bp_get_loggedin_user_fullname(),
-                        'href' => $bp->loggedin_user->domain
-                ) );
</del><ins>+                        // Unique ID for the 'My Account' menu
+                        $bp->my_account_menu_id = ( ! empty( $avatar ) ) ? 'my-account-with-avatar' : 'my-account';
</ins><span class="cx">
</span><ins>+                        // Create the main 'My Account' menu
+                        $wp_admin_bar->add_menu( array(
+                                'id' => $bp->my_account_menu_id,
+                                'title' => $avatar . bp_get_loggedin_user_fullname(),
+                                'href' => $bp->loggedin_user->domain
+                        ) );
+
+                } else {
+
+                        // Unique ID for the 'My Account' menu
+                        $bp->my_account_menu_id = 'my-account-buddypress';
+
+                        // Create the main 'My Account' menu
+                        $wp_admin_bar->add_menu( array(
+                                'parent' => 'my-account',
+                                'id' => $bp->my_account_menu_id,
+                                'href' => $bp->loggedin_user->domain,
+                                'group' => true,
+                                'meta' => array( 'class' => 'ab-sub-secondary' )
+                        ) );
+                }
+
</ins><span class="cx">         // Show login and sign-up links
</span><span class="cx">         } elseif ( !empty( $wp_admin_bar ) ) {
</span><span class="cx">
</span><span class="lines">@@ -66,7 +103,6 @@
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx"> }
</span><del>-add_action( 'bp_setup_admin_bar', 'bp_members_admin_bar_my_account_menu', 4 );
</del><span class="cx">
</span><span class="cx"> /**
</span><span class="cx"> * Adds the User Admin top-level menu to user pages
</span><span class="lines">@@ -85,24 +121,39 @@
</span><span class="cx">         if ( !current_user_can( 'edit_users' ) || bp_is_my_profile() )
</span><span class="cx">                 return false;
</span><span class="cx">
</span><del>-        // User avatar
-        $avatar = bp_core_fetch_avatar( array(
-                'item_id' => $bp->displayed_user->id,
-                'email' => $bp->displayed_user->userdata->user_email,
-                'width' => 16,
-                'height' => 16
-        ) );
</del><ins>+        if ( '3.2' == bp_get_major_wp_version() ) {
</ins><span class="cx">
</span><del>-        // Unique ID for the 'My Account' menu
-        $bp->user_admin_menu_id = ( ! empty( $avatar ) ) ? 'user-admin-with-avatar' : 'user-admin';
</del><ins>+                // User avatar
+                $avatar = bp_core_fetch_avatar( array(
+                        'item_id' => $bp->displayed_user->id,
+                        'email' => $bp->displayed_user->userdata->user_email,
+                        'width' => 16,
+                        'height' => 16
+                ) );
</ins><span class="cx">
</span><del>-        // Add the top-level User Admin button
-        $wp_admin_bar->add_menu( array(
-                'id' => $bp->user_admin_menu_id,
-                'title' => $avatar . bp_get_displayed_user_fullname(),
-                'href' => bp_displayed_user_domain()
-        ) );
</del><ins>+                // Unique ID for the 'My Account' menu
+                $bp->user_admin_menu_id = ( ! empty( $avatar ) ) ? 'user-admin-with-avatar' : 'user-admin';
</ins><span class="cx">
</span><ins>+                // Add the top-level User Admin button
+                $wp_admin_bar->add_menu( array(
+                        'id' => $bp->user_admin_menu_id,
+                        'title' => $avatar . bp_get_displayed_user_fullname(),
+                        'href' => bp_displayed_user_domain()
+                ) );
+
+        } elseif ( '3.3' == bp_get_major_wp_version() ) {
+                
+                // Unique ID for the 'My Account' menu
+                $bp->user_admin_menu_id = 'user-admin';
+
+                // Add the top-level User Admin button
+                $wp_admin_bar->add_menu( array(
+                        'id' => $bp->user_admin_menu_id,
+                        'title' => __( 'Edit Member', 'buddypress' ),
+                        'href' => bp_displayed_user_domain()
+                ) );
+        }
+
</ins><span class="cx">         // User Admin > Edit this user's profile
</span><span class="cx">         $wp_admin_bar->add_menu( array(
</span><span class="cx">                 'parent' => $bp->user_admin_menu_id,
</span><span class="lines">@@ -147,7 +198,6 @@
</span><span class="cx">                 'meta' => array( 'onclick' => 'confirm(" ' . __( "Are you sure you want to delete this user's account?", 'buddypress' ) . '");' )
</span><span class="cx">         ) );
</span><span class="cx"> }
</span><del>-add_action( 'bp_setup_admin_bar', 'bp_members_admin_bar_user_admin_menu', 99 );
</del><span class="cx">
</span><span class="cx"> /**
</span><span class="cx"> * Build the "Notifications" dropdown
</span><span class="lines">@@ -167,13 +217,26 @@
</span><span class="cx">                 $menu_title = __( 'Notifications', 'buddypress' );
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        // Add the top-level Notifications button
-        $wp_admin_bar->add_menu( array(
-                'id' => 'bp-notifications',
-                'title' => $menu_title,
-                'href' => bp_loggedin_user_domain()
-        ) );
</del><ins>+        if ( '3.2' == bp_get_major_wp_version() ) {
</ins><span class="cx">
</span><ins>+                // Add the top-level Notifications button
+                $wp_admin_bar->add_menu( array(
+                        'id' => 'bp-notifications',
+                        'title' => $menu_title,
+                        'href' => bp_loggedin_user_domain()
+                ) );
+
+        } elseif ( '3.3' == bp_get_major_wp_version() ) {
+                
+                // Add the top-level Notifications button
+                $wp_admin_bar->add_menu( array(
+                        'parent' => 'top-secondary',
+                        'id' => 'bp-notifications',
+                        'title' => $menu_title,
+                        'href' => bp_loggedin_user_domain()
+                ) );
+        }
+
</ins><span class="cx">         if ( !empty( $notifications ) ) {
</span><span class="cx">                 foreach ( (array)$notifications as $notification ) {
</span><span class="cx">                         $wp_admin_bar->add_menu( array(
</span><span class="lines">@@ -194,7 +257,6 @@
</span><span class="cx">
</span><span class="cx">         return;
</span><span class="cx"> }
</span><del>-add_action( 'bp_setup_admin_bar', 'bp_members_admin_bar_notifications_menu', 999 );
</del><span class="cx">
</span><span class="cx"> /**
</span><span class="cx"> * Make sure the logout link is at the bottom of the "My Account" menu
</span><span class="lines">@@ -221,6 +283,5 @@
</span><span class="cx">                 ) );
</span><span class="cx">         }
</span><span class="cx"> }
</span><del>-add_action( 'bp_setup_admin_bar', 'bp_members_admin_bar_my_account_logout', 9999 );
</del><span class="cx">
</span><span class="cx"> ?>
</span><span class="cx">\ No newline at end of file
</span></span></pre>
</div>
</div>
</body>
</html>