Changeset 9113 for trunk/src/bp-core/admin/bp-core-functions.php
- Timestamp:
- 11/01/2014 07:33:58 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/admin/bp-core-functions.php
r8946 r9113 75 75 */ 76 76 function bp_core_modify_admin_menu_highlight() { 77 global $p agenow, $plugin_page, $submenu_file;77 global $plugin_page, $submenu_file; 78 78 79 79 // This tweaks the Settings subnav menu to show only one BuddyPress menu item 80 if ( ! in_array( $plugin_page, array( 'bp-activity', 'bp-general-settings', ) ) ) 80 if ( ! in_array( $plugin_page, array( 'bp-activity', 'bp-general-settings', ) ) ) { 81 81 $submenu_file = 'bp-components'; 82 } 82 83 83 84 // Network Admin > Tools … … 342 343 343 344 // Bail if no activation redirect 344 if ( ! get_transient( '_bp_activation_redirect' ) ) 345 return; 345 if ( ! get_transient( '_bp_activation_redirect' ) ) { 346 return; 347 } 346 348 347 349 // Delete the redirect transient … … 349 351 350 352 // Bail if activating from network, or bulk 351 if ( isset( $_GET['activate-multi'] ) ) 352 return; 353 if ( isset( $_GET['activate-multi'] ) ) { 354 return; 355 } 353 356 354 357 $query_args = array( 'page' => 'bp-about' ); … … 564 567 565 568 // Bail if BuddyPress is not network activated and viewing network admin 566 if ( is_network_admin() && ! bp_is_network_activated() ) 567 return; 569 if ( is_network_admin() && ! bp_is_network_activated() ) { 570 return; 571 } 568 572 569 573 // Bail if BuddyPress is network activated and viewing site admin 570 if ( ! is_network_admin() && bp_is_network_activated() ) 571 return; 574 if ( ! is_network_admin() && bp_is_network_activated() ) { 575 return; 576 } 572 577 573 578 // Prevent duplicate separators when no core menu items exist 574 if ( ! bp_current_user_can( 'bp_moderate' ) ) 575 return; 579 if ( ! bp_current_user_can( 'bp_moderate' ) ) { 580 return; 581 } 576 582 577 583 // Bail if there are no components with admin UI's. Hardcoded for now, until 578 584 // there's a real API for determining this later. 579 if ( ! bp_is_active( 'activity' ) && ! bp_is_active( 'groups' ) ) 580 return; 585 if ( ! bp_is_active( 'activity' ) && ! bp_is_active( 'groups' ) ) { 586 return; 587 } 581 588 582 589 global $menu; … … 597 604 598 605 // Bail if user cannot see admin pages 599 if ( ! bp_current_user_can( 'bp_moderate' ) ) 606 if ( ! bp_current_user_can( 'bp_moderate' ) ) { 600 607 return $menu_order; 608 } 601 609 602 610 return true; … … 615 623 616 624 // Bail if user cannot see admin pages 617 if ( empty( $menu_order ) || ! bp_current_user_can( 'bp_moderate' ) ) 625 if ( empty( $menu_order ) || ! bp_current_user_can( 'bp_moderate' ) ) { 618 626 return $menu_order; 627 } 619 628 620 629 // Initialize our custom order array … … 628 637 629 638 // Bail if no components have top level admin pages 630 if ( empty( $custom_menus ) ) 639 if ( empty( $custom_menus ) ) { 631 640 return $menu_order; 641 } 632 642 633 643 // Add our separator to beginning of array
Note: See TracChangeset
for help on using the changeset viewer.