Skip to:
Content

BuddyPress.org

Changeset 5678


Ignore:
Timestamp:
02/07/2012 02:16:37 AM (13 years ago)
Author:
johnjamesjacoby
Message:

Fix toolbar if running 1.5 branch on WordPress 3.3/3.4. See #3983 (1.5 branch)

Location:
branches/1.5
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/1.5/bp-core/bp-core-adminbar.php

    r5628 r5678  
    6666 * Add a menu for the root site of this BuddyPress network
    6767 *
    68  * @global type $bp
    6968 * @global type $wp_admin_bar
    7069 * @return If in ajax
    7170 */
    7271function bp_admin_bar_root_site() {
    73     global $bp, $wp_admin_bar;
     72    global $wp_admin_bar;
    7473
    7574    // Create the root blog menu
     
    113112 */
    114113function bp_admin_bar_my_sites_menu() {
    115     global $wpdb, $wp_admin_bar;
     114    global $wp_admin_bar;
    116115
    117116    /* Add the 'My Sites' menu if the user has more than one site. */
     
    217216
    218217    $update_title = array( );
    219     if ( $wordpress_update_count )
     218    if ( !empty( $wordpress_update_count ) )
    220219        $update_title[] = sprintf( __( '%d WordPress Update' ), $wordpress_update_count );
    221220    if ( $plugin_update_count )
     
    237236 */
    238237function bp_core_load_admin_bar_css() {
    239     global $wp_version;
    240238
    241239    if ( !bp_use_wp_admin_bar() )
  • branches/1.5/bp-core/bp-core-wpabstraction.php

    r5481 r5678  
    2323    global $wp_version;
    2424   
    25     return substr( $wp_version, 0, ( strpos( $wp_version, '.' ) + 2 ) );
     25    return (float) $wp_version;
    2626}
    2727
  • branches/1.5/bp-groups/bp-groups-adminbar.php

    r5483 r5678  
    1818 */
    1919function bp_groups_admin_bar_version_check() {
    20     if ( '3.2' == bp_get_major_wp_version() ) {
    21         add_action( 'bp_setup_admin_bar', 'bp_groups_group_admin_menu', 99 );
    22     } elseif ( '3.3' == bp_get_major_wp_version() ) {
    23         remove_action( 'admin_bar_menu', 'wp_admin_bar_edit_menu',  80  );
    24         add_action( 'admin_bar_menu', 'bp_groups_group_admin_menu', 400 );
     20    switch( bp_get_major_wp_version() ) {
     21        case 3.2 :
     22            add_action( 'bp_setup_admin_bar', 'bp_groups_group_admin_menu', 99 );
     23            break;
     24        case 3.3 :
     25        case 3.4 :
     26        default  :
     27            remove_action( 'admin_bar_menu', 'wp_admin_bar_edit_menu',  80  );
     28            add_action( 'admin_bar_menu', 'bp_groups_group_admin_menu', 400 );
     29            break;     
    2530    }
    2631}
  • branches/1.5/bp-members/bp-members-adminbar.php

    r5483 r5678  
    1818 */
    1919function bp_members_admin_bar_version_check() {
    20    
    21     if ( '3.2' == bp_get_major_wp_version() ) {
    22         add_action( 'bp_setup_admin_bar', 'bp_members_admin_bar_my_account_menu',    4    );
    23         add_action( 'bp_setup_admin_bar', 'bp_members_admin_bar_notifications_menu', 5    );
    24         add_action( 'bp_setup_admin_bar', 'bp_members_admin_bar_user_admin_menu',    99   );
    25         add_action( 'bp_setup_admin_bar', 'bp_members_admin_bar_my_account_logout',  9999 );
    26     } elseif ( '3.3' == bp_get_major_wp_version() ) {
    27         add_action( 'bp_setup_admin_bar', 'bp_members_admin_bar_my_account_menu',    4   );
    28         add_action( 'bp_setup_admin_bar', 'bp_members_admin_bar_notifications_menu', 5   );
    29         add_action( 'admin_bar_menu',     'bp_members_admin_bar_user_admin_menu',    400 );
     20    switch( bp_get_major_wp_version() ) {
     21        case 3.2 :
     22            add_action( 'bp_setup_admin_bar', 'bp_members_admin_bar_my_account_menu',    4    );
     23            add_action( 'bp_setup_admin_bar', 'bp_members_admin_bar_notifications_menu', 5    );
     24            add_action( 'bp_setup_admin_bar', 'bp_members_admin_bar_user_admin_menu',    99   );
     25            add_action( 'bp_setup_admin_bar', 'bp_members_admin_bar_my_account_logout',  9999 );
     26            break;
     27        case 3.3 :
     28        case 3.4 :
     29        default  :
     30            add_action( 'bp_setup_admin_bar', 'bp_members_admin_bar_my_account_menu',    4   );
     31            add_action( 'bp_setup_admin_bar', 'bp_members_admin_bar_notifications_menu', 5   );
     32            add_action( 'admin_bar_menu',     'bp_members_admin_bar_user_admin_menu',    400 );
     33            break;     
    3034    }
    3135}
     
    3842 */
    3943function bp_members_admin_bar_my_account_menu() {
    40     global $bp, $wp_admin_bar, $wp_version;
     44    global $bp, $wp_admin_bar;
    4145
    4246    // Bail if this is an ajax request
Note: See TracChangeset for help on using the changeset viewer.