Skip to:
Content

BuddyPress.org

Changeset 11199


Ignore:
Timestamp:
10/19/2016 05:57:59 PM (8 years ago)
Author:
boonebgorges
Message:

Groups: It should be possible to set arbitrary props on BP_Groups_Group objects.

In a number of places (user_is_member, front_template), BP sets
properties on the BP_Groups_Group object. The change to magic methods
(see #5451) broke this process for properties not included in the
class definition of BP_Groups_Group. To maintain compatibility with
previous use, arbitrary properties can now be fetched and set on
these objects.

Props sbrajesh, dcavins.
Fixes #7296.

File:
1 edited

Legend:

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

    r11164 r11199  
    429429
    430430            default :
    431             break;
     431                return isset( $this->{$key} ) ? $this->{$key} : null;
    432432        }
    433433    }
     
    458458
    459459            default :
    460                 return false;
     460                return isset( $this->{$key} );
    461461        }
    462462    }
     
    476476            case 'user_has_access' :
    477477                return $this->user_has_access = (bool) $value;
     478
     479            default :
     480                $this->{$key} = $value;
    478481        }
    479482    }
Note: See TracChangeset for help on using the changeset viewer.