Skip to:
Content

BuddyPress.org

Changeset 9048


Ignore:
Timestamp:
09/27/2014 01:22:43 AM (12 years ago)
Author:
boonebgorges
Message:

Some improved documentation in bp-groups-template.php

See #5022

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-groups/bp-groups-template.php

    r9047 r9048  
    16451645        }
    16461646
     1647/**
     1648 * Output the URL of the Forum page of the current group in the loop.
     1649 */
    16471650function bp_group_forum_permalink() {
    16481651        echo bp_get_group_forum_permalink();
    16491652}
     1653        /**
     1654         * Generate the URL of the Forum page of a group.
     1655         *
     1656         * @param object $group Optional. Group object. Default: current group in loop.
     1657         * @return string
     1658         */
    16501659        function bp_get_group_forum_permalink( $group = false ) {
    16511660                global $groups_template;
     
    16571666        }
    16581667
     1668/**
     1669 * Output the topic count for a group forum.
     1670 *
     1671 * @param array $args See {@link bp_get_group_forum_topic_count()}.
     1672 */
    16591673function bp_group_forum_topic_count( $args = '' ) {
    16601674        echo bp_get_group_forum_topic_count( $args );
    16611675}
     1676        /**
     1677         * Generate the topic count string for a group forum.
     1678         *
     1679         * @param array $args {
     1680         *     Array of arguments.
     1681         *     @type bool $showtext Optional. If true, result will be formatted
     1682         *           as "x topics". If false, just a number will be returned.
     1683         *           Default: false.
     1684         * }
     1685         * @return string|int
     1686         */
    16621687        function bp_get_group_forum_topic_count( $args = '' ) {
    16631688                global $groups_template;
     
    16911716        }
    16921717
     1718/**
     1719 * Output the post count for a group forum.
     1720 *
     1721 * @param array $args See {@link bp_get_group_forum_post_count()}.
     1722 */
    16931723function bp_group_forum_post_count( $args = '' ) {
    16941724        echo bp_get_group_forum_post_count( $args );
    16951725}
     1726        /**
     1727         * Generate the post count string for a group forum.
     1728         *
     1729         * @param array $args {
     1730         *     Array of arguments.
     1731         *     @type bool $showtext Optional. If true, result will be formatted
     1732         *           as "x posts". If false, just a number will be returned.
     1733         *           Default: false.
     1734         * }
     1735         * @return string|int
     1736         */
    16961737        function bp_get_group_forum_post_count( $args = '' ) {
    16971738                global $groups_template;
     
    17251766        }
    17261767
     1768/**
     1769 * Determine whether forums are enabled for a group.
     1770 *
     1771 * @param object $group Optional. Group object. Default: current group in loop.
     1772 * @return bool
     1773 */
    17271774function bp_group_is_forum_enabled( $group = false ) {
    17281775        global $groups_template;
     
    17371784}
    17381785
     1786/**
     1787 * Output the 'checked' attribute for the group forums settings UI.
     1788 *
     1789 * @param object $group Optional. Group object. Default: current group in loop.
     1790 */
    17391791function bp_group_show_forum_setting( $group = false ) {
    17401792        global $groups_template;
     
    17471799}
    17481800
     1801/**
     1802 * Output the 'checked' attribute for a given status in the settings UI.
     1803 *
     1804 * @param string $setting Group status. 'public', 'private', 'hidden'.
     1805 * @param object $group Optional. Group object. Default: current group in loop.
     1806 */
    17491807function bp_group_show_status_setting( $setting, $group = false ) {
    17501808        global $groups_template;
     
    17581816
    17591817/**
    1760  * Get the 'checked' value, if needed, for a given invite_status on the group create/admin screens
     1818 * Output the 'checked' value, if needed, for a given invite_status on the group create/admin screens
    17611819 *
    17621820 * @since BuddyPress (1.5.0)
    17631821 *
    1764  * @param string $setting The setting you want to check against ('members', 'mods', or 'admins')
    1765  * @param BP_Groups_Group $group (optional) The group whose status you want to check
     1822 * @param string $setting The setting you want to check against ('members',
     1823 *        'mods', or 'admins').
     1824 * @param object $group Optional. Group object. Default: current group in loop.
    17661825 */
    17671826function bp_group_show_invite_status_setting( $setting, $group = false ) {
     
    17751834
    17761835/**
    1777  * Get the invite status of a group
    1778  *
    1779  * 'invite_status' became part of BuddyPress in BP 1.5. In order to provide backward compatibility,
    1780  * groups without a status set will default to 'members', ie all members in a group can send
    1781  * invitations. Filter 'bp_group_invite_status_fallback' to change this fallback behavior.
     1836 * Get the invite status of a group.
     1837 *
     1838 * 'invite_status' became part of BuddyPress in BP 1.5. In order to provide
     1839 * backward compatibility with earlier installations, groups without a status
     1840 * set will default to 'members', ie all members in a group can send
     1841 * invitations. Filter 'bp_group_invite_status_fallback' to change this
     1842 * fallback behavior.
    17821843 *
    17831844 * This function can be used either in or out of the loop.
     
    17851846 * @since BuddyPress (1.5.0)
    17861847 *
    1787  * @param int $group_id (optional) The id of the group whose status you want to check
    1788  * @return mixed Returns false when no group can be found. Otherwise returns the group invite
    1789  *    status, from among 'members', 'mods', and 'admins'
     1848 * @param int $group_id Optional. The ID of the group whose status you want to
     1849 *        check. Default: the displayed group, or the current group in the loop.
     1850 * @return bool|string Returns false when no group can be found. Otherwise
     1851 *         returns the group invite status, from among 'members', 'mods', and
     1852 *         'admins'.
    17901853 */
    17911854function bp_group_get_invite_status( $group_id = false ) {
     
    18191882 * @since BuddyPress (1.5.0)
    18201883 *
    1821  * @param int $group_id (optional) The id of the group whose status you want to check
     1884 * @param int $group_id Optional. The ID of the group whose status you want to
     1885 *        check. Default: the ID of the current group.
    18221886 * @return bool $can_send_invites
    18231887 */
     
    19452009}
    19462010
     2011/**
     2012 * Generate the HTML for a list of group moderators.
     2013 *
     2014 * No longer used.
     2015 *
     2016 * @todo Deprecate.
     2017 */
    19472018function bp_group_mod_memberlist( $admin_list = false, $group = false ) {
    19482019        global $groups_template;
     
    20072078}
    20082079
     2080/**
     2081 * Determine whether a group has moderators.
     2082 *
     2083 * @param object $group Optional. Group object. Default: current group in loop.
     2084 * @return array Info about group admins (user_id + date_modified).
     2085 */
    20092086function bp_group_has_moderators( $group = false ) {
    20102087        global $groups_template;
     
    20162093}
    20172094
     2095/**
     2096 * Output a URL for promoting a user to moderator.
     2097 *
     2098 * @param array $args See {@link bp_get_group_member_promote_mod_link()}.
     2099 */
    20182100function bp_group_member_promote_mod_link( $args = '' ) {
    20192101        echo bp_get_group_member_promote_mod_link( $args );
    20202102}
     2103        /**
     2104         * Generate a URL for promoting a user to moderator.
     2105         *
     2106         * @param array $args {
     2107         *     @type int $user_id ID of the member to promote. Default:
     2108         *           current member in a group member loop.
     2109         *     @type object $group Group object. Default: current group.
     2110         * }
     2111         * @return string
     2112         */
    20212113        function bp_get_group_member_promote_mod_link( $args = '' ) {
    20222114                global $members_template, $groups_template;
     
    20332125        }
    20342126
     2127/**
     2128 * Output a URL for promoting a user to admin.
     2129 *
     2130 * @param array $args See {@link bp_get_group_member_promote_admin_link()}.
     2131 */
    20352132function bp_group_member_promote_admin_link( $args = '' ) {
    20362133        echo bp_get_group_member_promote_admin_link( $args );
    20372134}
     2135        /**
     2136         * Generate a URL for promoting a user to admin.
     2137         *
     2138         * @param array $args {
     2139         *     @type int $user_id ID of the member to promote. Default:
     2140         *           current member in a group member loop.
     2141         *     @type object $group Group object. Default: current group.
     2142         * }
     2143         * @return string
     2144         */
    20382145        function bp_get_group_member_promote_admin_link( $args = '' ) {
    20392146                global $members_template, $groups_template;
     
    20502157        }
    20512158
     2159/**
     2160 * Output a URL for demoting a user to member.
     2161 *
     2162 * @param int $user_id ID of the member to demote. Default: current member in
     2163 *        a member loop.
     2164 */
    20522165function bp_group_member_demote_link( $user_id = 0 ) {
    20532166        global $members_template;
     
    20582171        echo bp_get_group_member_demote_link( $user_id );
    20592172}
     2173        /**
     2174         * Generate a URL for demoting a user to member.
     2175         *
     2176         * @param int $user_id ID of the member to demote. Default: current
     2177         *        member in a member loop.
     2178         * @param object $group Optional. Group object. Default: current group.
     2179         * @return string
     2180         */
    20602181        function bp_get_group_member_demote_link( $user_id = 0, $group = false ) {
    20612182                global $members_template, $groups_template;
     
    20702191        }
    20712192
     2193/**
     2194 * Output a URL for banning a member from a group.
     2195 *
     2196 * @param int $user_id ID of the member to ban. Default: current member in
     2197 *        a member loop.
     2198 */
    20722199function bp_group_member_ban_link( $user_id = 0 ) {
    20732200        global $members_template;
     
    20782205        echo bp_get_group_member_ban_link( $user_id );
    20792206}
     2207        /**
     2208         * Generate a URL for banning a member from a group.
     2209         *
     2210         * @param int $user_id ID of the member to ban. Default: current
     2211         *        member in a member loop.
     2212         * @param object $group Optional. Group object. Default: current group.
     2213         * @return string
     2214         */
    20802215        function bp_get_group_member_ban_link( $user_id = 0, $group = false ) {
    20812216                global $groups_template;
     
    20872222        }
    20882223
     2224/**
     2225 * Output a URL for unbanning a member from a group.
     2226 *
     2227 * @param int $user_id ID of the member to unban. Default: current member in
     2228 *        a member loop.
     2229 */
    20892230function bp_group_member_unban_link( $user_id = 0 ) {
    20902231        global $members_template;
     
    20952236        echo bp_get_group_member_unban_link( $user_id );
    20962237}
     2238        /**
     2239         * Generate a URL for unbanning a member from a group.
     2240         *
     2241         * @param int $user_id ID of the member to unban. Default: current
     2242         *        member in a member loop.
     2243         * @param object $group Optional. Group object. Default: current group.
     2244         * @return string
     2245         */
    20972246        function bp_get_group_member_unban_link( $user_id = 0, $group = false ) {
    20982247                global $members_template, $groups_template;
     
    21072256        }
    21082257
    2109 
     2258/**
     2259 * Output a URL for removing a member from a group.
     2260 *
     2261 * @param int $user_id ID of the member to remove. Default: current member in
     2262 *        a member loop.
     2263 */
    21102264function bp_group_member_remove_link( $user_id = 0 ) {
    21112265        global $members_template;
     
    21162270        echo bp_get_group_member_remove_link( $user_id );
    21172271}
     2272        /**
     2273         * Generate a URL for removing a member from a group.
     2274         *
     2275         * @param int $user_id ID of the member to remove. Default: current
     2276         *        member in a member loop.
     2277         * @param object $group Optional. Group object. Default: current group.
     2278         * @return string
     2279         */
    21182280        function bp_get_group_member_remove_link( $user_id = 0, $group = false ) {
    21192281                global $groups_template;
Note: See TracChangeset for help on using the changeset viewer.