Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/01/2014 07:33:58 PM (10 years ago)
Author:
johnjamesjacoby
Message:

Add brackets to bp-core-functions.php and remove unused $pagenow global in bp_core_modify_admin_menu_highlight().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/admin/bp-core-functions.php

    r8946 r9113  
    7575 */
    7676function bp_core_modify_admin_menu_highlight() {
    77     global $pagenow, $plugin_page, $submenu_file;
     77    global $plugin_page, $submenu_file;
    7878
    7979    // 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', ) ) ) {
    8181        $submenu_file = 'bp-components';
     82    }
    8283
    8384    // Network Admin > Tools
     
    342343
    343344    // Bail if no activation redirect
    344     if ( ! get_transient( '_bp_activation_redirect' ) )
    345         return;
     345    if ( ! get_transient( '_bp_activation_redirect' ) ) {
     346        return;
     347    }
    346348
    347349    // Delete the redirect transient
     
    349351
    350352    // Bail if activating from network, or bulk
    351     if ( isset( $_GET['activate-multi'] ) )
    352         return;
     353    if ( isset( $_GET['activate-multi'] ) ) {
     354        return;
     355    }
    353356
    354357    $query_args = array( 'page' => 'bp-about' );
     
    564567
    565568    // 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    }
    568572
    569573    // 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    }
    572577
    573578    // 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    }
    576582
    577583    // Bail if there are no components with admin UI's. Hardcoded for now, until
    578584    // 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    }
    581588
    582589    global $menu;
     
    597604
    598605    // Bail if user cannot see admin pages
    599     if ( ! bp_current_user_can( 'bp_moderate' ) )
     606    if ( ! bp_current_user_can( 'bp_moderate' ) ) {
    600607        return $menu_order;
     608    }
    601609
    602610    return true;
     
    615623
    616624    // 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' ) ) {
    618626        return $menu_order;
     627    }
    619628
    620629    // Initialize our custom order array
     
    628637
    629638    // Bail if no components have top level admin pages
    630     if ( empty( $custom_menus ) )
     639    if ( empty( $custom_menus ) ) {
    631640        return $menu_order;
     641    }
    632642
    633643    // Add our separator to beginning of array
Note: See TracChangeset for help on using the changeset viewer.