Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
12/05/2013 07:38:20 PM (11 years ago)
Author:
boonebgorges
Message:

Improve inline documentation in bp-groups. See #5022

File:
1 edited

Legend:

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

    r7645 r7648  
    924924    }
    925925
     926    /**
     927     * Get a list of groups, sorted by those that have the most legacy forum topics.
     928     *
     929     * @param int $limit Optional. The max number of results to return.
     930     *        Default: null (no limit).
     931     * @param int $page Optional. The page offset of results to return.
     932     *        Default: null (no limit).
     933     * @param int $user_id Optional. If present, groups will be limited to
     934     *        those of which the specified user is a member.
     935     * @param string $search_terms Optional. Limit groups to those whose
     936     *        name or description field contain the search string.
     937     * @param bool $populate_extras Optional. Whether to fetch extra
     938     *        information about the groups. Default: true.
     939     * @param string|array Optional. Array or comma-separated list of group
     940     *        IDs to exclude from results.
     941     * @return array {
     942     *     @type array $groups Array of group objects returned by the
     943     *           paginated query.
     944     *     @type int $total Total count of all groups matching non-
     945     *           paginated query params.
     946     * }
     947     */
    926948    public static function get_by_most_forum_topics( $limit = null, $page = null, $user_id = 0, $search_terms = false, $populate_extras = true, $exclude = false ) {
    927949        global $wpdb, $bp, $bbdb;
     
    966988    }
    967989
     990    /**
     991     * Get a list of groups, sorted by those that have the most legacy forum posts.
     992     *
     993     * @param int $limit Optional. The max number of results to return.
     994     *        Default: null (no limit).
     995     * @param int $page Optional. The page offset of results to return.
     996     *        Default: null (no limit).
     997     * @param int $user_id Optional. If present, groups will be limited to
     998     *        those of which the specified user is a member.
     999     * @param string $search_terms Optional. Limit groups to those whose
     1000     *        name or description field contain the search string.
     1001     * @param bool $populate_extras Optional. Whether to fetch extra
     1002     *        information about the groups. Default: true.
     1003     * @param string|array Optional. Array or comma-separated list of group
     1004     *        IDs to exclude from results.
     1005     * @return array {
     1006     *     @type array $groups Array of group objects returned by the
     1007     *           paginated query.
     1008     *     @type int $total Total count of all groups matching non-
     1009     *           paginated query params.
     1010     * }
     1011     */
    9681012    public static function get_by_most_forum_posts( $limit = null, $page = null, $search_terms = false, $populate_extras = true, $exclude = false ) {
    9691013        global $wpdb, $bp, $bbdb;
     
    10081052    }
    10091053
     1054    /**
     1055     * Get a list of groups whose names start with a given letter.
     1056     *
     1057     * @param string $letter The letter.
     1058     * @param int $limit Optional. The max number of results to return.
     1059     *        Default: null (no limit).
     1060     * @param int $page Optional. The page offset of results to return.
     1061     *        Default: null (no limit).
     1062     * @param bool $populate_extras Optional. Whether to fetch extra
     1063     *        information about the groups. Default: true.
     1064     * @param string|array Optional. Array or comma-separated list of group
     1065     *        IDs to exclude from results.
     1066     * @return array {
     1067     *     @type array $groups Array of group objects returned by the
     1068     *           paginated query.
     1069     *     @type int $total Total count of all groups matching non-
     1070     *           paginated query params.
     1071     * }
     1072     */
    10101073    public static function get_by_letter( $letter, $limit = null, $page = null, $populate_extras = true, $exclude = false ) {
    10111074        global $wpdb, $bp;
     
    10521115    }
    10531116
     1117    /**
     1118     * Get a list of random groups.
     1119     *
     1120     * Use BP_Groups_Group::get() with 'type' = 'random' instead.
     1121     *
     1122     * @param int $limit Optional. The max number of results to return.
     1123     *        Default: null (no limit).
     1124     * @param int $page Optional. The page offset of results to return.
     1125     *        Default: null (no limit).
     1126     * @param int $user_id Optional. If present, groups will be limited to
     1127     *        those of which the specified user is a member.
     1128     * @param string $search_terms Optional. Limit groups to those whose
     1129     *        name or description field contain the search string.
     1130     * @param bool $populate_extras Optional. Whether to fetch extra
     1131     *        information about the groups. Default: true.
     1132     * @param string|array Optional. Array or comma-separated list of group
     1133     *        IDs to exclude from results.
     1134     * @return array {
     1135     *     @type array $groups Array of group objects returned by the
     1136     *           paginated query.
     1137     *     @type int $total Total count of all groups matching non-
     1138     *           paginated query params.
     1139     * }
     1140     */
    10541141    public static function get_random( $limit = null, $page = null, $user_id = 0, $search_terms = false, $populate_extras = true, $exclude = false ) {
    10551142        global $wpdb, $bp;
     
    10931180    }
    10941181
     1182    /**
     1183     * Fetch extra data for a list of groups.
     1184     *
     1185     * This method is used throughout the class, by methods that take a
     1186     * $populate_extras parameter.
     1187     *
     1188     * Data fetched:
     1189     *
     1190     *     - Logged-in user's status within each group (is_member,
     1191     *       is_confirmed, is_pending, is_banned)
     1192     *
     1193     * @param array $paged_groups Array of groups.
     1194     * @param string|array Array or comma-separated list of IDs matching
     1195     *        $paged_groups.
     1196     * @param string $type Not used.
     1197     * @return array $paged_groups
     1198     */
    10951199    public static function get_group_extras( &$paged_groups, &$group_ids, $type = false ) {
    10961200        global $bp, $wpdb;
     
    11501254    }
    11511255
     1256    /**
     1257     * Delete all invitations to a given group.
     1258     *
     1259     * @param int $group_id ID of the group whose invitations are being
     1260     *        deleted.
     1261     * @return int|null Number of rows records deleted on success, null on
     1262     *         failure.
     1263     */
    11521264    public static function delete_all_invites( $group_id ) {
    11531265        global $wpdb, $bp;
     
    11561268    }
    11571269
     1270    /**
     1271     * Get a total group count for the site.
     1272     *
     1273     * Will include hidden groups in the count only if
     1274     * current_user_can( 'bp_moderate' ).
     1275     *
     1276     * @return int Group count.
     1277     */
    11581278    public static function get_total_group_count() {
    11591279        global $wpdb, $bp;
     
    11661286    }
    11671287
     1288    /**
     1289     * Get global count of forum topics in public groups (legacy forums).
     1290     *
     1291     * @param $type Optional. If 'unreplied', count will be limited to
     1292     *        those topics that have received no replies.
     1293     * @return int Forum topic count.
     1294     */
    11681295    public static function get_global_forum_topic_count( $type ) {
    11691296        global $bbdb, $wpdb, $bp;
     
    11821309    }
    11831310
     1311    /**
     1312     * Get the member count for a group.
     1313     *
     1314     * @param int $group_id Group ID.
     1315     * @return int Count of confirmed members for the group.
     1316     */
    11841317    public static function get_total_member_count( $group_id ) {
    11851318        global $wpdb, $bp;
     
    11911324     * Get a total count of all topics of a given status, across groups/forums
    11921325     *
    1193      * @package BuddyPress
    1194      * @since BuddyPress (1.5)
    1195      *
    1196      * @param string $status 'public', 'private', 'hidden', 'all' Which group types to count
     1326     * @since BuddyPress (1.5.0)
     1327     *
     1328     * @param string $status Which group type to count. 'public', 'private',
     1329     *        'hidden', or 'all'. Default: 'public'.
    11971330     * @return int The topic count
    11981331     */
     
    12341367
    12351368    /**
    1236      * Get an array containing ids for each group type
     1369     * Get an array containing ids for each group type.
    12371370     *
    12381371     * A bit of a kludge workaround for some issues
    1239      * with bp_has_groups()
    1240      *
    1241      * @since BuddyPress (1.7)
     1372     * with bp_has_groups().
     1373     *
     1374     * @since BuddyPress (1.7.0)
    12421375     *
    12431376     * @return array
     
    12581391
    12591392/**
    1260  * Query for the members of a group
     1393 * Query for the members of a group.
    12611394 *
    1262  * @since BuddyPress (1.8)
     1395 * @since BuddyPress (1.8.0)
    12631396 */
    12641397class BP_Group_Member_Query extends BP_User_Query {
    1265     /**
    1266      * Array of group member ids, cached to prevent redundant lookups
    1267      *
    1268      * @var null|array Null if not yet defined, otherwise an array of ints
     1398
     1399    /**
     1400     * Array of group member ids, cached to prevent redundant lookups.
     1401     *
    12691402     * @since BuddyPress (1.8.1)
     1403     * @var null|array Null if not yet defined, otherwise an array of ints.
    12701404     */
    12711405    protected $group_member_ids;
    12721406
    12731407    /**
    1274      * Set up action hooks
    1275      *
    1276      * @since BuddyPress (1.8)
     1408     * Set up action hooks.
     1409     *
     1410     * @since BuddyPress (1.8.0)
    12771411     */
    12781412    public function setup_hooks() {
     
    12921426
    12931427    /**
    1294      * Get a list of user_ids to include in the IN clause of the main query
     1428     * Get a list of user_ids to include in the IN clause of the main query.
    12951429     *
    12961430     * Overrides BP_User_Query::get_include_ids(), adding our additional
    12971431     * group-member logic.
    12981432     *
    1299      * @since BuddyPress (1.8)
    1300      * @param array
     1433     * @since BuddyPress (1.8.0)
     1434     *
     1435     * @param array $include Existing group IDs in the $include parameter,
     1436     *        as calculated in BP_User_Query.
    13011437     * @return array
    13021438     */
     
    13291465
    13301466    /**
    1331      * Get the members of the queried group
    1332      *
    1333      * @since BuddyPress (1.8)
    1334      * @return array $ids User IDs of relevant group member ids
     1467     * Get the members of the queried group.
     1468     *
     1469     * @since BuddyPress (1.8.0)
     1470     *
     1471     * @return array $ids User IDs of relevant group member ids.
    13351472     */
    13361473    protected function get_group_member_ids() {
     
    14251562
    14261563    /**
    1427      * Tell BP_User_Query to order by the order of our query results
     1564     * Tell BP_User_Query to order by the order of our query results.
    14281565     *
    14291566     * This implementation assumes the 'last_modified' sort order
    14301567     * hardcoded in BP_Group_Member_Query::get_group_member_ids().
    14311568     *
    1432      * @param object $query BP_User_Query object
     1569     * @param BP_User_Query $query BP_User_Query object.
    14331570     */
    14341571    public function set_orderby( $query ) {
     
    14501587
    14511588    /**
    1452      * Fetch additional data required in bp_group_has_members() loops
    1453      *
    1454      * @since BuddyPress (1.8)
     1589     * Fetch additional data required in bp_group_has_members() loops.
     1590     *
     1591     * Additional data fetched:
     1592     *
     1593     *      - is_banned
     1594     *      - date_modified
     1595     *
     1596     * @since BuddyPress (1.8.0)
     1597     *
    14551598     * @param object $query BP_User_Query object. Because we're filtering
    14561599     *   the current object, we use $this inside of the method instead
     
    14781621}
    14791622
     1623/**
     1624 * BuddyPress Group Membership objects.
     1625 */
    14801626class BP_Groups_Member {
     1627
     1628    /**
     1629     * ID of the membership.
     1630     *
     1631     * @access public
     1632     * @var int
     1633     */
    14811634    var $id;
     1635
     1636    /**
     1637     * ID of the group associated with the membership.
     1638     *
     1639     * @access public
     1640     * @var int
     1641     */
    14821642    var $group_id;
     1643
     1644    /**
     1645     * ID of the user associated with the membership.
     1646     *
     1647     * @access public
     1648     * @var int
     1649     */
    14831650    var $user_id;
     1651
     1652    /**
     1653     * ID of the user whose invitation initiated the membership.
     1654     *
     1655     * @access public
     1656     * @var int
     1657     */
    14841658    var $inviter_id;
     1659
     1660    /**
     1661     * Whether the member is an admin of the group.
     1662     *
     1663     * @access public
     1664     * @var int
     1665     */
    14851666    var $is_admin;
     1667
     1668    /**
     1669     * Whether the member is a mod of the group.
     1670     *
     1671     * @access public
     1672     * @var int
     1673     */
    14861674    var $is_mod;
     1675
     1676    /**
     1677     * Whether the member is banned from the group.
     1678     *
     1679     * @access public
     1680     * @var int
     1681     */
    14871682    var $is_banned;
     1683
     1684    /**
     1685     * Title used to describe the group member's role in the group.
     1686     *
     1687     * Eg, 'Group Admin'.
     1688     *
     1689     * @access public
     1690     * @var int
     1691     */
    14881692    var $user_title;
     1693
     1694    /**
     1695     * Last modified date of the membership.
     1696     *
     1697     * This value is updated when, eg, invitations are accepted.
     1698     *
     1699     * @access public
     1700     * @var string
     1701     */
    14891702    var $date_modified;
     1703
     1704    /**
     1705     * Whether the membership has been confirmed.
     1706     *
     1707     * @access public
     1708     * @var int
     1709     */
    14901710    var $is_confirmed;
     1711
     1712    /**
     1713     * Comments associated with the membership.
     1714     *
     1715     * In BP core, these are limited to the optional message users can
     1716     * include when requesting membership to a private group.
     1717     *
     1718     * @access public
     1719     * @var string
     1720     */
    14911721    var $comments;
     1722
     1723    /**
     1724     * Whether an invitation has been sent for this membership.
     1725     *
     1726     * The purpose of this flag is to mark when an invitation has been
     1727     * "drafted" (the user has been added via the interface at Send
     1728     * Invites), but the Send button has not been pressed, so the
     1729     * invitee has not yet been notified.
     1730     *
     1731     * @access public
     1732     * @var int
     1733     */
    14921734    var $invite_sent;
     1735
     1736    /**
     1737     * WP_User object representing the membership's user.
     1738     *
     1739     * @access public
     1740     * @var WP_User
     1741     */
    14931742    var $user;
    14941743
     1744    /**
     1745     * Constructor method.
     1746     *
     1747     * @param int $user_id Optional. Along with $group_id, can be used to
     1748     *        look up a membership.
     1749     * @param int $group_id Optional. Along with $user_id, can be used to
     1750     *        look up a membership.
     1751     * @param int $id Optional. The unique ID of the membership object.
     1752     * @param bool $populate Whether to populate the properties of the
     1753     *        located membership. Default: true.
     1754     */
    14951755    public function __construct( $user_id = 0, $group_id = 0, $id = false, $populate = true ) {
    14961756
     
    15151775    }
    15161776
     1777    /**
     1778     * Populate the object's properties.
     1779     */
    15171780    public function populate() {
    15181781        global $wpdb, $bp;
     
    15441807    }
    15451808
     1809    /**
     1810     * Save the membership data to the database.
     1811     *
     1812     * @return bool True on success, false on failure.
     1813     */
    15461814    public function save() {
    15471815        global $wpdb, $bp;
     
    15881856    }
    15891857
     1858    /**
     1859     * Promote a member to a new status.
     1860     *
     1861     * @param string $status The new status. 'mod' or 'admin'.
     1862     * @return bool True on success, false on failure.
     1863     */
    15901864    public function promote( $status = 'mod' ) {
    15911865        if ( 'mod' == $status ) {
     
    16041878    }
    16051879
     1880    /**
     1881     * Demote membership to Member status (non-admin, non-mod).
     1882     *
     1883     * @return bool True on success, false on failure.
     1884     */
    16061885    public function demote() {
    16071886        $this->is_mod     = 0;
     
    16121891    }
    16131892
     1893    /**
     1894     * Ban the user from the group.
     1895     *
     1896     * @return bool True on success, false on failure.
     1897     */
    16141898    public function ban() {
    16151899        if ( !empty( $this->is_admin ) )
     
    16221906    }
    16231907
     1908    /**
     1909     * Unban the user from the group.
     1910     *
     1911     * @return bool True on success, false on failure.
     1912     */
    16241913    public function unban() {
    16251914        if ( !empty( $this->is_admin ) )
     
    16311920    }
    16321921
     1922    /**
     1923     * Mark a pending invitation as accepted.
     1924     */
    16331925    public function accept_invite() {
    16341926        $this->inviter_id    = 0;
     
    16371929    }
    16381930
     1931    /**
     1932     * Confirm a membership request.
     1933     */
    16391934    public function accept_request() {
    16401935        $this->is_confirmed = 1;
     
    16421937    }
    16431938
     1939    /**
     1940     * Remove the current membership.
     1941     *
     1942     * @return bool True on success, false on failure.
     1943     */
    16441944    public function remove() {
    16451945        global $wpdb, $bp;
     
    16591959    }
    16601960
    1661     /** Static Methods ********************************************************/
    1662 
    1663     /**
    1664      * Refresh the total_group_count for a user
    1665      *
    1666      * @since BuddyPress (1.8)
    1667      * @param int $user_id
    1668      * @return bool True on success
     1961    /** Static Methods ****************************************************/
     1962
     1963    /**
     1964     * Refresh the total_group_count for a user.
     1965     *
     1966     * @since BuddyPress (1.8.0)
     1967     *
     1968     * @param int $user_id ID of the user.
     1969     * @return bool True on success, false on failure.
    16691970     */
    16701971    public static function refresh_total_group_count_for_user( $user_id ) {
     
    16731974
    16741975    /**
    1675      * Refresh the total_member_count for a group
    1676      *
    1677      * @since BuddyPress (1.8)
    1678      * @param int $group_id
    1679      * @return bool True on success
     1976     * Refresh the total_member_count for a group.
     1977     *
     1978     * @since BuddyPress (1.8.0)
     1979     *
     1980     * @param int $group_id ID of the group.
     1981     * @return bool True on success, false on failure.
    16801982     */
    16811983    public static function refresh_total_member_count_for_group( $group_id ) {
     
    16831985    }
    16841986
     1987    /**
     1988     * Delete a membership, based on user + group IDs.
     1989     *
     1990     * @param int $user_id ID of the user.
     1991     * @param int $group_id ID of the group.
     1992     * @return True on success, false on failure.
     1993     */
    16851994    public static function delete( $user_id, $group_id ) {
    16861995        global $wpdb, $bp;
     
    16972006    }
    16982007
     2008    /**
     2009     * Get the IDs of the groups of which a specified user is a member.
     2010     *
     2011     * @param int $user_id ID of the user.
     2012     * @param int $limit Optional. Max number of results to return.
     2013     *        Default: false (no limit).
     2014     * @param int $page Optional. Page offset of results to return.
     2015     *        Default: false (no limit).
     2016     * @return array {
     2017     *     @type array $groups Array of groups returned by paginated query.
     2018     *     @type int $total Count of groups matching query.
     2019     * }
     2020     */
    16992021    public static function get_group_ids( $user_id, $limit = false, $page = false ) {
    17002022        global $wpdb, $bp;
     
    17182040    }
    17192041
     2042    /**
     2043     * Get the IDs of the groups of which a specified user is a member, sorted by the date joined.
     2044     *
     2045     * @param int $user_id ID of the user.
     2046     * @param int $limit Optional. Max number of results to return.
     2047     *        Default: false (no limit).
     2048     * @param int $page Optional. Page offset of results to return.
     2049     *        Default: false (no limit).
     2050     * @param string $filter Optional. Limit results to groups whose name or
     2051     *        description field matches search terms.
     2052     * @return array {
     2053     *     @type array $groups Array of groups returned by paginated query.
     2054     *     @type int $total Count of groups matching query.
     2055     * }
     2056     */
    17202057    public static function get_recently_joined( $user_id, $limit = false, $page = false, $filter = false ) {
    17212058        global $wpdb, $bp;
     
    17402077    }
    17412078
     2079    /**
     2080     * Get the IDs of the groups of which a specified user is an admin.
     2081     *
     2082     * @param int $user_id ID of the user.
     2083     * @param int $limit Optional. Max number of results to return.
     2084     *        Default: false (no limit).
     2085     * @param int $page Optional. Page offset of results to return.
     2086     *        Default: false (no limit).
     2087     * @param string $filter Optional. Limit results to groups whose name or
     2088     *        description field matches search terms.
     2089     * @return array {
     2090     *     @type array $groups Array of groups returned by paginated query.
     2091     *     @type int $total Count of groups matching query.
     2092     * }
     2093     */
    17422094    public static function get_is_admin_of( $user_id, $limit = false, $page = false, $filter = false ) {
    17432095        global $wpdb, $bp;
     
    17622114    }
    17632115
     2116    /**
     2117     * Get the IDs of the groups of which a specified user is a moderator.
     2118     *
     2119     * @param int $user_id ID of the user.
     2120     * @param int $limit Optional. Max number of results to return.
     2121     *        Default: false (no limit).
     2122     * @param int $page Optional. Page offset of results to return.
     2123     *        Default: false (no limit).
     2124     * @param string $filter Optional. Limit results to groups whose name or
     2125     *        description field matches search terms.
     2126     * @return array {
     2127     *     @type array $groups Array of groups returned by paginated query.
     2128     *     @type int $total Count of groups matching query.
     2129     * }
     2130     */
    17642131    public static function get_is_mod_of( $user_id, $limit = false, $page = false, $filter = false ) {
    17652132        global $wpdb, $bp;
     
    17842151    }
    17852152
     2153    /**
     2154     * Get the count of groups of which the specified user is a member.
     2155     *
     2156     * @param int $user_id Optional. Default: ID of the displayed user.
     2157     * @return int Group count.
     2158     */
    17862159    public static function total_group_count( $user_id = 0 ) {
    17872160        global $bp, $wpdb;
     
    17972170    }
    17982171
     2172    /**
     2173     * Get a user's outstanding group invitations.
     2174     *
     2175     * @param int $user_id ID of the invitee.
     2176     * @param int $limit Optional. Max number of results to return.
     2177     *        Default: false (no limit).
     2178     * @param int $page Optional. Page offset of results to return.
     2179     *        Default: false (no limit).
     2180     * @param string|array $exclude Optional. Array or comma-separated list
     2181     *        of group IDs to exclude from results.
     2182     * @return array {
     2183     *     @type array $groups Array of groups returned by paginated query.
     2184     *     @type int $total Count of groups matching query.
     2185     * }
     2186     */
    17992187    public static function get_invites( $user_id, $limit = false, $page = false, $exclude = false ) {
    18002188        global $wpdb, $bp;
     
    18152203    }
    18162204
     2205    /**
     2206     * Check whether a user has an outstanding invitation to a given group.
     2207     *
     2208     * @param int $user_id ID of the potential invitee.
     2209     * @param int $group_id ID of the group.
     2210     * @param string $type If 'sent', results are limited to those
     2211     *        invitations that have actually been sent (non-draft).
     2212     *        Default: 'sent'.
     2213     * @return int|null The ID of the invitation if found, otherwise null.
     2214     */
    18172215    public static function check_has_invite( $user_id, $group_id, $type = 'sent' ) {
    18182216        global $wpdb, $bp;
     
    18292227    }
    18302228
     2229    /**
     2230     * Delete an invitation, by specifying user ID and group ID.
     2231     *
     2232     * @param int $user_id ID of the user.
     2233     * @param int $group_id ID of the group.
     2234     * @return int Number of records deleted.
     2235     */
    18312236    public static function delete_invite( $user_id, $group_id ) {
    18322237        global $wpdb, $bp;
     
    18382243    }
    18392244
     2245    /**
     2246     * Delete an unconfirmed membership request, by user ID and group ID.
     2247     *
     2248     * @param int $user_id ID of the user.
     2249     * @param int $group_id ID of the group.
     2250     * @return int Number of records deleted.
     2251     */
    18402252    public static function delete_request( $user_id, $group_id ) {
    18412253        global $wpdb, $bp;
     
    18472259    }
    18482260
     2261    /**
     2262     * Check whether a user is an admin of a given group.
     2263     *
     2264     * @param int $user_id ID of the user.
     2265     * @param int $group_id ID of the group.
     2266     * @param int|null ID of the membership if the user is an admin,
     2267     *        otherwise null.
     2268     */
    18492269    public static function check_is_admin( $user_id, $group_id ) {
    18502270        global $wpdb, $bp;
     
    18562276    }
    18572277
     2278    /**
     2279     * Check whether a user is a mod of a given group.
     2280     *
     2281     * @param int $user_id ID of the user.
     2282     * @param int $group_id ID of the group.
     2283     * @param int|null ID of the membership if the user is a mod,
     2284     *        otherwise null.
     2285     */
    18582286    public static function check_is_mod( $user_id, $group_id ) {
    18592287        global $wpdb, $bp;
     
    18652293    }
    18662294
     2295    /**
     2296     * Check whether a user is a member of a given group.
     2297     *
     2298     * @param int $user_id ID of the user.
     2299     * @param int $group_id ID of the group.
     2300     * @param int|null ID of the membership if the user is a member,
     2301     *        otherwise null.
     2302     */
    18672303    public static function check_is_member( $user_id, $group_id ) {
    18682304        global $wpdb, $bp;
     
    18742310    }
    18752311
     2312    /**
     2313     * Check whether a user is banned from a given group.
     2314     *
     2315     * @param int $user_id ID of the user.
     2316     * @param int $group_id ID of the group.
     2317     * @param int|null ID of the membership if the user is banned,
     2318     *        otherwise null.
     2319     */
    18762320    public static function check_is_banned( $user_id, $group_id ) {
    18772321        global $wpdb, $bp;
     
    18862330     * Is the specified user the creator of the group?
    18872331     *
    1888      * @global object $bp BuddyPress global settings
    1889      * @global wpdb $wpdb WordPress database object
    1890      * @param int $user_id
    1891      * @param int $group_id
    18922332     * @since BuddyPress (1.2.6)
     2333     *
     2334     * @param int $user_id ID of the user.
     2335     * @param int $group_id ID of the group.
     2336     * @return int|null ID of the group if the user is the creator,
     2337     *         otherwise false.
    18932338     */
    18942339    public static function check_is_creator( $user_id, $group_id ) {
     
    19012346    }
    19022347
     2348    /**
     2349     * Check whether a user has an outstanding membership request for a given group.
     2350     *
     2351     * @param int $user_id ID of the user.
     2352     * @param int $group_id ID of the group.
     2353     * @return int|null ID of the membership if found, otherwise false.
     2354     */
    19032355    public static function check_for_membership_request( $user_id, $group_id ) {
    19042356        global $wpdb, $bp;
     
    19102362    }
    19112363
     2364    /**
     2365     * Get a list of randomly selected IDs of groups that the member belongs to.
     2366     *
     2367     * @param int $user_id ID of the user.
     2368     * @param int $total_groups Max number of group IDs to return. Default: 5.
     2369     * @return array Group IDs.
     2370     */
    19122371    public static function get_random_groups( $user_id = 0, $total_groups = 5 ) {
    19132372        global $wpdb, $bp;
     
    19212380    }
    19222381
     2382    /**
     2383     * Get the IDs of all a given group's members.
     2384     *
     2385     * @param int $group_id ID of the group.
     2386     * @return array IDs of all group members.
     2387     */
    19232388    public static function get_group_member_ids( $group_id ) {
    19242389        global $bp, $wpdb;
     
    19272392    }
    19282393
     2394    /**
     2395     * Get a list of all a given group's admins.
     2396     *
     2397     * @param int $group_id ID of the group.
     2398     * @return array Info about group admins (user_id + date_modified).
     2399     */
    19292400    public static function get_group_administrator_ids( $group_id ) {
    19302401        global $bp, $wpdb;
     
    19332404    }
    19342405
     2406    /**
     2407     * Get a list of all a given group's moderators.
     2408     *
     2409     * @param int $group_id ID of the group.
     2410     * @return array Info about group mods (user_id + date_modified).
     2411     */
    19352412    public static function get_group_moderator_ids( $group_id ) {
    19362413        global $bp, $wpdb;
     
    19392416    }
    19402417
     2418    /**
     2419     * Get the IDs users with outstanding membership requests to the group.
     2420     *
     2421     * @param int $group_id ID of the group.
     2422     * @return array IDs of users with outstanding membership requests.
     2423     */
    19412424    public static function get_all_membership_request_user_ids( $group_id ) {
    19422425        global $bp, $wpdb;
     
    19452428    }
    19462429
     2430    /**
     2431     * Get members of a group.
     2432     *
     2433     * @deprecated BuddyPress (1.8.0)
     2434     */
    19472435    public static function get_all_for_group( $group_id, $limit = false, $page = false, $exclude_admins_mods = true, $exclude_banned = true, $exclude = false ) {
    19482436        global $bp, $wpdb;
     
    20042492    }
    20052493
     2494    /**
     2495     * Delete all memberships for a given group.
     2496     *
     2497     * @param int $group_id ID of the group.
     2498     * @return int Number of records deleted.
     2499     */
    20062500    public static function delete_all( $group_id ) {
    20072501        global $wpdb, $bp;
     
    20112505
    20122506    /**
    2013      * Delete all group membership information for the specified user
    2014      *
    2015      * @global object $bp BuddyPress global settings
    2016      * @global wpdb $wpdb WordPress database object
    2017      * @param int $user_id
    2018      * @since BuddyPress (1.0)
    2019      * @uses BP_Groups_Member
     2507     * Delete all group membership information for the specified user.
     2508     *
     2509     * @since BuddyPress (1.0.0)
     2510     *
     2511     * @param int $user_id ID of the user.
    20202512     */
    20212513    public static function delete_all_for_user( $user_id ) {
     
    21102602 * @package BuddyPress
    21112603 * @subpackage Groups
    2112  * @since BuddyPress (1.1)
     2604 * @since BuddyPress (1.1.0)
    21132605 */
    21142606class BP_Group_Extension {
    21152607
    2116     /** Public ****************************************************************/
    2117 
    2118     /**
    2119      * @var array Information about this extension's screens
    2120      * @since BuddyPress (1.8)
     2608    /** Public ************************************************************/
     2609
     2610    /**
     2611     * Information about this extension's screens.
     2612     *
     2613     * @since BuddyPress (1.8.0)
     2614     * @var array
    21212615     */
    21222616    public $screens = array();
    21232617
    21242618    /**
    2125      * @var string The name of the extending class
    2126      * @since BuddyPress (1.8)
     2619     * The name of the extending class.
     2620     *
     2621     * @since BuddyPress (1.8.0)
     2622     * @var string
    21272623     */
    21282624    public $class_name = '';
    21292625
    21302626    /**
    2131      * @var object A ReflectionClass object of the current extension
    2132      * @since BuddyPress (1.8)
     2627     * A ReflectionClass object of the current extension.
     2628     *
     2629     * @since BuddyPress (1.8.0)
     2630     * @var ReflectionClass
    21332631     */
    21342632    public $class_reflection = null;
    21352633
    21362634    /**
    2137      * @var array Parsed configuration paramaters for the extension
    2138      * @since BuddyPress (1.8)
     2635     * Parsed configuration paramaters for the extension.
     2636     *
     2637     * @since BuddyPress (1.8.0)
     2638     * @var array
    21392639     */
    21402640    public $params = array();
    21412641
    21422642    /**
    2143      * @var int The id of the current group
    2144      * @since BuddyPress (1.8)
     2643     * The ID of the current group.
     2644     *
     2645     * @since BuddyPress (1.8.0)
     2646     * @var int
    21452647     */
    21462648    public $group_id = 0;
    21472649
    21482650    /**
    2149      * @var string The slug of the current extension
     2651     * The slug of the current extension.
     2652     *
     2653     * @var string
    21502654     */
    21512655    public $slug = '';
    21522656
    21532657    /**
    2154      * @var string The translatable name of the current extension
     2658     * The translatable name of the current extension.
     2659     *
     2660     * @var string
    21552661     */
    21562662    public $name = '';
    21572663
    21582664    /**
    2159      * @var string Whether the extension tab is visible. 'public'
    2160      *   or 'private'
     2665     * The visibility of the extension tab. 'public' or 'private'.
     2666     *
     2667     * @var string
    21612668     */
    21622669    public $visibility = 'public';
    21632670
    21642671    /**
    2165      * @var int The numeric position of the main nav item
     2672     * The numeric position of the main nav item.
     2673     *
     2674     * @var int
    21662675     */
    21672676    public $nav_item_position = 81;
    21682677
    21692678    /**
    2170      * @var bool Whether to show the nav item
     2679     * Whether to show the nav item.
     2680     *
     2681     * @var bool
    21712682     */
    21722683    public $enable_nav_item = true;
    21732684
    21742685    /**
    2175      * @var string The text of the nav item. Defaults to self::name
     2686     * The text of the nav item. Defaults to self::name.
     2687     *
     2688     * @var string
    21762689     */
    21772690    public $nav_item_name = '';
    21782691
    21792692    /**
    2180      * @var string The WP action that self::widget_display() is attached to.
    2181      *   Defaults to 'groups_custom_group_boxes'
     2693     * The WP action that self::widget_display() is attached to.
     2694     *
     2695     * Default: 'groups_custom_group_boxes'.
     2696     *
     2697     * @var string
    21822698     */
    21832699    public $display_hook = 'groups_custom_group_boxes';
    21842700
    21852701    /**
    2186      * @var string The template file used to load the plugin content.
    2187      *   Defaults to 'groups/single/plugins'
     2702     * The template file used to load the plugin content.
     2703     *
     2704     * Default: 'groups/single/plugins'.
     2705     *
     2706     * @var string
    21882707     */
    21892708    public $template_file = 'groups/single/plugins';
    21902709
    2191     /** Protected *************************************************************/
    2192 
    2193     /**
    2194      * @var bool Has the extension been initialized?
    2195      * @since BuddyPress (1.8)
     2710    /** Protected *********************************************************/
     2711
     2712    /**
     2713     * Has the extension been initialized?
     2714     *
     2715     * @since BuddyPress (1.8.0)
     2716     * @var bool
    21962717     */
    21972718    protected $initialized = false;
    21982719
    21992720    /**
    2200      * @var array Extension properties as set by legacy extensions
    2201      * @since BuddyPress (1.8)
     2721     * Extension properties as set by legacy extensions.
     2722     *
     2723     * @since BuddyPress (1.8.0)
     2724     * @var array
    22022725     */
    22032726    protected $legacy_properties = array();
    22042727
    22052728    /**
    2206      * @var array Extension properties as set by legacy extensions, but
    2207      *   converted to match the new format for params
    2208      * @since BuddyPress (1.8)
     2729     * Converted legacy parameters.
     2730     *
     2731     * These are the extension properties as set by legacy extensions, but
     2732     * then converted to match the new format for params.
     2733     *
     2734     * @since BuddyPress (1.8.0)
     2735     * @var array
    22092736     */
    22102737    protected $legacy_properties_converted = array();
    22112738
    22122739    /**
    2213      * @var array Miscellaneous data as set by the __set() magic method
    2214      * @since BuddyPress (1.8)
     2740     * Miscellaneous data as set by the __set() magic method.
     2741     *
     2742     * @since BuddyPress (1.8.0)
     2743     * @var array
    22152744     */
    22162745    protected $data = array();
    22172746
    2218     /** Screen Overrides ******************************************************/
    2219 
    2220     /**
     2747    /** Screen Overrides **************************************************/
     2748
     2749    /*
    22212750     * Screen override methods are how your extension will display content
    22222751     * and handle form submits. Your extension should only override those
     
    22632792     *
    22642793     * @since BuddyPress (1.8)
    2265      * @param array $args See inline definition below for arguments
     2794     * @param array $args {
     2795     *     Array of initialization arguments.
     2796     *     @type string $slug Unique, URL-safe identifier for your
     2797     *           extension.
     2798     *     @type string $name Translatable name for your extension. Used to
     2799     *           populate navigation items.
     2800     *     @type string $visibility Optional. Set to 'public' for your
     2801     *           extension (the main tab as well as the widget) to be
     2802     *           available to anyone who can access the group; set to
     2803     *           'private' otherwise. Default: 'public'.
     2804     *     @type int $nav_item_position Optional. Location of the nav item
     2805     *           in the tab list. Default: 81.
     2806     *     @type bool $enable_nav_item Optional. Whether the extension's
     2807     *           tab should be accessible to anyone who can view the group.
     2808     *           Default: true.
     2809     *     @type string $nav_item_name Optional. The translatable text you
     2810     *           want to appear in the nav tab. Default: the value of $name.
     2811     *     @type string $display_hook Optional. The WordPress action that
     2812     *           the widget_display() method is hooked to.
     2813     *           Default: 'groups_custom_group_boxes'.
     2814     *     @type string $template_file Optional. Theme-relative path to the
     2815     *           template file BP should use to load the content of your
     2816     *           main extension tab. Default: 'groups/single/plugins.php'.
     2817     *     @type array $screens A multi-dimensional array of configuration
     2818     *           information for the extension screens. See docblock of
     2819     *           {@link BP_Group_Extension} for more details.
     2820     * }
    22662821     */
    22672822    public function init( $args = array() ) {
     
    22922847
    22932848    /**
    2294      * The main setup routine for the extension
     2849     * The main setup routine for the extension.
    22952850     *
    22962851     * This method contains the primary logic for setting up an extension's
     
    23032858     * bp_register_group_extension().
    23042859     *
    2305      * @since BuddyPress (1.1)
     2860     * @since BuddyPress (1.1.0)
    23062861     */
    23072862    public function _register() {
     
    23412896
    23422897    /**
    2343      * Set up some basic info about the Extension
     2898     * Set up some basic info about the Extension.
    23442899     *
    23452900     * Here we collect the name of the extending class, as well as a
     
    23472902     * whether your extension overrides certain callback methods.
    23482903     *
    2349      * @since BuddyPress (1.8)
     2904     * @since BuddyPress (1.8.0)
    23502905     */
    23512906    protected function setup_class_info() {
     
    23602915
    23612916    /**
    2362      * Get the current group id
     2917     * Get the current group ID.
    23632918     *
    23642919     * Check for:
     
    23672922     *   - group admin
    23682923     *
    2369      * @since BuddyPress (1.8)
     2924     * @since BuddyPress (1.8.0)
    23702925     */
    23712926    public static function get_group_id() {
     
    23962951
    23972952    /**
    2398      * Gather configuration data about your screens
    2399      *
    2400      * @since BuddyPress (1.8)
     2953     * Gather configuration data about your screens.
     2954     *
     2955     * @since BuddyPress (1.8.0)
    24012956     */
    24022957    protected function get_default_screens() {
     
    24292984
    24302985    /**
    2431      * Set up screens array based on params
    2432      *
    2433      * @since BuddyPress (1.8)
     2986     * Set up screens array based on params.
     2987     *
     2988     * @since BuddyPress (1.8.0)
    24342989     */
    24352990    protected function setup_screens() {
     
    24473002    }
    24483003
    2449     /** Display ***************************************************************/
    2450 
    2451     /**
    2452      * Hook this extension's group tab into BuddyPress, if necessary
    2453      *
    2454      * @since BuddyPress (1.8)
     3004    /** Display ***********************************************************/
     3005
     3006    /**
     3007     * Hook this extension's group tab into BuddyPress, if necessary.
     3008     *
     3009     * @since BuddyPress (1.8.0)
    24553010     */
    24563011    protected function setup_display_hooks() {
     
    24923047
    24933048    /**
    2494      * Hooks the main display method, and loads the template file
     3049     * Hook the main display method, and loads the template file
    24953050     */
    24963051    public function _display_hook() {
     
    24993054    }
    25003055
    2501     /** Create ****************************************************************/
    2502 
    2503     /**
    2504      * Hook this extension's Create step into BuddyPress, if necessary
    2505      *
    2506      * @since BuddyPress (1.8)
     3056    /** Create ************************************************************/
     3057
     3058    /**
     3059     * Hook this extension's Create step into BuddyPress, if necessary.
     3060     *
     3061     * @since BuddyPress (1.8.0)
    25073062     */
    25083063    protected function setup_create_hooks() {
     
    25303085
    25313086    /**
    2532      * Call the create_screen() method, if we're on the right page
    2533      *
    2534      * @since BuddyPress (1.8)
     3087     * Call the create_screen() method, if we're on the right page.
     3088     *
     3089     * @since BuddyPress (1.8.0)
    25353090     */
    25363091    public function maybe_create_screen() {
     
    25483103
    25493104    /**
    2550      * Call the create_screen_save() method, if we're on the right page
    2551      *
    2552      * @since BuddyPress (1.8)
     3105     * Call the create_screen_save() method, if we're on the right page.
     3106     *
     3107     * @since BuddyPress (1.8.0)
    25533108     */
    25543109    public function maybe_create_screen_save() {
     
    25613116    }
    25623117
    2563     /** Edit ******************************************************************/
    2564 
    2565     /**
    2566      * Hook this extension's Edit panel into BuddyPress, if necessary
    2567      *
    2568      * @since BuddyPress (1.8)
     3118    /** Edit **************************************************************/
     3119
     3120    /**
     3121     * Hook this extension's Edit panel into BuddyPress, if necessary.
     3122     *
     3123     * @since BuddyPress (1.8.0)
    25693124     */
    25703125    protected function setup_edit_hooks() {
     
    26113166
    26123167    /**
    2613      * Call the edit_screen() method
     3168     * Call the edit_screen() method.
    26143169     *
    26153170     * Previous versions of BP_Group_Extension required plugins to provide
     
    26233178     * do not auto-add our own button.
    26243179     *
    2625      * @since BuddyPress (1.8)
     3180     * @since BuddyPress (1.8.0)
    26263181     */
    26273182    public function call_edit_screen() {
     
    26373192
    26383193    /**
    2639      * Check the nonce, and call the edit_screen_save() method
    2640      *
    2641      * @since BuddyPress (1.8)
     3194     * Check the nonce, and call the edit_screen_save() method.
     3195     *
     3196     * @since BuddyPress (1.8.0)
    26423197     */
    26433198    public function call_edit_screen_save() {
     
    26573212
    26583213    /**
    2659      * Load the template that houses the Edit screen
     3214     * Load the template that houses the Edit screen.
    26603215     *
    26613216     * Separated out into a callback so that it can run after all other
     
    26653220     * Hooked to 'bp_screens'.
    26663221     *
     3222     * @since BuddyPress (1.8.0)
     3223     * @access public So that do_action() has access. Do not call directly.
     3224     *
    26673225     * @see BP_Group_Extension::setup_edit_hooks()
    2668      * @access public So that do_action() has access. Do not call directly.
    2669      * @since BuddyPress (1.8)
    26703226     */
    26713227    public function call_edit_screen_template_loader() {
     
    26743230
    26753231    /**
    2676      * Add a submit button to the edit form, if it needs one
     3232     * Add a submit button to the edit form, if it needs one.
    26773233     *
    26783234     * There's an inconsistency in the way that the group Edit and Create
     
    26833239     * if one is not found.
    26843240     *
    2685      * @since BuddyPress (1.8)
    2686      * @param string $screen The screen markup, captured in the output buffer
    2687      * @param string $screen The same markup, with a submit button added
     3241     * @since BuddyPress (1.8.0)
     3242     *
     3243     * @param string $screen The screen markup, captured in the output
     3244     *        buffer.
     3245     * @param string $screen The same markup, with a submit button added.
    26883246     */
    26893247    protected function maybe_add_submit_button( $screen = '' ) {
     
    27033261     * Does the given markup have a submit button?
    27043262     *
    2705      * @since BuddyPress (1.8)
    2706      * @param string $screen The markup to check
    2707      * @return bool
     3263     * @since BuddyPress (1.8.0)
     3264     *
     3265     * @param string $screen The markup to check.
     3266     * @return bool True if a Submit button is found, otherwise false.
    27083267     */
    27093268    public static function has_submit_button( $screen = '' ) {
     
    27133272    }
    27143273
    2715     /** Admin *****************************************************************/
    2716 
    2717     /**
    2718      * Hook this extension's Admin metabox into BuddyPress, if necessary
    2719      *
    2720      * @since BuddyPress (1.8)
     3274    /** Admin *************************************************************/
     3275
     3276    /**
     3277     * Hook this extension's Admin metabox into BuddyPress, if necessary.
     3278     *
     3279     * @since BuddyPress (1.8.0)
    27213280     */
    27223281    protected function setup_admin_hooks() {
     
    27363295
    27373296    /**
    2738      * Call the admin_screen() method, and add a nonce field
    2739      *
    2740      * @since BuddyPress (1.8)
     3297     * Call the admin_screen() method, and add a nonce field.
     3298     *
     3299     * @since BuddyPress (1.8.0)
    27413300     */
    27423301    public function call_admin_screen() {
     
    27483307     * Check the nonce, and call the admin_screen_save() method
    27493308     *
    2750      * @since BuddyPress (1.8)
     3309     * @since BuddyPress (1.8.0)
    27513310     */
    27523311    public function call_admin_screen_save() {
     
    27563315
    27573316    /**
    2758      * Create the Dashboard meta box for this extension
    2759      *
    2760      * @since BuddyPress (1.7)
     3317     * Create the Dashboard meta box for this extension.
     3318     *
     3319     * @since BuddyPress (1.7.0)
    27613320     */
    27623321    public function _meta_box_display_callback() {
     
    27753334
    27763335
    2777     /** Utilities *************************************************************/
    2778 
    2779     /**
    2780      * Generate the nonce fields for a settings form
     3336    /** Utilities *********************************************************/
     3337
     3338    /**
     3339     * Generate the nonce fields for a settings form.
    27813340     *
    27823341     * The nonce field name (the second param passed to wp_nonce_field)
     
    27863345     * must avoid name clashes.
    27873346     *
    2788      * @since BuddyPress (1.8)
     3347     * @since BuddyPress (1.8.0)
     3348     *
    27893349     * @uses wp_nonce_field()
    2790      * @param string $context 'create', 'edit', 'admin'
     3350     *
     3351     * @param string $context Screen context. 'create', 'edit', or 'admin'.
    27913352     */
    27923353    public function nonce_field( $context = '' ) {
     
    27953356
    27963357    /**
    2797      * Check the nonce on a submitted settings form
    2798      *
    2799      * @since BuddyPress (1.8)
     3358     * Check the nonce on a submitted settings form.
     3359     *
     3360     * @since BuddyPress (1.8.0)
     3361     *
    28003362     * @uses check_admin_referer()
    2801      * @param string $context 'create', 'edit', 'admin'
     3363     *
     3364     * @param string $context Screen context. 'create', 'edit', or 'admin'.
    28023365     */
    28033366    public function check_nonce( $context = '' ) {
     
    28123375     * must also exist and be callable.
    28133376     *
    2814      * @since BuddyPress (1.8)
    2815      * @param string $context 'create', 'edit', 'admin'
    2816      * @return bool
     3377     * @since BuddyPress (1.8.0)
     3378     *
     3379     * @param string $context Screen context. 'create', 'edit', or 'admin'.
     3380     *
     3381     * @return bool True if the screen is enabled, otherwise false.
    28173382     */
    28183383    public function is_screen_enabled( $context = '' ) {
     
    28273392
    28283393    /**
    2829      * Get the appropriate screen callback for the specified context/type
     3394     * Get the appropriate screen callback for the specified context/type.
    28303395     *
    28313396     * BP Group Extensions have three special "screen contexts": create,
     
    28583423     * determine whether your extension has provided a given callback.
    28593424     *
    2860      * @since BuddyPress (1.8)
    2861      * @param string $context 'create', 'edit', 'admin'
    2862      * @param string $type 'screen', 'screen_save'
    2863      * @return mixed A callable function handle
     3425     * @since BuddyPress (1.8.0)
     3426     *
     3427     * @param string $context Screen context. 'create', 'edit', or 'admin'.
     3428     * @param string $type Screen type. 'screen' or 'screen_save'. Default:
     3429     *        'screen'.
     3430     * @return callable A callable function handle.
    28643431     */
    28653432    public function get_screen_callback( $context = '', $type = 'screen' ) {
     
    28853452
    28863453    /**
    2887      * Recursive argument parsing
     3454     * Recursive argument parsing.
    28883455     *
    28893456     * This acts like a multi-dimensional version of wp_parse_args() (minus
     
    29063473     * http://core.trac.wordpress.org/ticket/19888
    29073474     *
    2908      * @since BuddyPress (1.8)
    2909      * @arg array $a
    2910      * @arg array $b
    2911      * @return array
     3475     * @since BuddyPress (1.8.0)
     3476     *
     3477     * @param array $a First set of arguments.
     3478     * @param array $b Second set of arguments.
     3479     * @return array Parsed arguments.
    29123480     */
    29133481    public static function parse_args_r( &$a, $b ) {
     
    29293497    /** Legacy Support ********************************************************/
    29303498
    2931     /**
     3499    /*
    29323500     * In BuddyPress 1.8, the recommended technique for configuring
    29333501     * extensions changed from directly setting various object properties
     
    29393507
    29403508    /**
    2941      * Provide access to otherwise unavailable object properties
     3509     * Provide access to otherwise unavailable object properties.
    29423510     *
    29433511     * This magic method is here for backward compatibility with plugins
     
    29493517     * self::setup_legacy_properties().
    29503518     *
    2951      * @since BuddyPress (1.8)
    2952      * @param string $key
    2953      * @return mixed
     3519     * @since BuddyPress (1.8.0)
     3520     *
     3521     * @param string $key Property name.
     3522     * @return mixed The value if found, otherwise null.
    29543523     */
    29553524    public function __get( $key ) {
     
    29643533
    29653534    /**
    2966      * Provide a fallback for isset( $this->foo ) when foo is unavailable
    2967      *
    2968      * This magit method is here for backward compatibility with plugins
     3535     * Provide a fallback for isset( $this->foo ) when foo is unavailable.
     3536     *
     3537     * This magic method is here for backward compatibility with plugins
    29693538     * that have set their class config options directly in the class
    29703539     * constructor. The parse_legacy_properties() method of the current
     
    29723541     * $this->data array.
    29733542     *
    2974      * @since BuddyPress (1.8)
    2975      * @param string $key
    2976      * @return bool
     3543     * @since BuddyPress (1.8.0)
     3544     *
     3545     * @param string $key Property name.
     3546     * @return bool True if the value is set, otherwise false.
    29773547     */
    29783548    public function __isset( $key ) {
     
    29873557
    29883558    /**
    2989      * Allow plugins to set otherwise unavailable object properties
     3559     * Allow plugins to set otherwise unavailable object properties.
    29903560     *
    29913561     * This magic method is here for backward compatibility with plugins
     
    29943564     * $this->enable_create_step.
    29953565     *
    2996      * @since BuddyPress (1.8)
    2997      * @param string $key
    2998      * @param mixed $value
     3566     * @since BuddyPress (1.8.0)
     3567     *
     3568     * @param string $key Property name.
     3569     * @param mixed $value Property value.
    29993570     */
    30003571    public function __set( $key, $value ) {
     
    30533624
    30543625    /**
    3055      * Returns a list of legacy properties
     3626     * Return a list of legacy properties.
    30563627     *
    30573628     * The legacy implementation of BP_Group_Extension used all of these
    30583629     * object properties for configuration. Some have been moved.
    30593630     *
    3060      * @since BuddyPress (1.8)
    3061      * @return array
     3631     * @since BuddyPress (1.8.0)
     3632     *
     3633     * @return array List of legacy property keys.
    30623634     */
    30633635    protected function get_legacy_property_list() {
     
    30853657
    30863658    /**
    3087      * Parse legacy properties
     3659     * Parse legacy properties.
    30883660     *
    30893661     * The old standard for BP_Group_Extension was for plugins to register
     
    30933665     * parse them into the new init() array.
    30943666     *
    3095      * @since BuddyPress (1.8)
     3667     * @since BuddyPress (1.8.0)
    30963668     */
    30973669    protected function parse_legacy_properties() {
     
    31673739
    31683740    /**
    3169      * Set up legacy properties
     3741     * Set up legacy properties.
    31703742     *
    31713743     * This method is responsible for ensuring that all legacy config
     
    31743746     * their old locations.
    31753747     *
    3176      * @see self::__get()
    3177      *
    3178      * @since BuddyPress (1.8)
     3748     * @since BuddyPress (1.8.0)
     3749     *
     3750     * @see BP_Group_Extension::__get()
    31793751     */
    31803752    protected function setup_legacy_properties() {
     
    32453817}
    32463818
     3819/**
     3820 * Register a new Group Extension.
     3821 *
     3822 * @param string Name of the Extension class.
     3823 * @return bool|null Returns false on failure, otherwise null.
     3824 */
    32473825function bp_register_group_extension( $group_extension_class = '' ) {
    32483826
Note: See TracChangeset for help on using the changeset viewer.