Changeset 5483 for branches/1.5/bp-core/bp-core-adminbar.php
- Timestamp:
- 12/10/2011 06:16:23 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.5/bp-core/bp-core-adminbar.php
r4976 r5483 14 14 if ( !bp_use_wp_admin_bar() || defined( 'DOING_AJAX' ) ) 15 15 return; 16 17 /** 18 * Adjust the admin bar menus based on which WordPress version this is 19 * 20 * @since BuddyPress (1.5.2) 21 */ 22 function bp_core_admin_bar_version_check() { 23 if ( '3.2' == bp_get_major_wp_version() ) { 24 add_action( 'bp_setup_admin_bar', 'bp_admin_bar_root_site', 3 ); 25 add_action( 'bp_setup_admin_bar', 'bp_admin_bar_comments_menu', 3 ); 26 add_action( 'bp_setup_admin_bar', 'bp_admin_bar_appearance_menu', 3 ); 27 add_action( 'bp_setup_admin_bar', 'bp_admin_bar_updates_menu', 3 ); 28 } 29 } 30 add_action( 'admin_bar_menu', 'bp_core_admin_bar_version_check', 4 ); 16 31 17 32 /** … … 26 41 function bp_admin_bar_remove_wp_menus() { 27 42 28 remove_action( 'admin_bar_menu', 'wp_admin_bar_my_account_menu', 10 ); 29 remove_action( 'admin_bar_menu', 'wp_admin_bar_my_sites_menu', 20 ); 30 remove_action( 'admin_bar_menu', 'wp_admin_bar_dashboard_view_site_menu', 25 ); 31 32 // Don't show the 'Edit Page' menu on BP pages 33 if ( !bp_is_blog_page() ) 34 remove_action( 'admin_bar_menu', 'wp_admin_bar_edit_menu', 30 ); 35 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 39 if ( !is_network_admin() && !is_user_admin() ) { 40 remove_action( 'admin_bar_menu', 'wp_admin_bar_comments_menu', 50 ); 41 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 if ( '3.2' == bp_get_major_wp_version() ) { 44 remove_action( 'admin_bar_menu', 'wp_admin_bar_my_account_menu', 10 ); 45 remove_action( 'admin_bar_menu', 'wp_admin_bar_my_sites_menu', 20 ); 46 remove_action( 'admin_bar_menu', 'wp_admin_bar_dashboard_view_site_menu', 25 ); 47 48 // Don't show the 'Edit Page' menu on BP pages 49 if ( !bp_is_blog_page() ) 50 remove_action( 'admin_bar_menu', 'wp_admin_bar_edit_menu', 30 ); 51 52 remove_action( 'admin_bar_menu', 'wp_admin_bar_shortlink_menu', 80 ); 53 remove_action( 'admin_bar_menu', 'wp_admin_bar_updates_menu', 70 ); 54 55 if ( !is_network_admin() && !is_user_admin() ) { 56 remove_action( 'admin_bar_menu', 'wp_admin_bar_comments_menu', 50 ); 57 remove_action( 'admin_bar_menu', 'wp_admin_bar_appearance_menu', 60 ); 58 } 59 60 remove_action( 'admin_bar_menu', 'wp_admin_bar_updates_menu', 70 ); 61 } 45 62 } 46 63 add_action( 'bp_init', 'bp_admin_bar_remove_wp_menus', 2 ); … … 91 108 } 92 109 } 93 add_action( 'bp_setup_admin_bar', 'bp_admin_bar_root_site', 3 );94 110 95 111 /** … … 125 141 } 126 142 } 127 add_action( 'bp_setup_admin_bar', 'bp_admin_bar_my_sites_menu', 3 );128 143 129 144 /** … … 142 157 $wp_admin_bar->add_menu( array( 'parent' => 'dashboard', 'id' => 'comments', 'title' => sprintf( __( 'Comments %s' ), $awaiting_mod ), 'href' => admin_url( 'edit-comments.php' ) ) ); 143 158 } 144 add_action( 'bp_setup_admin_bar', 'bp_admin_bar_comments_menu', 3 );145 159 146 160 /** … … 174 188 $wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'header', 'title' => __( 'Header' ), 'href' => admin_url( 'themes.php?page=custom-header' ) ) ); 175 189 } 176 add_action( 'bp_setup_admin_bar', 'bp_admin_bar_appearance_menu', 3 );177 190 178 191 /** … … 219 232 $wp_admin_bar->add_menu( array( 'parent' => 'dashboard', 'id' => 'updates', 'title' => $update_title, 'href' => network_admin_url( 'update-core.php' ) ) ); 220 233 } 221 add_action( 'bp_setup_admin_bar', 'bp_admin_bar_updates_menu', 3 );222 234 223 235 /** … … 228 240 229 241 if ( !bp_use_wp_admin_bar() ) 242 return; 243 244 if ( '3.3' == bp_get_major_wp_version() ) 230 245 return; 231 246 … … 249 264 } 250 265 add_action( 'bp_init', 'bp_core_load_admin_bar_css' ); 266 251 267 ?>
Note: See TracChangeset
for help on using the changeset viewer.