Skip to:
Content

BuddyPress.org

Changeset 11553


Ignore:
Timestamp:
05/16/2017 06:05:45 PM (3 years ago)
Author:
johnjamesjacoby
Message:

Groups: Use $this->params['enable_nav_item'] vs. $this->enable_nav_item in BP_Group_Extension.

$this->params['enable_nav_item'] is now always set as part of the init() method and legacy parameter juggle, so we can trust it in setup_access_settings().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-groups/classes/class-bp-group-extension.php

    r11552 r11553  
    565565     */
    566566    protected function setup_access_settings() {
     567
    567568        // Bail if no group ID is available.
    568569        if ( empty( $this->group_id ) ) {
     
    581582        // explicit 'access' parameter.
    582583        if ( empty( $this->params['access'] ) ) {
    583             if ( false === $this->enable_nav_item ) {
     584            if ( false === $this->params['enable_nav_item'] ) {
    584585                $this->params['access'] = 'noone';
    585586            } else {
     
    806807     */
    807808    public function user_can_see_nav_item( $user_can_see_nav_item = false ) {
    808         if ( 'noone' !== $this->params['show_tab'] && current_user_can( 'bp_moderate' ) ) {
     809
     810        // Always allow moderators to see nav items, even if explicitly 'noone'
     811        if ( ( 'noone' !== $this->params['show_tab'] ) && current_user_can( 'bp_moderate' ) ) {
    809812            return true;
    810813        }
     
    822825     */
    823826    public function user_can_visit( $user_can_visit = false ) {
     827
     828        // Always allow moderators to visit a tab, even if explicitly 'noone'
    824829        if ( 'noone' !== $this->params['access'] && current_user_can( 'bp_moderate' ) ) {
    825830            return true;
Note: See TracChangeset for help on using the changeset viewer.