Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/06/2015 12:39:46 AM (9 years ago)
Author:
dcavins
Message:

Allow access-protected bp_nav items to exist.

Fix error introduced in r10003 that prevents
access-protected nav items from being added to the
bp_nav array. The access protection should
happen at access time in
bp_core_register_nav_screen_function().

See #6503.

File:
1 edited

Legend:

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

    r10108 r10326  
    5757
    5858    // Then, hook the screen function for the added nav item.
    59     bp_core_register_nav_screen_function( $r );
     59    $hooked = bp_core_register_nav_screen_function( $r );
     60    if ( false === $hooked ){
     61        return false;
     62    }
    6063
    6164    /**
     
    119122    // If this is for site admins only and the user is not one, don't create the nav item.
    120123    if ( ! empty( $r['site_admin_only'] ) && ! bp_current_user_can( 'bp_moderate' ) ) {
    121         return false;
    122     }
    123 
    124     /**
    125      * If this nav item is hidden for the displayed user, and
    126      * the logged in user is not the displayed user
    127      * looking at their own profile, don't create the nav item.
    128      */
    129     if ( empty( $r['show_for_displayed_user'] ) && ! bp_user_has_access() ) {
    130124        return false;
    131125    }
     
    415409
    416410    // Then, hook the screen function for the added subnav item.
    417     bp_core_register_subnav_screen_function( $args );
    418 
     411    $hooked = bp_core_register_subnav_screen_function( $args );
     412    if ( false === $hooked ) {
     413        return false;
     414    }
    419415}
    420416
Note: See TracChangeset for help on using the changeset viewer.