Changeset 7648 for trunk/bp-groups/bp-groups-classes.php
- Timestamp:
- 12/05/2013 07:38:20 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-groups/bp-groups-classes.php
r7645 r7648 924 924 } 925 925 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 */ 926 948 public static function get_by_most_forum_topics( $limit = null, $page = null, $user_id = 0, $search_terms = false, $populate_extras = true, $exclude = false ) { 927 949 global $wpdb, $bp, $bbdb; … … 966 988 } 967 989 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 */ 968 1012 public static function get_by_most_forum_posts( $limit = null, $page = null, $search_terms = false, $populate_extras = true, $exclude = false ) { 969 1013 global $wpdb, $bp, $bbdb; … … 1008 1052 } 1009 1053 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 */ 1010 1073 public static function get_by_letter( $letter, $limit = null, $page = null, $populate_extras = true, $exclude = false ) { 1011 1074 global $wpdb, $bp; … … 1052 1115 } 1053 1116 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 */ 1054 1141 public static function get_random( $limit = null, $page = null, $user_id = 0, $search_terms = false, $populate_extras = true, $exclude = false ) { 1055 1142 global $wpdb, $bp; … … 1093 1180 } 1094 1181 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 */ 1095 1199 public static function get_group_extras( &$paged_groups, &$group_ids, $type = false ) { 1096 1200 global $bp, $wpdb; … … 1150 1254 } 1151 1255 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 */ 1152 1264 public static function delete_all_invites( $group_id ) { 1153 1265 global $wpdb, $bp; … … 1156 1268 } 1157 1269 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 */ 1158 1278 public static function get_total_group_count() { 1159 1279 global $wpdb, $bp; … … 1166 1286 } 1167 1287 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 */ 1168 1295 public static function get_global_forum_topic_count( $type ) { 1169 1296 global $bbdb, $wpdb, $bp; … … 1182 1309 } 1183 1310 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 */ 1184 1317 public static function get_total_member_count( $group_id ) { 1185 1318 global $wpdb, $bp; … … 1191 1324 * Get a total count of all topics of a given status, across groups/forums 1192 1325 * 1193 * @ package BuddyPress1194 * @since BuddyPress (1.5)1195 * 1196 * @param string $status 'public', 'private', 'hidden', 'all' Which group types to count1326 * @since BuddyPress (1.5.0) 1327 * 1328 * @param string $status Which group type to count. 'public', 'private', 1329 * 'hidden', or 'all'. Default: 'public'. 1197 1330 * @return int The topic count 1198 1331 */ … … 1234 1367 1235 1368 /** 1236 * Get an array containing ids for each group type 1369 * Get an array containing ids for each group type. 1237 1370 * 1238 1371 * 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) 1242 1375 * 1243 1376 * @return array … … 1258 1391 1259 1392 /** 1260 * Query for the members of a group 1393 * Query for the members of a group. 1261 1394 * 1262 * @since BuddyPress (1.8 )1395 * @since BuddyPress (1.8.0) 1263 1396 */ 1264 1397 class BP_Group_Member_Query extends BP_User_Query { 1265 /** 1266 * Array of group member ids, cached to prevent redundant lookups1267 * 1268 * @var null|array Null if not yet defined, otherwise an array of ints1398 1399 /** 1400 * Array of group member ids, cached to prevent redundant lookups. 1401 * 1269 1402 * @since BuddyPress (1.8.1) 1403 * @var null|array Null if not yet defined, otherwise an array of ints. 1270 1404 */ 1271 1405 protected $group_member_ids; 1272 1406 1273 1407 /** 1274 * Set up action hooks 1275 * 1276 * @since BuddyPress (1.8 )1408 * Set up action hooks. 1409 * 1410 * @since BuddyPress (1.8.0) 1277 1411 */ 1278 1412 public function setup_hooks() { … … 1292 1426 1293 1427 /** 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. 1295 1429 * 1296 1430 * Overrides BP_User_Query::get_include_ids(), adding our additional 1297 1431 * group-member logic. 1298 1432 * 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. 1301 1437 * @return array 1302 1438 */ … … 1329 1465 1330 1466 /** 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. 1335 1472 */ 1336 1473 protected function get_group_member_ids() { … … 1425 1562 1426 1563 /** 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. 1428 1565 * 1429 1566 * This implementation assumes the 'last_modified' sort order 1430 1567 * hardcoded in BP_Group_Member_Query::get_group_member_ids(). 1431 1568 * 1432 * @param object $query BP_User_Query object1569 * @param BP_User_Query $query BP_User_Query object. 1433 1570 */ 1434 1571 public function set_orderby( $query ) { … … 1450 1587 1451 1588 /** 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 * 1455 1598 * @param object $query BP_User_Query object. Because we're filtering 1456 1599 * the current object, we use $this inside of the method instead … … 1478 1621 } 1479 1622 1623 /** 1624 * BuddyPress Group Membership objects. 1625 */ 1480 1626 class BP_Groups_Member { 1627 1628 /** 1629 * ID of the membership. 1630 * 1631 * @access public 1632 * @var int 1633 */ 1481 1634 var $id; 1635 1636 /** 1637 * ID of the group associated with the membership. 1638 * 1639 * @access public 1640 * @var int 1641 */ 1482 1642 var $group_id; 1643 1644 /** 1645 * ID of the user associated with the membership. 1646 * 1647 * @access public 1648 * @var int 1649 */ 1483 1650 var $user_id; 1651 1652 /** 1653 * ID of the user whose invitation initiated the membership. 1654 * 1655 * @access public 1656 * @var int 1657 */ 1484 1658 var $inviter_id; 1659 1660 /** 1661 * Whether the member is an admin of the group. 1662 * 1663 * @access public 1664 * @var int 1665 */ 1485 1666 var $is_admin; 1667 1668 /** 1669 * Whether the member is a mod of the group. 1670 * 1671 * @access public 1672 * @var int 1673 */ 1486 1674 var $is_mod; 1675 1676 /** 1677 * Whether the member is banned from the group. 1678 * 1679 * @access public 1680 * @var int 1681 */ 1487 1682 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 */ 1488 1692 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 */ 1489 1702 var $date_modified; 1703 1704 /** 1705 * Whether the membership has been confirmed. 1706 * 1707 * @access public 1708 * @var int 1709 */ 1490 1710 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 */ 1491 1721 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 */ 1492 1734 var $invite_sent; 1735 1736 /** 1737 * WP_User object representing the membership's user. 1738 * 1739 * @access public 1740 * @var WP_User 1741 */ 1493 1742 var $user; 1494 1743 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 */ 1495 1755 public function __construct( $user_id = 0, $group_id = 0, $id = false, $populate = true ) { 1496 1756 … … 1515 1775 } 1516 1776 1777 /** 1778 * Populate the object's properties. 1779 */ 1517 1780 public function populate() { 1518 1781 global $wpdb, $bp; … … 1544 1807 } 1545 1808 1809 /** 1810 * Save the membership data to the database. 1811 * 1812 * @return bool True on success, false on failure. 1813 */ 1546 1814 public function save() { 1547 1815 global $wpdb, $bp; … … 1588 1856 } 1589 1857 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 */ 1590 1864 public function promote( $status = 'mod' ) { 1591 1865 if ( 'mod' == $status ) { … … 1604 1878 } 1605 1879 1880 /** 1881 * Demote membership to Member status (non-admin, non-mod). 1882 * 1883 * @return bool True on success, false on failure. 1884 */ 1606 1885 public function demote() { 1607 1886 $this->is_mod = 0; … … 1612 1891 } 1613 1892 1893 /** 1894 * Ban the user from the group. 1895 * 1896 * @return bool True on success, false on failure. 1897 */ 1614 1898 public function ban() { 1615 1899 if ( !empty( $this->is_admin ) ) … … 1622 1906 } 1623 1907 1908 /** 1909 * Unban the user from the group. 1910 * 1911 * @return bool True on success, false on failure. 1912 */ 1624 1913 public function unban() { 1625 1914 if ( !empty( $this->is_admin ) ) … … 1631 1920 } 1632 1921 1922 /** 1923 * Mark a pending invitation as accepted. 1924 */ 1633 1925 public function accept_invite() { 1634 1926 $this->inviter_id = 0; … … 1637 1929 } 1638 1930 1931 /** 1932 * Confirm a membership request. 1933 */ 1639 1934 public function accept_request() { 1640 1935 $this->is_confirmed = 1; … … 1642 1937 } 1643 1938 1939 /** 1940 * Remove the current membership. 1941 * 1942 * @return bool True on success, false on failure. 1943 */ 1644 1944 public function remove() { 1645 1945 global $wpdb, $bp; … … 1659 1959 } 1660 1960 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. 1669 1970 */ 1670 1971 public static function refresh_total_group_count_for_user( $user_id ) { … … 1673 1974 1674 1975 /** 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. 1680 1982 */ 1681 1983 public static function refresh_total_member_count_for_group( $group_id ) { … … 1683 1985 } 1684 1986 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 */ 1685 1994 public static function delete( $user_id, $group_id ) { 1686 1995 global $wpdb, $bp; … … 1697 2006 } 1698 2007 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 */ 1699 2021 public static function get_group_ids( $user_id, $limit = false, $page = false ) { 1700 2022 global $wpdb, $bp; … … 1718 2040 } 1719 2041 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 */ 1720 2057 public static function get_recently_joined( $user_id, $limit = false, $page = false, $filter = false ) { 1721 2058 global $wpdb, $bp; … … 1740 2077 } 1741 2078 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 */ 1742 2094 public static function get_is_admin_of( $user_id, $limit = false, $page = false, $filter = false ) { 1743 2095 global $wpdb, $bp; … … 1762 2114 } 1763 2115 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 */ 1764 2131 public static function get_is_mod_of( $user_id, $limit = false, $page = false, $filter = false ) { 1765 2132 global $wpdb, $bp; … … 1784 2151 } 1785 2152 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 */ 1786 2159 public static function total_group_count( $user_id = 0 ) { 1787 2160 global $bp, $wpdb; … … 1797 2170 } 1798 2171 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 */ 1799 2187 public static function get_invites( $user_id, $limit = false, $page = false, $exclude = false ) { 1800 2188 global $wpdb, $bp; … … 1815 2203 } 1816 2204 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 */ 1817 2215 public static function check_has_invite( $user_id, $group_id, $type = 'sent' ) { 1818 2216 global $wpdb, $bp; … … 1829 2227 } 1830 2228 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 */ 1831 2236 public static function delete_invite( $user_id, $group_id ) { 1832 2237 global $wpdb, $bp; … … 1838 2243 } 1839 2244 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 */ 1840 2252 public static function delete_request( $user_id, $group_id ) { 1841 2253 global $wpdb, $bp; … … 1847 2259 } 1848 2260 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 */ 1849 2269 public static function check_is_admin( $user_id, $group_id ) { 1850 2270 global $wpdb, $bp; … … 1856 2276 } 1857 2277 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 */ 1858 2286 public static function check_is_mod( $user_id, $group_id ) { 1859 2287 global $wpdb, $bp; … … 1865 2293 } 1866 2294 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 */ 1867 2303 public static function check_is_member( $user_id, $group_id ) { 1868 2304 global $wpdb, $bp; … … 1874 2310 } 1875 2311 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 */ 1876 2320 public static function check_is_banned( $user_id, $group_id ) { 1877 2321 global $wpdb, $bp; … … 1886 2330 * Is the specified user the creator of the group? 1887 2331 * 1888 * @global object $bp BuddyPress global settings1889 * @global wpdb $wpdb WordPress database object1890 * @param int $user_id1891 * @param int $group_id1892 2332 * @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. 1893 2338 */ 1894 2339 public static function check_is_creator( $user_id, $group_id ) { … … 1901 2346 } 1902 2347 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 */ 1903 2355 public static function check_for_membership_request( $user_id, $group_id ) { 1904 2356 global $wpdb, $bp; … … 1910 2362 } 1911 2363 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 */ 1912 2371 public static function get_random_groups( $user_id = 0, $total_groups = 5 ) { 1913 2372 global $wpdb, $bp; … … 1921 2380 } 1922 2381 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 */ 1923 2388 public static function get_group_member_ids( $group_id ) { 1924 2389 global $bp, $wpdb; … … 1927 2392 } 1928 2393 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 */ 1929 2400 public static function get_group_administrator_ids( $group_id ) { 1930 2401 global $bp, $wpdb; … … 1933 2404 } 1934 2405 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 */ 1935 2412 public static function get_group_moderator_ids( $group_id ) { 1936 2413 global $bp, $wpdb; … … 1939 2416 } 1940 2417 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 */ 1941 2424 public static function get_all_membership_request_user_ids( $group_id ) { 1942 2425 global $bp, $wpdb; … … 1945 2428 } 1946 2429 2430 /** 2431 * Get members of a group. 2432 * 2433 * @deprecated BuddyPress (1.8.0) 2434 */ 1947 2435 public static function get_all_for_group( $group_id, $limit = false, $page = false, $exclude_admins_mods = true, $exclude_banned = true, $exclude = false ) { 1948 2436 global $bp, $wpdb; … … 2004 2492 } 2005 2493 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 */ 2006 2500 public static function delete_all( $group_id ) { 2007 2501 global $wpdb, $bp; … … 2011 2505 2012 2506 /** 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. 2020 2512 */ 2021 2513 public static function delete_all_for_user( $user_id ) { … … 2110 2602 * @package BuddyPress 2111 2603 * @subpackage Groups 2112 * @since BuddyPress (1.1 )2604 * @since BuddyPress (1.1.0) 2113 2605 */ 2114 2606 class BP_Group_Extension { 2115 2607 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 2121 2615 */ 2122 2616 public $screens = array(); 2123 2617 2124 2618 /** 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 2127 2623 */ 2128 2624 public $class_name = ''; 2129 2625 2130 2626 /** 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 2133 2631 */ 2134 2632 public $class_reflection = null; 2135 2633 2136 2634 /** 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 2139 2639 */ 2140 2640 public $params = array(); 2141 2641 2142 2642 /** 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 2145 2647 */ 2146 2648 public $group_id = 0; 2147 2649 2148 2650 /** 2149 * @var string The slug of the current extension 2651 * The slug of the current extension. 2652 * 2653 * @var string 2150 2654 */ 2151 2655 public $slug = ''; 2152 2656 2153 2657 /** 2154 * @var string The translatable name of the current extension 2658 * The translatable name of the current extension. 2659 * 2660 * @var string 2155 2661 */ 2156 2662 public $name = ''; 2157 2663 2158 2664 /** 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 2161 2668 */ 2162 2669 public $visibility = 'public'; 2163 2670 2164 2671 /** 2165 * @var int The numeric position of the main nav item 2672 * The numeric position of the main nav item. 2673 * 2674 * @var int 2166 2675 */ 2167 2676 public $nav_item_position = 81; 2168 2677 2169 2678 /** 2170 * @var bool Whether to show the nav item 2679 * Whether to show the nav item. 2680 * 2681 * @var bool 2171 2682 */ 2172 2683 public $enable_nav_item = true; 2173 2684 2174 2685 /** 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 2176 2689 */ 2177 2690 public $nav_item_name = ''; 2178 2691 2179 2692 /** 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 2182 2698 */ 2183 2699 public $display_hook = 'groups_custom_group_boxes'; 2184 2700 2185 2701 /** 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 2188 2707 */ 2189 2708 public $template_file = 'groups/single/plugins'; 2190 2709 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 2196 2717 */ 2197 2718 protected $initialized = false; 2198 2719 2199 2720 /** 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 2202 2725 */ 2203 2726 protected $legacy_properties = array(); 2204 2727 2205 2728 /** 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 2209 2736 */ 2210 2737 protected $legacy_properties_converted = array(); 2211 2738 2212 2739 /** 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 2215 2744 */ 2216 2745 protected $data = array(); 2217 2746 2218 /** Screen Overrides ************************************************** ****/2219 2220 /* *2747 /** Screen Overrides **************************************************/ 2748 2749 /* 2221 2750 * Screen override methods are how your extension will display content 2222 2751 * and handle form submits. Your extension should only override those … … 2263 2792 * 2264 2793 * @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 * } 2266 2821 */ 2267 2822 public function init( $args = array() ) { … … 2292 2847 2293 2848 /** 2294 * The main setup routine for the extension 2849 * The main setup routine for the extension. 2295 2850 * 2296 2851 * This method contains the primary logic for setting up an extension's … … 2303 2858 * bp_register_group_extension(). 2304 2859 * 2305 * @since BuddyPress (1.1 )2860 * @since BuddyPress (1.1.0) 2306 2861 */ 2307 2862 public function _register() { … … 2341 2896 2342 2897 /** 2343 * Set up some basic info about the Extension 2898 * Set up some basic info about the Extension. 2344 2899 * 2345 2900 * Here we collect the name of the extending class, as well as a … … 2347 2902 * whether your extension overrides certain callback methods. 2348 2903 * 2349 * @since BuddyPress (1.8 )2904 * @since BuddyPress (1.8.0) 2350 2905 */ 2351 2906 protected function setup_class_info() { … … 2360 2915 2361 2916 /** 2362 * Get the current group id2917 * Get the current group ID. 2363 2918 * 2364 2919 * Check for: … … 2367 2922 * - group admin 2368 2923 * 2369 * @since BuddyPress (1.8 )2924 * @since BuddyPress (1.8.0) 2370 2925 */ 2371 2926 public static function get_group_id() { … … 2396 2951 2397 2952 /** 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) 2401 2956 */ 2402 2957 protected function get_default_screens() { … … 2429 2984 2430 2985 /** 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) 2434 2989 */ 2435 2990 protected function setup_screens() { … … 2447 3002 } 2448 3003 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) 2455 3010 */ 2456 3011 protected function setup_display_hooks() { … … 2492 3047 2493 3048 /** 2494 * Hook sthe main display method, and loads the template file3049 * Hook the main display method, and loads the template file 2495 3050 */ 2496 3051 public function _display_hook() { … … 2499 3054 } 2500 3055 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) 2507 3062 */ 2508 3063 protected function setup_create_hooks() { … … 2530 3085 2531 3086 /** 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) 2535 3090 */ 2536 3091 public function maybe_create_screen() { … … 2548 3103 2549 3104 /** 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) 2553 3108 */ 2554 3109 public function maybe_create_screen_save() { … … 2561 3116 } 2562 3117 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) 2569 3124 */ 2570 3125 protected function setup_edit_hooks() { … … 2611 3166 2612 3167 /** 2613 * Call the edit_screen() method 3168 * Call the edit_screen() method. 2614 3169 * 2615 3170 * Previous versions of BP_Group_Extension required plugins to provide … … 2623 3178 * do not auto-add our own button. 2624 3179 * 2625 * @since BuddyPress (1.8 )3180 * @since BuddyPress (1.8.0) 2626 3181 */ 2627 3182 public function call_edit_screen() { … … 2637 3192 2638 3193 /** 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) 2642 3197 */ 2643 3198 public function call_edit_screen_save() { … … 2657 3212 2658 3213 /** 2659 * Load the template that houses the Edit screen 3214 * Load the template that houses the Edit screen. 2660 3215 * 2661 3216 * Separated out into a callback so that it can run after all other … … 2665 3220 * Hooked to 'bp_screens'. 2666 3221 * 3222 * @since BuddyPress (1.8.0) 3223 * @access public So that do_action() has access. Do not call directly. 3224 * 2667 3225 * @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)2670 3226 */ 2671 3227 public function call_edit_screen_template_loader() { … … 2674 3230 2675 3231 /** 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. 2677 3233 * 2678 3234 * There's an inconsistency in the way that the group Edit and Create … … 2683 3239 * if one is not found. 2684 3240 * 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. 2688 3246 */ 2689 3247 protected function maybe_add_submit_button( $screen = '' ) { … … 2703 3261 * Does the given markup have a submit button? 2704 3262 * 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. 2708 3267 */ 2709 3268 public static function has_submit_button( $screen = '' ) { … … 2713 3272 } 2714 3273 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) 2721 3280 */ 2722 3281 protected function setup_admin_hooks() { … … 2736 3295 2737 3296 /** 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) 2741 3300 */ 2742 3301 public function call_admin_screen() { … … 2748 3307 * Check the nonce, and call the admin_screen_save() method 2749 3308 * 2750 * @since BuddyPress (1.8 )3309 * @since BuddyPress (1.8.0) 2751 3310 */ 2752 3311 public function call_admin_screen_save() { … … 2756 3315 2757 3316 /** 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) 2761 3320 */ 2762 3321 public function _meta_box_display_callback() { … … 2775 3334 2776 3335 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. 2781 3340 * 2782 3341 * The nonce field name (the second param passed to wp_nonce_field) … … 2786 3345 * must avoid name clashes. 2787 3346 * 2788 * @since BuddyPress (1.8) 3347 * @since BuddyPress (1.8.0) 3348 * 2789 3349 * @uses wp_nonce_field() 2790 * @param string $context 'create', 'edit', 'admin' 3350 * 3351 * @param string $context Screen context. 'create', 'edit', or 'admin'. 2791 3352 */ 2792 3353 public function nonce_field( $context = '' ) { … … 2795 3356 2796 3357 /** 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 * 2800 3362 * @uses check_admin_referer() 2801 * @param string $context 'create', 'edit', 'admin' 3363 * 3364 * @param string $context Screen context. 'create', 'edit', or 'admin'. 2802 3365 */ 2803 3366 public function check_nonce( $context = '' ) { … … 2812 3375 * must also exist and be callable. 2813 3376 * 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. 2817 3382 */ 2818 3383 public function is_screen_enabled( $context = '' ) { … … 2827 3392 2828 3393 /** 2829 * Get the appropriate screen callback for the specified context/type 3394 * Get the appropriate screen callback for the specified context/type. 2830 3395 * 2831 3396 * BP Group Extensions have three special "screen contexts": create, … … 2858 3423 * determine whether your extension has provided a given callback. 2859 3424 * 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. 2864 3431 */ 2865 3432 public function get_screen_callback( $context = '', $type = 'screen' ) { … … 2885 3452 2886 3453 /** 2887 * Recursive argument parsing 3454 * Recursive argument parsing. 2888 3455 * 2889 3456 * This acts like a multi-dimensional version of wp_parse_args() (minus … … 2906 3473 * http://core.trac.wordpress.org/ticket/19888 2907 3474 * 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. 2912 3480 */ 2913 3481 public static function parse_args_r( &$a, $b ) { … … 2929 3497 /** Legacy Support ********************************************************/ 2930 3498 2931 /* *3499 /* 2932 3500 * In BuddyPress 1.8, the recommended technique for configuring 2933 3501 * extensions changed from directly setting various object properties … … 2939 3507 2940 3508 /** 2941 * Provide access to otherwise unavailable object properties 3509 * Provide access to otherwise unavailable object properties. 2942 3510 * 2943 3511 * This magic method is here for backward compatibility with plugins … … 2949 3517 * self::setup_legacy_properties(). 2950 3518 * 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. 2954 3523 */ 2955 3524 public function __get( $key ) { … … 2964 3533 2965 3534 /** 2966 * Provide a fallback for isset( $this->foo ) when foo is unavailable 2967 * 2968 * This magi tmethod is here for backward compatibility with plugins3535 * Provide a fallback for isset( $this->foo ) when foo is unavailable. 3536 * 3537 * This magic method is here for backward compatibility with plugins 2969 3538 * that have set their class config options directly in the class 2970 3539 * constructor. The parse_legacy_properties() method of the current … … 2972 3541 * $this->data array. 2973 3542 * 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. 2977 3547 */ 2978 3548 public function __isset( $key ) { … … 2987 3557 2988 3558 /** 2989 * Allow plugins to set otherwise unavailable object properties 3559 * Allow plugins to set otherwise unavailable object properties. 2990 3560 * 2991 3561 * This magic method is here for backward compatibility with plugins … … 2994 3564 * $this->enable_create_step. 2995 3565 * 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. 2999 3570 */ 3000 3571 public function __set( $key, $value ) { … … 3053 3624 3054 3625 /** 3055 * Return s a list of legacy properties3626 * Return a list of legacy properties. 3056 3627 * 3057 3628 * The legacy implementation of BP_Group_Extension used all of these 3058 3629 * object properties for configuration. Some have been moved. 3059 3630 * 3060 * @since BuddyPress (1.8) 3061 * @return array 3631 * @since BuddyPress (1.8.0) 3632 * 3633 * @return array List of legacy property keys. 3062 3634 */ 3063 3635 protected function get_legacy_property_list() { … … 3085 3657 3086 3658 /** 3087 * Parse legacy properties 3659 * Parse legacy properties. 3088 3660 * 3089 3661 * The old standard for BP_Group_Extension was for plugins to register … … 3093 3665 * parse them into the new init() array. 3094 3666 * 3095 * @since BuddyPress (1.8 )3667 * @since BuddyPress (1.8.0) 3096 3668 */ 3097 3669 protected function parse_legacy_properties() { … … 3167 3739 3168 3740 /** 3169 * Set up legacy properties 3741 * Set up legacy properties. 3170 3742 * 3171 3743 * This method is responsible for ensuring that all legacy config … … 3174 3746 * their old locations. 3175 3747 * 3176 * @s ee self::__get()3177 * 3178 * @s ince BuddyPress (1.8)3748 * @since BuddyPress (1.8.0) 3749 * 3750 * @see BP_Group_Extension::__get() 3179 3751 */ 3180 3752 protected function setup_legacy_properties() { … … 3245 3817 } 3246 3818 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 */ 3247 3825 function bp_register_group_extension( $group_extension_class = '' ) { 3248 3826
Note: See TracChangeset
for help on using the changeset viewer.