diff --git a/src/bp-core/bp-core-admin.php b/src/bp-core/bp-core-admin.php
index 3a7a76d..7da49ff 100644
|
a
|
b
|
class BP_Admin { |
| 141 | 141 | add_action( 'bp_admin_head', array( $this, 'admin_head' ), 999 ); |
| 142 | 142 | |
| 143 | 143 | // Add menu item to settings menu. |
| 144 | | add_action( bp_core_admin_hook(), array( $this, 'admin_menus' ), 5 ); |
| | 144 | add_action( bp_core_admin_hook(), array( $this, 'contextual_admin_menus' ), 5 ); |
| | 145 | add_action( 'admin_menu', array( $this, 'admin_menus' ), 5 ); |
| 145 | 146 | |
| 146 | 147 | // Enqueue all admin JS and CSS. |
| 147 | 148 | add_action( 'bp_admin_enqueue_scripts', array( $this, 'admin_register_styles' ), 1 ); |
| … |
… |
class BP_Admin { |
| 181 | 182 | } |
| 182 | 183 | |
| 183 | 184 | /** |
| 184 | | * Add the navigational menu elements. |
| | 185 | * Add the navigational menu elements to site admin screens. |
| 185 | 186 | * |
| 186 | 187 | * @since 1.6.0 |
| 187 | | * |
| 188 | | * @uses add_management_page() To add the Recount page in Tools section. |
| 189 | | * @uses add_options_page() To add the Forums settings page in Settings |
| 190 | | * section. |
| | 188 | * @since 2.5.0 Function duplicated and renamed to contextual_admin_menus(). |
| | 189 | * New implementation hooked to 'admin_menu'. |
| 191 | 190 | */ |
| 192 | 191 | public function admin_menus() { |
| 193 | 192 | |
| … |
… |
class BP_Admin { |
| 196 | 195 | return; |
| 197 | 196 | } |
| 198 | 197 | |
| | 198 | $hooks = array(); |
| | 199 | |
| | 200 | if ( bp_is_root_blog() ) { |
| | 201 | // Emails |
| | 202 | $hooks[] = add_theme_page( |
| | 203 | _x( 'Emails', 'screen heading', 'buddypress' ), |
| | 204 | _x( 'Emails', 'screen heading', 'buddypress' ), |
| | 205 | $this->capability, |
| | 206 | 'bp-emails-customizer-redirect', |
| | 207 | 'bp_email_redirect_to_customizer' |
| | 208 | ); |
| | 209 | } |
| | 210 | |
| | 211 | foreach( $hooks as $hook ) { |
| | 212 | add_action( "admin_head-$hook", 'bp_core_modify_admin_menu_highlight' ); |
| | 213 | } |
| | 214 | } |
| | 215 | |
| | 216 | /** |
| | 217 | * Register nav menus in appropiate admin screens. |
| | 218 | * |
| | 219 | * This function uses bp_core_admin_hook() to hook to network admin screens, or site admin screens, |
| | 220 | * depending on current BuddyPress configuration. |
| | 221 | * |
| | 222 | * @since 2.5.0 |
| | 223 | */ |
| | 224 | public function contextual_admin_menus() { |
| | 225 | |
| 199 | 226 | // About. |
| 200 | 227 | add_dashboard_page( |
| 201 | 228 | __( 'Welcome to BuddyPress', 'buddypress' ), |
| … |
… |
class BP_Admin { |
| 299 | 326 | 'bp_core_admin_tools' |
| 300 | 327 | ); |
| 301 | 328 | |
| 302 | | $hooks[] = add_theme_page( |
| 303 | | _x( 'Emails', 'screen heading', 'buddypress' ), |
| 304 | | _x( 'Emails', 'screen heading', 'buddypress' ), |
| 305 | | $this->capability, |
| 306 | | 'bp-emails-customizer-redirect', |
| 307 | | 'bp_email_redirect_to_customizer' |
| 308 | | ); |
| 309 | | |
| 310 | 329 | foreach( $hooks as $hook ) { |
| 311 | 330 | add_action( "admin_head-$hook", 'bp_core_modify_admin_menu_highlight' ); |
| 312 | 331 | } |