Skip to:
Content

BuddyPress.org

Changeset 5212


Ignore:
Timestamp:
10/06/2011 02:57:05 PM (13 years ago)
Author:
boonebgorges
Message:

WP 3.3-specific unhooking of core admin bar menus. See #3596

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-adminbar.php

    r4976 r5212  
    2626function bp_admin_bar_remove_wp_menus() {
    2727
     28    /**
     29     * WP 3.2 hooks
     30     */
    2831    remove_action( 'admin_bar_menu', 'wp_admin_bar_my_account_menu', 10 );
    2932    remove_action( 'admin_bar_menu', 'wp_admin_bar_my_sites_menu', 20 );
    3033    remove_action( 'admin_bar_menu', 'wp_admin_bar_dashboard_view_site_menu', 25 );
     34    remove_action( 'admin_bar_menu', 'wp_admin_bar_shortlink_menu', 80 );
    3135
    3236    // Don't show the 'Edit Page' menu on BP pages
     
    3438        remove_action( 'admin_bar_menu', 'wp_admin_bar_edit_menu', 30 );
    3539
    36     remove_action( 'admin_bar_menu', 'wp_admin_bar_shortlink_menu', 80 );
    37     remove_action( 'admin_bar_menu', 'wp_admin_bar_updates_menu', 70 );
    38 
    3940    if ( !is_network_admin() && !is_user_admin() ) {
    4041        remove_action( 'admin_bar_menu', 'wp_admin_bar_comments_menu', 50 );
    4142        remove_action( 'admin_bar_menu', 'wp_admin_bar_appearance_menu', 60 );
    42     }
    43 
    44     remove_action( 'admin_bar_menu', 'wp_admin_bar_updates_menu', 70 );
     43        remove_action( 'admin_bar_menu', 'wp_admin_bar_updates_menu', 70 );
     44    }
     45
     46    /**
     47     * WP 3.3+
     48     */
     49    remove_action( 'admin_bar_menu', 'wp_admin_bar_blog_front_menu', 30 );
     50    remove_action( 'admin_bar_menu', 'wp_admin_bar_shortlink_menu', 80 );
     51
     52    // Menus specific to blog posts shouldn't show on BP pages
     53    if ( !bp_is_blog_page() && !is_network_admin() && !is_admin() ) {
     54        remove_action( 'admin_bar_menu', 'wp_admin_bar_edit_menu', 50 );
     55        remove_action( 'admin_bar_menu', 'wp_admin_bar_comments_menu', 60 );
     56    }
     57
     58    // Don't show the Updates menu on the front end
     59    if ( !is_network_admin() && !is_admin() ) {
     60        remove_action( 'admin_bar_menu', 'wp_admin_bar_updates_menu', 40 );
     61    }
    4562}
    4663add_action( 'bp_init', 'bp_admin_bar_remove_wp_menus', 2 );
Note: See TracChangeset for help on using the changeset viewer.