Skip to:
Content

BuddyPress.org

Changeset 9906


Ignore:
Timestamp:
06/02/2015 05:21:07 AM (11 years ago)
Author:
tw2113
Message:

Initial documentation cleanup for the BP Groups component.

See #6401.

Location:
trunk/src/bp-groups
Files:
17 edited

Legend:

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

    r9819 r9906  
    456456 * Sort the group creation steps.
    457457 *
    458  * @return bool|null False on failure.
     458 * @return false|null False on failure.
    459459 */
    460460function groups_action_sort_creation_steps() {
     
    508508 * @since BuddyPress (1.2.0)
    509509 *
    510  * @return bool|null False on failure.
     510 * @return false|null False on failure.
    511511 */
    512512function groups_action_group_feed() {
  • trunk/src/bp-groups/bp-groups-activity.php

    r9819 r9906  
    22
    33/**
    4  * BuddyPress Groups Activity Functions
     4 * BuddyPress Groups Activity Functions.
    55 *
    66 * These functions handle the recording, deleting and formatting of activity
     
    9090 * @since BuddyPress (2.0.0)
    9191 *
    92  * @param string $action Static activity action.
     92 * @param string $action   Static activity action.
    9393 * @param object $activity Activity data object.
     94 *
    9495 * @return string
    9596 */
     
    121122 * @since BuddyPress (2.0.0)
    122123 *
    123  * @param string $action Static activity action.
     124 * @param string $action   Static activity action.
    124125 * @param object $activity Activity data object.
     126 *
    125127 * @return string
    126128 */
     
    165167 * @param  string $action   Static activity action.
    166168 * @param  object $activity Activity data object.
     169 *
    167170 * @return string
    168171 */
     
    219222 *
    220223 * @param array $activities Array of activity items.
     224 *
    221225 * @return array
    222226 */
     
    270274 * @param array $retval Empty array by default
    271275 * @param array $filter Current activity arguments
     276 *
    272277 * @return array
    273278 */
     
    334339 *      return values.
    335340 *
    336  * @param array $args {
     341 * @param array|string $args {
    337342 *     An array of arguments for the new activity item. Accepts all parameters
    338343 *     of {@link bp_activity_add()}. However, this wrapper provides some
    339344 *     additional defaults, as described below:
    340  *     @type string $component Default: the id of your Groups component
    341  *           (usually 'groups').
    342  *     @type bool $hide_sitewide Default: True if the current group is not
    343  *           public, otherwise false.
     345 *     @type string $component     Default: the id of your Groups component
     346 *                                 (usually 'groups').
     347 *     @type bool   $hide_sitewide Default: True if the current group is not
     348 *                                 public, otherwise false.
    344349 * }
    345350 * @return bool See {@link bp_activity_add()}.
     
    386391 *
    387392 * @param int $group_id Optional. The ID of the group whose last_activity is
    388  *        being updated. Default: the current group's ID.
     393 *                      being updated. Default: the current group's ID.
     394 *
    389395 * @return bool|null False on failure.
    390396 */
     
    408414
    409415/**
    410  * Add an activity stream item when a member joins a group
     416 * Add an activity stream item when a member joins a group.
    411417 *
    412418 * @since BuddyPress (1.9.0)
    413419 *
    414  * @param int $user_id ID of the user joining the group.
     420 * @param int $user_id  ID of the user joining the group.
    415421 * @param int $group_id ID of the group.
     422 *
    416423 * @return bool|null False on failure.
    417424 */
     
    455462 * @param  BP_Groups_Group $old_group      Group object before the details had been changed.
    456463 * @param  bool            $notify_members True if the admin has opted to notify group members, otherwise false.
     464 *
    457465 * @return int|bool The ID of the activity on success. False on error.
    458466 */
     
    546554 *
    547555 * @param int $group_id ID of the group.
    548  * @param int $user_id ID of the user leaving the group.
     556 * @param int $user_id  ID of the user leaving the group.
    549557 */
    550558function bp_groups_leave_group_delete_recent_activity( $group_id, $user_id ) {
  • trunk/src/bp-groups/bp-groups-admin.php

    r9819 r9906  
    561561         * @since BuddyPress (1.7.0)
    562562         *
    563          * @param BP_Groups_Group Instance of the current group being edited. Passed by reference.
     563         * @param BP_Groups_Group $this Instance of the current group being edited. Passed by reference.
    564564         */
    565565        do_action_ref_array( 'bp_groups_admin_edit', array( &$group ) ); ?>
     
    688688 * @since BuddyPress (1.7.0)
    689689 *
    690  * @global BP_Group_List_Table $bp_groups_list_table Group screen list table.
     690 * @global BP_Groups_List_Table $bp_groups_list_table Group screen list table.
    691691 * @global string $plugin_page Currently viewed plugin page.
    692692 */
     
    13391339         * @since BuddyPress (1.7.0)
    13401340         *
    1341          * @param object $item The current group item in the loop.
     1341         * @param object|array $item The current group item in the loop.
    13421342         */
    13431343        public function single_row( $item = array() ) {
     
    15851585         * @since BuddyPress (1.7.0)
    15861586         *
    1587          * @param array Information about the current row.
     1587         * @param array $item Information about the current row.
    15881588         */
    15891589        public function column_description( $item = array() ) {
     
    16051605         * @since BuddyPress (1.7.0)
    16061606         *
    1607          * @param array Information about the current row.
     1607         * @param array $item Information about the current row.
    16081608         */
    16091609        public function column_status( $item = array() ) {
     
    16411641         * @since BuddyPress (1.7.0)
    16421642         *
    1643          * @param array Information about the current row.
     1643         * @param array $item Information about the current row.
    16441644         */
    16451645        public function column_members( $item = array() ) {
     
    16621662         * @since BuddyPress (1.7.0)
    16631663         *
    1664          * @param array Information about the current row.
     1664         * @param array $item Information about the current row.
    16651665         */
    16661666        public function column_last_active( $item = array() ) {
     
    16831683         * @since BuddyPress (2.0.0)
    16841684         *
    1685          * @param array Information about the current row.
    1686          * @param string the column name.
     1685         * @param array  $item Information about the current row.
     1686         * @param string $column_name The column name.
    16871687         *
    16881688         * @return string
  • trunk/src/bp-groups/bp-groups-adminbar.php

    r9819 r9906  
    22
    33/**
    4  * BuddyPress Groups Toolbar
     4 * BuddyPress Groups Toolbar.
    55 *
    66 * Handles the groups functions related to the WordPress Toolbar.
     
    2020 * @todo Add dynamic menu items for group extensions.
    2121 *
    22  * @return bool|null False if not on a group page, or if user does not have
    23  *        access to group admin options.
     22 * @return false|null False if not on a group page, or if user does not have
     23 *                    access to group admin options.
    2424 */
    2525function bp_groups_group_admin_menu() {
  • trunk/src/bp-groups/bp-groups-cache.php

    r9819 r9906  
    22
    33/**
    4  * BuddyPress Groups Caching
     4 * BuddyPress Groups Caching.
    55 *
    66 * Caching functions handle the clearing of cached objects and pages on specific
     
    2525 * groupmeta within a loop context.
    2626 *
    27  * @param int|str|array $group_ids Accepts a single group_id, or a
    28  *        comma-separated list or array of group ids.
     27 *
     28 * @param int|string|array|bool $group_ids Accepts a single group_id, or a
     29 *                                         comma-separated list or array of
     30 *                                         group ids.
    2931 */
    3032function bp_groups_update_meta_cache( $group_ids = false ) {
     
    4648 * Clear the cached group count.
    4749 *
    48  * @param $group_id Not used.
     50 * @param int $group_id Not used.
    4951 */
    5052function groups_clear_group_object_cache( $group_id ) {
     
    7678 *
    7779 * @since BuddyPress (2.0.0)
     80 *
     81 * @param int $meta_id
     82 * @param int $group_id
    7883 */
    7984function bp_groups_delete_group_cache_on_metadata_change( $meta_id, $group_id ) {
     
    8893 * @since BuddyPress (1.6.0)
    8994 *
    90  * @param int $group_id ID of the group.
     95 * @param int             $group_id ID of the group.
    9196 * @param BP_Groups_Group $group_obj Group object.
    9297 */
     
    98103
    99104/**
    100  * Clears caches for all members in a group when a group is deleted
     105 * Clears caches for all members in a group when a group is deleted.
    101106 *
    102107 * @since BuddyPress (1.6.0)
    103108 *
    104109 * @param BP_Groups_Group $group_obj Group object.
    105  * @param array User IDs who were in this group.
     110 * @param array           $user_ids  User IDs who were in this group.
    106111 */
    107112function bp_groups_clear_group_members_caches( $group_obj, $user_ids ) {
     
    136141 *
    137142 * @param int $group_id The group ID. Not used in this function.
    138  * @param int $user_id The user ID.
     143 * @param int $user_id  The user ID.
    139144 */
    140145function bp_groups_clear_invite_count_on_uninvite( $group_id, $user_id ) {
     
    148153 * @since BuddyPress (2.0.0)
    149154 *
    150  * @param int $group_id The group ID. Not used in this function.
     155 * @param int   $group_id      The group ID. Not used in this function.
    151156 * @param array $invited_users Array of invited user IDs.
    152157 */
     
    162167 *
    163168 * @param int $group_id The group ID. Not used in this function.
    164  * @param int $user_id The user ID.
     169 * @param int $user_id  The user ID.
    165170 */
    166171function groups_clear_group_user_object_cache( $group_id, $user_id ) {
  • trunk/src/bp-groups/bp-groups-filters.php

    r9819 r9906  
    22
    33/**
    4  * BuddyPress Groups Filters
     4 * BuddyPress Groups Filters.
    55 *
    66 * @package BuddyPress
     
    7373 *
    7474 * @param string $content
     75 *
    7576 * @return string
    7677 */
     
    128129 *
    129130 * @param string $sql
     131 *
    130132 * @return string
    131133 */
     
    139141 *
    140142 * @param string $sql
     143 *
    141144 * @return string
    142145 */
     
    153156 *
    154157 * @param string $sql
     158 *
    155159 * @return string
    156160 */
     
    205209 * @param string $cap
    206210 * @param array $args
     211 *
    207212 * @return bool
    208213 */
     
    245250         * @since BuddyPress (1.5.0)
    246251         *
    247          * @param string $value SQL string to specify fetching just topic_id
     252         * @param string $value SQL string to specify fetching just topic_id.
    248253         */
    249254        return apply_filters( 'groups_filter_bbpress_root_page_sql', 't.topic_id' );
     
    255260 * mentions suggestions?
    256261 *
    257  * @param bool $load_mentions True to load mentions assets, false otherwise.
     262 * @since BuddyPress (2.2.0)
     263 *
     264 * @param bool $load_mentions    True to load mentions assets, false otherwise.
    258265 * @param bool $mentions_enabled True if mentions are enabled.
     266 *
    259267 * @return bool True if mentions scripts should be loaded.
    260  * @since BuddyPress (2.2.0)
    261268 */
    262269function bp_groups_maybe_load_mentions_scripts( $load_mentions, $mentions_enabled ) {
  • trunk/src/bp-groups/bp-groups-forums.php

    r9819 r9906  
    22
    33/**
    4  * BuddyPress Groups Forums
     4 * BuddyPress Groups Forums.
    55 *
    66 * Action functions are exactly the same as screen functions, however they do not
     
    2525 * @since BuddyPress (1.0.0)
    2626 *
    27  * @param int $group_id The group ID that the new forum should be attached to.
     27 * @param int    $group_id  The group ID that the new forum should be attached to.
    2828 * @param string $group_name The group name.
    2929 * @param string $group_desc The group description.
     
    6767 *
    6868 * @param int $group_id Group id, passed from groups_details_updated.
     69 *
     70 * @return mixed
    6971 */
    7072function groups_update_group_forum( $group_id ) {
     
    107109 *
    108110 * @param string $post_text The text for the forum post.
    109  * @param int $topic_id The topic ID used so we can identify where the new
    110  *        forum post should reside.
    111  * @param mixed $page The page number where the new forum post should reside.
    112  *        Default: false.
     111 * @param int    $topic_id  The topic ID used so we can identify where the new
     112 *                          forum post should reside.
     113 * @param mixed  $page      The page number where the new forum post should reside.
     114 *                          Default: false.
     115 *
    113116 * @return mixed The new forum post ID on success. Boolean false on failure.
    114117 */
     
    216219 *
    217220 * @param string $topic_title The title for the forum topic.
    218  * @param string $topic_text The text for the forum topic.
    219  * @param string $topic_tags A comma-delimited string of topic tags.
    220  * @param int $forum_id The forum ID this forum topic resides in.
     221 * @param string $topic_text  The text for the forum topic.
     222 * @param string $topic_tags  A comma-delimited string of topic tags.
     223 * @param int    $forum_id    The forum ID this forum topic resides in.
     224 *
    221225 * @return mixed The new topic object on success. Boolean false on failure.
    222226 */
     
    335339 * @since BuddyPress (1.1.0)
    336340 *
    337  * @param int $topic_id The topic ID of the existing forum topic.
     341 * @param int    $topic_id    The topic ID of the existing forum topic.
    338342 * @param string $topic_title The title for the forum topic.
    339  * @param string $topic_text The text for the forum topic.
    340  * @param mixed $topic_tags A comma-delimited string of topic tags. Optional.
     343 * @param string $topic_text  The text for the forum topic.
     344 * @param mixed  $topic_tags  A comma-delimited string of topic tags. Optional.
     345 *
    341346 * @return mixed The topic object on success. Boolean false on failure.
    342347 */
     
    413418 * @since BuddyPress (1.1.0)
    414419 *
    415  * @param int $post_id The post ID of the existing forum post.
     420 * @param int    $post_id  The post ID of the existing forum post.
    416421 * @param string $post_text The text for the forum post.
    417  * @param int $topic_id The topic ID of the existing forum topic.
    418  * @param mixed $page The page number where the new forum post should reside.
    419  *        Optional.
     422 * @param int    $topic_id The topic ID of the existing forum topic.
     423 * @param mixed  $page      The page number where the new forum post should reside. Optional.
     424 *
    420425 * @return mixed The forum post ID on success. Boolean false on failure.
    421426 */
     
    503508 *
    504509 * @param int $topic_id The ID of the topic to be deleted.
     510 *
    505511 * @return bool True if the delete routine went through properly.
    506512 */
     
    565571 * @since BuddyPress (1.1.0)
    566572 *
    567  * @param int $post_id The ID of the post you want to delete.
    568  * @param int $topic_id Optional. The topic to which the post belongs. This
    569  *        value isn't used in the function but is passed along to do_action()
    570  *        hooks.
     573 * @param int      $post_id  The ID of the post you want to delete.
     574 * @param int|bool $topic_id Optional. The topic to which the post belongs. This
     575 *                           value isn't used in the function but is passed along
     576 *                           to do_action() hooks.
     577 *
    571578 * @return bool True on success.
    572579 */
     
    617624 *
    618625 * @param string $type Either 'newest', 'popular', 'unreplied', 'tags'.
    619  *        Default: 'newest'.
     626 *                     Default: 'newest'.
     627 *
    620628 * @return int The topic count.
    621629 */
     
    637645 * @since BuddyPress (1.5.0)
    638646 *
    639  * @param string $status Which groups to count. 'public', 'private', 'hidden',
    640  *        'all'. Default: 'public'.
    641  * @param string $search_terms Optional. Limit by a search term.
     647 * @param string      $status       Which groups to count. 'public', 'private', 'hidden',
     648 *                                  'all'. Default: 'public'.
     649 * @param string|bool $search_terms Optional. Limit by a search term.
     650 *
    642651 * @return int The topic count.
    643652 */
  • trunk/src/bp-groups/bp-groups-functions.php

    r9819 r9906  
    3636 * support and pass through the groups_get_group filter.
    3737 *
    38  * @param array $args {
     38 * @param array|string $args {
    3939 *      Array of al arguments.
    4040 *      @type int $group_id ID of the group.
     
    7474 * @since BuddyPress (1.0.0)
    7575 *
    76  * @param array $args {
     76 * @param array|string $args {
    7777 *     An array of arguments.
    7878 *     @type int|bool $group_id Pass a group ID to update an existing item, or
     
    258258 * @param bool $enable_forum Whether to enable a forum for the group.
    259259 * @param string $status Group status. 'public', 'private', 'hidden'.
    260  * @param string $invite_status Optional. Who is allowed to send invitations
     260 * @param string|bool $invite_status Optional. Who is allowed to send invitations
    261261 *        to the group. 'members', 'mods', or 'admins'.
    262262 * @return bool True on success, false on failure.
     
    363363 *
    364364 * @param string $slug Group slug to check.
    365  * @return A unique and sanitized slug.
     365 * @return string $slug A unique and sanitized slug.
    366366 */
    367367function groups_check_slug( $slug ) {
     
    656656 * Get a collection of groups, based on the parameters passed.
    657657 *
    658  * @param array $args {
     658 * @param array|string $args {
    659659 *     Array of arguments. Supports all arguments of
    660660 *     {@link BP_Groups_Group::get()}. Where the default values differ, they
     
    735735 *
    736736 * @param int $user_id ID of the user.
    737  * @param int $limit Optional. Max number of results to return.
     737 * @param int $pag_num Optional. Max number of results to return.
    738738 *        Default: false (no limit).
    739  * @param int $page Optional. Page offset of results to return.
     739 * @param int $pag_page Optional. Page offset of results to return.
    740740 *        Default: false (no limit).
    741741 * @return array {
     
    844844 * @param int $group_id ID of the group.
    845845 * @param int|null ID of the membership if the user is an admin, otherwise null.
     846 *
     847 * @return bool
    846848 */
    847849function groups_is_user_admin( $user_id, $group_id ) {
     
    855857 * @param int $group_id ID of the group.
    856858 * @param int|null ID of the membership if the user is a mod, otherwise null.
     859 *
     860 * @return bool
    857861 */
    858862function groups_is_user_mod( $user_id, $group_id ) {
     
    866870 * @param int $group_id ID of the group.
    867871 * @param int|null ID of the membership if the user is a member, otherwise null.
     872 *
     873 * @return bool
    868874 */
    869875function groups_is_user_member( $user_id, $group_id ) {
     
    895901 * @todo Should bail out when the Activity component is not active.
    896902 *
    897  * @param array {
     903 * @param array|string $args {
    898904 *     Array of arguments.
    899905 *     @type string $content The content of the update.
     
    982988 *
    983989 * @param int $user_id ID of the inviting user.
    984  * @param int $group_id ID of the group.
     990 * @param int|bool $limit Limit to restrict to.
     991 * @param int|bool $page
     992 * @param string|array|bool $exclude
     993 *
    985994 * @return array IDs of users who have been invited to the group by the
    986995 *         user but have not yet accepted.
     
    10131022 * Invite a user to a group.
    10141023 *
    1015  * @param array $args {
     1024 * @param array|string $args {
    10161025 *     Array of arguments.
    10171026 *     @type int $user_id ID of the user being invited.
     
    16271636 *
    16281637 * @param int $group_id ID of the group.
    1629  * @param string $meta_key The key of the row to delete.
    1630  * @param string $meta_value Optional. Metadata value. If specified, only delete
     1638 * @param string|bool $meta_key The key of the row to delete.
     1639 * @param string|bool $meta_value Optional. Metadata value. If specified, only delete
    16311640 *        metadata entries with this value.
    16321641 * @param bool $delete_all Optional. If true, delete matching metadata entries
  • trunk/src/bp-groups/bp-groups-loader.php

    r9828 r9906  
    22
    33/**
    4  * BuddyPress Groups Loader
     4 * BuddyPress Groups Loader.
    55 *
    66 * A groups component, for users to group themselves together. Includes a
     
    1818
    1919        /**
    20          * Auto-join group when non group member performs group activity
     20         * Auto-join group when non group member performs group activity.
    2121         *
    2222         * @since BuddyPress (1.5.0)
     
    387387         * @see BP_Component::setup_nav() for a description of arguments.
    388388         *
    389          * @param array $main_nav Optional. See BP_Component::setup_nav() for
    390          *        description.
    391          * @param array $sub_nav Optional. See BP_Component::setup_nav() for
    392          *        description.
     389         * @param array $main_nav Optional. See BP_Component::setup_nav() for description.
     390         * @param array $sub_nav  Optional. See BP_Component::setup_nav() for description.
    393391         */
    394392        public function setup_nav( $main_nav = array(), $sub_nav = array() ) {
     
    630628         *      parameter array.
    631629         *
    632          * @param array $wp_admin_nav See BP_Component::setup_admin_bar() for a
    633          *        description.
     630         * @param array $wp_admin_nav See BP_Component::setup_admin_bar() for a description.
    634631         */
    635632        public function setup_admin_bar( $wp_admin_nav = array() ) {
  • trunk/src/bp-groups/bp-groups-notifications.php

    r9819 r9906  
    22
    33/**
    4  * BuddyPress Groups Notification Functions
     4 * BuddyPress Groups Notification Functions.
    55 *
    66 * These functions handle the recording, deleting and formatting of notifications
     
    2121 * @since BuddyPress (1.0.0)
    2222 *
    23  * @param int $group_id ID of the group.
    24  * @param BP_Groups_Group $old_group Group before new details were saved.
     23 * @param int                  $group_id ID of the group.
     24 * @param BP_Groups_Group|null $old_group Group before new details were saved.
    2525 */
    2626function groups_notification_group_updated( $group_id = 0, $old_group = null ) {
     
    148148 *
    149149 * @param int $requesting_user_id ID of the user requesting group membership.
    150  * @param int $admin_id ID of the group admin.
    151  * @param int $group_id ID of the group.
    152  * @param int $membership_id ID of the group membership object.
    153  * @return bool|null False on failure.
     150 * @param int $admin_id           ID of the group admin.
     151 * @param int $group_id           ID of the group.
     152 * @param int $membership_id      ID of the group membership object.
     153 *
     154 * @return false|null False on failure.
    154155 */
    155156function groups_notification_new_membership_request( $requesting_user_id = 0, $admin_id = 0, $group_id = 0, $membership_id = 0 ) {
     
    285286 * @since BuddyPress (1.0.0)
    286287 *
    287  * @param int $requesting_user_id ID of the user requesting group membership.
    288  * @param int $group_id ID of the group.
    289  * @param bool $accepted Optional. Whether the membership request was accepted.
    290  *        Default: true.
    291  * @return boolean
     288 * @param int  $requesting_user_id ID of the user requesting group membership.
     289 * @param int  $group_id           ID of the group.
     290 * @param bool $accepted           Optional. Whether the membership request was accepted.
     291 *                                 Default: true.
     292 *
     293 * @return false|null
    292294 */
    293295function groups_notification_membership_request_completed( $requesting_user_id = 0, $group_id = 0, $accepted = true ) {
     
    401403 * @since BuddyPress (1.0.0)
    402404 *
    403  * @param int $user_id ID of the user.
     405 * @param int $user_id  ID of the user.
    404406 * @param int $group_id ID of the group.
    405  * @return bool|null False on failure.
     407 *
     408 * @return false|null False on failure.
    406409 */
    407410function groups_notification_promoted_member( $user_id = 0, $group_id = 0 ) {
     
    506509 * @since BuddyPress (1.0.0)
    507510 *
    508  * @param BP_Groups_Group $group Group object.
    509  * @param BP_Groups_Member $member Member object.
    510  * @param int $inviter_user_id ID of the user who sent the invite.
    511  * @return bool|null False on failure.
     511 * @param BP_Groups_Group  $group           Group object.
     512 * @param BP_Groups_Member $member          Member object.
     513 * @param int              $inviter_user_id ID of the user who sent the invite.
     514 *
     515 * @return null|false False on failure.
    512516 */
    513517function groups_notification_group_invites( &$group, &$member, $inviter_user_id ) {
     
    624628 * @since BuddyPress (1.0.0)
    625629 *
    626  * @param string $action The kind of notification being rendered.
    627  * @param int $item_id The primary item ID.
    628  * @param int $secondary_item_id The secondary item ID.
    629  * @param int $total_items The total number of messaging-related notifications
    630  *        waiting for the user.
    631  * @param string $format 'string' for BuddyBar-compatible notifications; 'array'
    632  *        for WP Toolbar. Default: 'string'.
     630 * @param string $action            The kind of notification being rendered.
     631 * @param int    $item_id           The primary item ID.
     632 * @param int    $secondary_item_id The secondary item ID.
     633 * @param int    $total_items       The total number of messaging-related notifications
     634 *                                  waiting for the user.
     635 * @param string $format            'string' for BuddyBar-compatible notifications; 'array'
     636 *                                  for WP Toolbar. Default: 'string'.
     637 *
    633638 * @return string
    634639 */
     
    11991204 * @since BuddyPress (2.0.0)
    12001205 *
    1201  * @param int $user_id ID of the user.
     1206 * @param int $user_id  ID of the user.
    12021207 * @param int $group_id ID of the group.
    12031208 */
     
    12151220 * @since BuddyPress (1.9.0)
    12161221 *
    1217  * @param int $user_id ID of the user.
     1222 * @param int $user_id  ID of the user.
    12181223 * @param int $group_id ID of the group.
    12191224 */
  • trunk/src/bp-groups/bp-groups-screens.php

    r9828 r9906  
    15111511         *
    15121512         * @param string $templates The templates from bp_get_theme_compat_templates().
     1513         *
    15131514         * @return array $templates Array of custom templates to look for.
    15141515         */
  • trunk/src/bp-groups/bp-groups-template.php

    r9885 r9906  
    3636
    3737/**
    38  * Output the groups component root slug
     38 * Output the groups component root slug.
    3939 *
    4040 * @since BuddyPress (1.5.0)
     
    6363
    6464/**
    65  * Output group directory permalink
     65 * Output group directory permalink.
    6666 *
    6767 * @since BuddyPress (1.5.0)
     
    7171}
    7272        /**
    73          * Return group directory permalink
     73         * Return group directory permalink.
    7474         *
    7575         * @since BuddyPress (1.5.0)
     
    140140         *
    141141         * @access public
    142          * @var public
     142         * @var string
    143143         */
    144144        public $pag_page;
     
    148148         *
    149149         * @access public
    150          * @var public
     150         * @var string
    151151         */
    152152        public $pag_num;
     
    466466 * @since BuddyPress (1.0.0)
    467467 *
    468  * @param array $args {
     468 * @param array|string $args {
    469469 *     Array of parameters. All items are optional.
    470  *     @type string $type Shorthand for certain orderby/
    471  *           order combinations. 'newest', 'active', 'popular',
    472  *           'alphabetical', 'random'. When present, will override
    473  *           orderby and order params. Default: null.
    474  *     @type string $orderby Property to sort by.
    475  *           'date_created', 'last_activity', 'total_member_count',
    476  *           'name', 'random'. Default: 'date_created'.
    477  *     @type string $order Sort order. 'ASC' or 'DESC'.
    478  *           Default: 'DESC'.
    479  *     @type int $per_page Number of items to return per page
    480  *           of results. Default: null (no limit).
    481  *     @type int $page Page offset of results to return.
    482  *           Default: null (no limit).
    483  *     @type int $user_id If provided, results will be limited
    484  *           to groups of which the specified user is a member. Default:
    485  *           null.
    486  *     @type string $search_terms If provided, only groups
    487  *           whose names or descriptions match the search terms will be
    488  *           returned. Default: false.
    489  *     @type array $meta_query An array of meta_query
    490  *           conditions. See {@link WP_Meta_Query::queries} for
    491  *           description.
    492  *     @type array|string $include Array or comma-separated list of
    493  *           group IDs. Results will be limited to groups within the
    494  *           list. Default: false.
    495  *     @type bool $populate_extras Whether to fetch additional
    496  *           information (such as member count) about groups. Default:
    497  *           true.
    498  *     @type array|string $exclude Array or comma-separated list of
    499  *           group IDs. Results will exclude the listed groups.
    500  *           Default: false.
    501  *     @type bool $show_hidden Whether to include hidden groups in
    502  *           results. Default: false.
     470 *     @type string       $type            Shorthand for certain orderby/
     471 *                                         order combinations. 'newest',
     472 *                                         'active', 'popular', 'alphabetical',
     473 *                                         'random'. When present, will override
     474 *                                         orderby and order params. Default: null.
     475 *     @type string       $orderby         Property to sort by.
     476 *                                         'date_created', 'last_activity', 'total_member_count',
     477 *                                         'name', 'random'. Default: 'date_created'.
     478 *     @type string       $order           Sort order. 'ASC' or 'DESC'.
     479 *                                         Default: 'DESC'.
     480 *     @type int          $per_page        Number of items to return per page
     481 *                                         of results. Default: null (no limit).
     482 *     @type int          $page            Page offset of results to return.
     483 *                                         Default: null (no limit).
     484 *     @type int          $user_id         If provided, results will be limited
     485 *                                         to groups of which the specified user
     486 *                                         is a member. Default: null.
     487 *     @type string       $search_terms    If provided, only groups whose names or descriptions
     488 *                                         match the search terms will be returned. Default: false.
     489 *     @type array        $meta_query      An array of meta_query conditions.
     490 *                                         See {@link WP_Meta_Query::queries} for description.
     491 *     @type array|string $include         Array or comma-separated list of
     492 *                                         group IDs. Results will be limited
     493 *                                         to groups within the list. Default: false.
     494 *     @type bool         $populate_extras Whether to fetch additional information
     495 *                                         (such as member count) about groups.
     496 *                                         Default: true.
     497 *     @type array|string $exclude         Array or comma-separated list of group IDs.
     498 *                                         Results will exclude the listed groups.
     499 *                                         Default: false.
     500 *     @type bool         $show_hidden     Whether to include hidden groups in
     501 *                                         results. Default: false.
    503502 * }
    504503 * @return bool True if there are groups to display that match the params
     
    614613 * Is the group visible to the currently logged-in user?
    615614 *
    616  * @param object $group Optional. Group object. Default: current group in loop.
     615 * @param object|bool $group Optional. Group object. Default: current group in loop.
     616 *
    617617 * @return bool
    618618 */
     
    640640 * Output the ID of the current group in the loop.
    641641 *
    642  * @param object $group Optional. Group object. Default: current group in loop.
     642 * @param object|bool $group Optional. Group object. Default: current group in loop.
    643643 */
    644644function bp_group_id( $group = false ) {
     
    648648         * Get the ID of the current group in the loop.
    649649         *
    650          * @param object $group Optional. Group object. Default: current
    651          *        group in loop.
     650         * @param object|bool $group Optional. Group object.
     651         *                           Default: current group in loop.
     652         *
    652653         * @return int
    653654         */
     
    673674 * @since BuddyPress (1.7.0)
    674675 *
    675  * @param array $classes Array of custom classes
     676 * @param array $classes Array of custom classes.
    676677 */
    677678function bp_group_class( $classes = array() ) {
     
    683684         * @since BuddyPress (1.7.0)
    684685         *
    685          * @param array $classes Array of custom classes
     686         * @param array $classes Array of custom classes.
    686687         *
    687688         * @return string Row class of the group.
     
    746747 * Output the name of the current group in the loop.
    747748 *
    748  * @param object $group Optional. Group object. Default: current
    749  *        group in loop.
     749 * @param object|bool $group Optional. Group object.
     750 *                           Default: current group in loop.
    750751 */
    751752function bp_group_name( $group = false ) {
     
    755756         * Get the name of the current group in the loop.
    756757         *
    757          * @param object $group Optional. Group object. Default: current
    758          *        group in loop.
     758         * @param object|bool $group Optional. Group object.
     759         *                           Default: current group in loop.
     760         *
    759761         * @return string
    760762         */
     
    778780 * Output the type of the current group in the loop.
    779781 *
    780  * @param object $group Optional. Group object. Default: current
    781  *        group in loop.
     782 * @param object|bool $group Optional. Group object.
     783 *                           Default: current group in loop.
    782784 */
    783785function bp_group_type( $group = false ) {
    784786        echo bp_get_group_type( $group );
    785787}
    786         /**
    787          * Get the type of the current group in the loop.
    788          *
    789          * @param object $group Optional. Group object. Default: current
    790          *        group in loop.
     788
     789/**
     790 * Get the type of the current group in the loop.
     791 *
     792 * @param object|bool $group Optional. Group object.
     793 *                           Default: current group in loop.
     794 *
     795 * @return string
     796 */
     797function bp_get_group_type( $group = false ) {
     798        global $groups_template;
     799
     800        if ( empty( $group ) )
     801                $group =& $groups_template->group;
     802
     803        if ( 'public' == $group->status ) {
     804                $type = __( "Public Group", "buddypress" );
     805        } elseif ( 'hidden' == $group->status ) {
     806                $type = __( "Hidden Group", "buddypress" );
     807        } elseif ( 'private' == $group->status ) {
     808                $type = __( "Private Group", "buddypress" );
     809        } else {
     810                $type = ucwords( $group->status ) . ' ' . __( 'Group', 'buddypress' );
     811        }
     812
     813        /**
     814         * Filters the type for the current group in the loop.
     815         *
     816         * @since BuddyPress (1.0.0)
     817         *
     818         * @param string $type Type for the current group in the loop.
     819         */
     820        return apply_filters( 'bp_get_group_type', $type );
     821}
     822/**
     823 * Output the status of the current group in the loop.
     824 *
     825 * @param object|bool $group Optional. Group object.
     826 *                           Default: current group in loop.
     827 */
     828function bp_group_status( $group = false ) {
     829        echo bp_get_group_status( $group );
     830}
     831        /**
     832         * Get the status of the current group in the loop.
     833         *
     834         * @param object|bool $group Optional. Group object.
     835         *                           Default: current group in loop.
     836         *
    791837         * @return string
    792838         */
    793         function bp_get_group_type( $group = false ) {
     839        function bp_get_group_status( $group = false ) {
    794840                global $groups_template;
    795841
     
    797843                        $group =& $groups_template->group;
    798844
    799                 if ( 'public' == $group->status ) {
    800                         $type = __( "Public Group", "buddypress" );
    801                 } elseif ( 'hidden' == $group->status ) {
    802                         $type = __( "Hidden Group", "buddypress" );
    803                 } elseif ( 'private' == $group->status ) {
    804                         $type = __( "Private Group", "buddypress" );
    805                 } else {
    806                         $type = ucwords( $group->status ) . ' ' . __( 'Group', 'buddypress' );
    807                 }
    808 
    809                 /**
    810                  * Filters the type for the current group in the loop.
     845                /**
     846                 * Filters the status of the current group in the loop.
    811847                 *
    812848                 * @since BuddyPress (1.0.0)
    813849                 *
    814                  * @param string $type Type for the current group in the loop.
    815                  */
    816                 return apply_filters( 'bp_get_group_type', $type );
    817         }
    818 
    819 /**
    820  * Output the status of the current group in the loop.
    821  *
    822  * @param object $group Optional. Group object. Default: current
    823  *        group in loop.
    824  */
    825 function bp_group_status( $group = false ) {
    826         echo bp_get_group_status( $group );
    827 }
    828         /**
    829          * Get the status of the current group in the loop.
    830          *
    831          * @param object $group Optional. Group object. Default: current
    832          *        group in loop.
    833          * @return string
    834          */
    835         function bp_get_group_status( $group = false ) {
    836                 global $groups_template;
    837 
    838                 if ( empty( $group ) )
    839                         $group =& $groups_template->group;
    840 
    841                 /**
    842                  * Filters the status of the current group in the loop.
    843                  *
    844                  * @since BuddyPress (1.0.0)
    845                  *
    846850                 * @param string $status Status of the current group in the loop.
    847851                 */
     
    854858 * @since BuddyPress (1.0.0)
    855859 *
    856  * @param array $args {
     860 * @param array|string $args {
    857861 *      See {@link bp_get_group_avatar()} for description of arguments.
    858862 * }
     
    866870         * @since BuddyPress (1.0.0)
    867871         *
    868          * @param array $args {
     872         * @param array|string $args {
    869873         *     Array of arguments. See {@link bp_core_fetch_avatar()} for
    870874         *     detailed description. Default values that differ from that
    871875         *     function are described below.
     876         *
    872877         *     @type string $type Default: 'full'.
    873          *     @type string $id Passed to $css_id parameter.
     878         *     @type string $id   Passed to $css_id parameter.
    874879         * }
    875880         * @return string
     
    928933 * @since BuddyPress (1.0.0)
    929934 *
    930  * @param object $group Optional. Group object. Default: current
    931  *        group in loop.
     935 * @param object|bool $group Optional. Group object.
     936 *                           Default: current group in loop.
    932937 */
    933938function bp_group_avatar_thumb( $group = false ) {
     
    939944         * @since BuddyPress (1.0.0)
    940945         *
    941          * @param object $group Optional. Group object. Default: current
    942          *        group in loop.
     946         * @param object|bool $group Optional. Group object.
     947         *                           Default: current group in loop.
     948         *
    943949         * @return string
    944950         */
     
    955961 * @since BuddyPress (1.0.0)
    956962 *
    957  * @param object $group Optional. Group object. Default: current
    958  *        group in loop.
     963 * @param object|bool $group Optional. Group object.
     964 *                           Default: current group in loop.
    959965 */
    960966function bp_group_avatar_mini( $group = false ) {
     
    966972         * @since BuddyPress (1.0.0)
    967973         *
    968          * @param object $group Optional. Group object. Default: current
    969          *        group in loop.
     974         * @param object|bool $group Optional. Group object.
     975         *                           Default: current group in loop.
     976         *
     977         * @return string
    970978         */
    971979        function bp_get_group_avatar_mini( $group = false ) {
     
    981989 * Output the 'last active' string for the current group in the loop.
    982990 *
    983  * @param object $group Optional. Group object. Default: current
    984  *        group in loop.
     991 * @param object|bool $group Optional. Group object.
     992 *                           Default: current group in loop.
    985993 */
    986994function bp_group_last_active( $group = false ) {
     
    990998         * Return the 'last active' string for the current group in the loop.
    991999         *
    992          * @param object $group Optional. Group object. Default: current
    993          *        group in loop.
     1000         * @param object|bool $group Optional. Group object.
     1001         *                           Default: current group in loop.
     1002         *
    9941003         * @return string
    9951004         */
     
    10231032 * Output the permalink for the current group in the loop.
    10241033 *
    1025  * @param object $group Optional. Group object. Default: current
    1026  *        group in loop.
     1034 * @param object|bool $group Optional. Group object.
     1035 *                           Default: current group in loop.
    10271036 */
    10281037function bp_group_permalink( $group = false ) {
     
    10321041         * Return the permalink for the current group in the loop.
    10331042         *
    1034          * @param object $group Optional. Group object. Default: current
    1035          *        group in loop.
     1043         * @param object|bool $group Optional. Group object.
     1044         *                           Default: current group in loop.
     1045         *
    10361046         * @return string
    10371047         */
     
    10561066 * Output the permalink for the admin section of the current group in the loop.
    10571067 *
    1058  * @param object $group Optional. Group object. Default: current
    1059  *        group in loop.
     1068 * @param object|bool $group Optional. Group object.
     1069 *                           Default: current group in loop.
    10601070 */
    10611071function bp_group_admin_permalink( $group = false ) {
     
    10651075         * Return the permalink for the admin section of the current group in the loop.
    10661076         *
    1067          * @param object $group Optional. Group object. Default: current
    1068          *        group in loop.
     1077         * @param object|bool $group Optional. Group object.
     1078         *                           Default: current group in loop.
     1079         *
    10691080         * @return string
    10701081         */
     
    10881099 * Return the slug for the current group in the loop.
    10891100 *
    1090  * @param object $group Optional. Group object. Default: current
    1091  *        group in loop.
     1101 * @param object|bool $group Optional. Group object.
     1102 *                           Default: current group in loop.
    10921103 */
    10931104function bp_group_slug( $group = false ) {
     
    10971108         * Return the slug for the current group in the loop.
    10981109         *
    1099          * @param object $group Optional. Group object. Default: current
    1100          *        group in loop.
     1110         * @param object|bool $group Optional. Group object.
     1111         *                           Default: current group in loop.
     1112         *
    11011113         * @return string
    11021114         */
     
    11201132 * Output the description for the current group in the loop.
    11211133 *
    1122  * @param object $group Optional. Group object. Default: current
    1123  *        group in loop.
     1134 * @param object|bool $group Optional. Group object.
     1135 *                           Default: current group in loop.
    11241136 */
    11251137function bp_group_description( $group = false ) {
     
    11291141         * Return the description for the current group in the loop.
    11301142         *
    1131          * @param object $group Optional. Group object. Default: current
    1132          *        group in loop.
     1143         * @param object|bool $group Optional. Group object.
     1144         *                           Default: current group in loop.
     1145         *
    11331146         * @return string
    11341147         */
     
    11521165 * Output the description for the current group in the loop, for use in a textarea.
    11531166 *
    1154  * @param object $group Optional. Group object. Default: current
    1155  *        group in loop.
     1167 * @param object|bool $group Optional. Group object.
     1168 *                           Default: current group in loop.
    11561169 */
    11571170function bp_group_description_editable( $group = false ) {
     
    11651178         * appropriate for "raw" editing.
    11661179         *
    1167          * @param object $group Optional. Group object. Default: current
    1168          *        group in loop.
     1180         * @param object|bool $group Optional. Group object.
     1181         *                           Default: current group in loop.
     1182         *
    11691183         * @return string
    11701184         */
     
    11921206 * Output an excerpt of the group description.
    11931207 *
    1194  * @param object $group Optional. The group being referenced. Defaults to the
    1195  *        group currently being iterated on in the groups loop.
     1208 * @param object|bool $group Optional. The group being referenced.
     1209 *                           Defaults to the group currently being
     1210 *                           iterated on in the groups loop.
    11961211 */
    11971212function bp_group_description_excerpt( $group = false ) {
     
    12011216         * Get an excerpt of a group description.
    12021217         *
    1203          * @param object $group Optional. The group being referenced. Defaults
    1204          *        to the group currently being iterated on in the groups loop.
     1218         * @param object|bool $group Optional. The group being referenced.
     1219         *                           Defaults to the group currently being
     1220         *                           iterated on in the groups loop.
     1221         *
    12051222         * @return string Excerpt.
    12061223         */
     
    12281245 * Either 'Public' or 'Private'.
    12291246 *
    1230  * @param object $group Optional. Group object. Default: current
    1231  *        group in loop.
     1247 * @param object|bool $group Optional. Group object.
     1248 *                           Default: current group in loop.
    12321249 */
    12331250function bp_group_public_status( $group = false ) {
     
    12391256         * Either 'Public' or 'Private'.
    12401257         *
    1241          * @param object $group Optional. Group object. Default: current
    1242          *        group in loop.
     1258         * @param object|bool $group Optional. Group object.
     1259         *                           Default: current group in loop.
     1260         *
    12431261         * @return string
    12441262         */
     
    12611279 * No longer used in BuddyPress.
    12621280 *
    1263  * @param object $group Optional. Group object. Default: current
    1264  *        group in loop.
     1281 * @param object|bool $group Optional. Group object.
     1282 *                           Default: current group in loop.
    12651283 */
    12661284function bp_group_is_public( $group = false ) {
     
    12721290         * No longer used in BuddyPress.
    12731291         *
    1274          * @param object $group Optional. Group object. Default: current
    1275          *        group in loop.
     1292         * @param object|bool $group Optional. Group object.
     1293         *                           Default: current group in loop.
     1294         *
    12761295         * @return unknown
    12771296         */
     
    12881307 * Output the created date of the current group in the loop.
    12891308 *
    1290  * @param object $group Optional. Group object. Default: current
    1291  *        group in loop.
     1309 * @param object|bool $group Optional. Group object.
     1310 *                           Default: current group in loop.
    12921311 */
    12931312function bp_group_date_created( $group = false ) {
     
    12971316         * Return the created date of the current group in the loop.
    12981317         *
    1299          * @param object $group Optional. Group object. Default: current
    1300          *        group in loop.
     1318         * @param object|bool $group Optional. Group object.
     1319         *                           Default: current group in loop.
     1320         *
    13011321         * @return string
    13021322         */
     
    13201340 * Output the username of the creator of the current group in the loop.
    13211341 *
    1322  * @param object $group Optional. Group object. Default: current
    1323  *        group in loop.
     1342 * @param object|bool $group Optional. Group object.
     1343 *                           Default: current group in loop.
    13241344 */
    13251345function bp_group_creator_username( $group = false ) {
     
    13291349         * Return the username of the creator of the current group in the loop.
    13301350         *
    1331          * @param object $group Optional. Group object. Default: current
    1332          *        group in loop.
     1351         * @param object|bool $group Optional. Group object.
     1352         *                           Default: current group in loop.
     1353         *
    13331354         * @return string
    13341355         */
     
    13521373 * Output the user ID of the creator of the current group in the loop.
    13531374 *
    1354  * @param object $group Optional. Group object. Default: current
    1355  *        group in loop.
     1375 * @param object|bool $group Optional. Group object.
     1376 *                           Default: current group in loop.
    13561377 */
    13571378function bp_group_creator_id( $group = false ) {
     
    13611382         * Return the user ID of the creator of the current group in the loop.
    13621383         *
    1363          * @param object $group Optional. Group object. Default: current
    1364          *        group in loop.
     1384         * @param object|bool $group Optional. Group object.
     1385         *                           Default: current group in loop.
     1386         *
    13651387         * @return int
    13661388         */
     
    13841406 * Output the permalink of the creator of the current group in the loop.
    13851407 *
    1386  * @param object $group Optional. Group object. Default: current
    1387  *        group in loop.
     1408 * @param object|bool $group Optional. Group object.
     1409 *                           Default: current group in loop.
    13881410 */
    13891411function bp_group_creator_permalink( $group = false ) {
     
    13931415         * Return the permalink of the creator of the current group in the loop.
    13941416         *
    1395          * @param object $group Optional. Group object. Default: current
    1396          *        group in loop.
     1417         * @param object|bool $group Optional. Group object.
     1418         *                           Default: current group in loop.
     1419         *
    13971420         * @return string
    13981421         */
     
    14161439 * Determine whether a user is the creator of the current group in the loop.
    14171440 *
    1418  * @param object $group Optional. Group object. Default: current
    1419  *        group in loop.
    1420  * @param int $user_id ID of the user.
     1441 * @param object|bool $group   Optional. Group object.
     1442 *                             Default: current group in loop.
     1443 * @param int         $user_id ID of the user.
     1444 *
    14211445 * @return bool
    14221446 */
     
    14361460 * Output the avatar of the creator of the current group in the loop.
    14371461 *
    1438  * @param object $group Optional. Group object. Default: current
    1439  *        group in loop.
    1440  * @param array $args {
     1462 * @param object|bool $group Optional. Group object.
     1463 *                           Default: current group in loop.
     1464 * @param array       $args {
    14411465 *     Array of optional arguments. See {@link bp_get_group_creator_avatar()}
    14421466 *     for description.
     
    14491473         * Return the avatar of the creator of the current group in the loop.
    14501474         *
    1451          * @param object $group Optional. Group object. Default: current
    1452          *        group in loop.
    1453          * @param array $args {
     1475         * @param object|bool $group Optional. Group object.
     1476         *                           Default: current group in loop.
     1477         * @param array       $args {
    14541478         *     Array of optional arguments. See {@link bp_core_fetch_avatar()}
    14551479         *     for detailed description of arguments.
    1456          *     @type string $type Default: 'full'.
    1457          *     @type int $width Default: false.
    1458          *     @type int $height Default: false.
    1459          *     @type int $class Default: 'avatar'.
    1460          *     @type string $id Passed to 'css_id'. Default: false.
    1461          *     @type string $alt Alt text. Default: 'Group creator profile
    1462          *           photo of [user display name]'.
     1480         *     @type string $type   Default: 'full'.
     1481         *     @type int    $width Default: false.
     1482         *     @type int    $height Default: false.
     1483         *     @type int    $class Default: 'avatar'.
     1484         *     @type string $id     Passed to 'css_id'. Default: false.
     1485         *     @type string $alt    Alt text. Default: 'Group creator profile
     1486         *                          photo of [user display name]'.
    14631487         * }
    14641488         * @return string
     
    15191543 * Output markup listing group admins.
    15201544 *
    1521  * @param object $group Optional. Group object. Default: current
    1522  *        group in loop.
     1545 * @param object|bool $group Optional. Group object.
     1546 *                           Default: current group in loop.
    15231547 */
    15241548function bp_group_list_admins( $group = false ) {
     
    15591583 * Output markup listing group mod.
    15601584 *
    1561  * @param object $group Optional. Group object. Default: current
    1562  *        group in loop.
     1585 * @param object|bool $group Optional. Group object.
     1586 *                           Default: current group in loop.
    15631587 */
    15641588function bp_group_list_mods( $group = false ) {
     
    16091633 * @since BuddyPress (1.5.0)
    16101634 *
    1611  * @param BP_Groups_Group $group Optional. The group being queried. Defaults
    1612  *        to the current group in the loop.
    1613  * @param string $format Optional. 'string' to get a comma-separated string,
    1614  *        'array' to get an array.
    1615  * @return mixed $admin_ids A string or array of user IDs.
     1635 * @param BP_Groups_Group|bool $group    Optional. The group being queried. Defaults
     1636 *                                        to the current group in the loop.
     1637 * @param string               $format    Optional. 'string' to get a comma-separated string,
     1638 *                                        'array' to get an array.
     1639 * @return mixed               $admin_ids A string or array of user IDs.
    16161640 */
    16171641function bp_group_admin_ids( $group = false, $format = 'string' ) {
     
    16491673 * @since BuddyPress (1.5.0)
    16501674 *
    1651  * @param BP_Groups_Group $group Optional. The group being queried. Defaults
    1652  *        to the current group in the loop.
    1653  * @param string $format Optional. 'string' to get a comma-separated string,
    1654  *        'array' to get an array.
    1655  * @return mixed $mod_ids A string or array of user IDs.
     1675 * @param BP_Groups_Group|bool $group   Optional. The group being queried.
     1676 *                                      Defaults to the current group in the loop.
     1677 * @param string               $format Optional. 'string' to get a comma-separated string,
     1678 *                                      'array' to get an array.
     1679 * @return mixed               $mod_ids A string or array of user IDs.
    16561680 */
    16571681function bp_group_mod_ids( $group = false, $format = 'string' ) {
     
    16931717         * Return the permalink of the Members page of the current group in the loop.
    16941718         *
    1695          * @param object $group Optional. Group object. Default: current
    1696          *        group in loop.
     1719         * @param object|bool $group Optional. Group object.
     1720         *                           Default: current group in loop.
     1721         *
    16971722         * @return string
    16981723         */
     
    18541879 * Output the total member count for a group.
    18551880 *
    1856  * @param object $group Optional. Group object. Default: current group in loop.
     1881 * @param object|bool $group Optional. Group object. Default: current group in loop.
    18571882 */
    18581883function bp_group_total_members( $group = false ) {
     
    18621887         * Get the total member count for a group.
    18631888         *
    1864          * @param object $group Optional. Group object. Default: current group in loop.
     1889         * @param object|bool $group Optional. Group object.
     1890         *                           Default: current group in loop.
     1891         *
    18651892         * @return int
    18661893         */
     
    18831910/**
    18841911 * Output the "x members" count string for a group.
    1885  *
    1886  * @param object $group Optional. Group object. Default: current group in loop.
    18871912 */
    18881913function bp_group_member_count() {
     
    18921917         * Generate the "x members" count string for a group.
    18931918         *
    1894          * @param object $group Optional. Group object. Default: current group in loop.
    18951919         * @return string
    18961920         */
     
    19251949         * Generate the URL of the Forum page of a group.
    19261950         *
    1927          * @param object $group Optional. Group object. Default: current group in loop.
     1951         * @param object|bool $group Optional. Group object.
     1952         *                           Default: current group in loop.
     1953         *
    19281954         * @return string
    19291955         */
     
    19471973 * Output the topic count for a group forum.
    19481974 *
    1949  * @param array $args See {@link bp_get_group_forum_topic_count()}.
     1975 * @param array|string $args See {@link bp_get_group_forum_topic_count()}.
    19501976 */
    19511977function bp_group_forum_topic_count( $args = '' ) {
     
    19551981         * Generate the topic count string for a group forum.
    19561982         *
    1957          * @param array $args {
     1983         * @param array|string $args {
    19581984         *     Array of arguments.
    1959          *     @type bool $showtext Optional. If true, result will be formatted
    1960          *           as "x topics". If false, just a number will be returned.
    1961          *           Default: false.
     1985         *     @type bool $showtext Optional. If true, result will be formatted as "x topics".
     1986         *                         If false, just a number will be returned.
     1987         *                          Default: false.
    19621988         * }
    19631989         * @return string|int
     
    20052031 * Output the post count for a group forum.
    20062032 *
    2007  * @param array $args See {@link bp_get_group_forum_post_count()}.
     2033 * @param array|string $args See {@link bp_get_group_forum_post_count()}.
    20082034 */
    20092035function bp_group_forum_post_count( $args = '' ) {
     
    20132039         * Generate the post count string for a group forum.
    20142040         *
    2015          * @param array $args {
     2041         * @param array|string $args {
    20162042         *     Array of arguments.
    2017          *     @type bool $showtext Optional. If true, result will be formatted
    2018          *           as "x posts". If false, just a number will be returned.
    2019          *           Default: false.
     2043         *     @type bool $showtext Optional. If true, result will be formatted as "x posts".
     2044         *                         If false, just a number will be returned.
     2045         *                          Default: false.
    20202046         * }
    20212047         * @return string|int
     
    20632089 * Determine whether forums are enabled for a group.
    20642090 *
    2065  * @param object $group Optional. Group object. Default: current group in loop.
     2091 * @param object|bool $group Optional. Group object. Default: current group in loop.
     2092 *
    20662093 * @return bool
    20672094 */
     
    20812108 * Output the 'checked' attribute for the group forums settings UI.
    20822109 *
    2083  * @param object $group Optional. Group object. Default: current group in loop.
     2110 * @param object|bool $group Optional. Group object. Default: current group in loop.
    20842111 */
    20852112function bp_group_show_forum_setting( $group = false ) {
     
    20962123 * Output the 'checked' attribute for a given status in the settings UI.
    20972124 *
    2098  * @param string $setting Group status. 'public', 'private', 'hidden'.
    2099  * @param object $group Optional. Group object. Default: current group in loop.
     2125 * @param string      $setting Group status. 'public', 'private', 'hidden'.
     2126 * @param object|bool $group  Optional. Group object. Default: current group in loop.
    21002127 */
    21012128function bp_group_show_status_setting( $setting, $group = false ) {
     
    21142141 * @since BuddyPress (1.5.0)
    21152142 *
    2116  * @param string $setting The setting you want to check against ('members',
    2117  *        'mods', or 'admins').
    2118  * @param object $group Optional. Group object. Default: current group in loop.
     2143 * @param string      $setting The setting you want to check against ('members',
     2144 *                                 'mods', or 'admins').
     2145 * @param object|bool $group  Optional. Group object. Default: current group in loop.
    21192146 */
    21202147function bp_group_show_invite_status_setting( $setting, $group = false ) {
     
    21402167 * @since BuddyPress (1.5.0)
    21412168 *
    2142  * @param int $group_id Optional. The ID of the group whose status you want to
    2143  *        check. Default: the displayed group, or the current group in the loop.
     2169 * @param int|bool $group_id Optional. The ID of the group whose status you want to
     2170 *                           check. Default: the displayed group, or the current group
     2171 *                           in the loop.
     2172 *
    21442173 * @return bool|string Returns false when no group can be found. Otherwise
    2145  *         returns the group invite status, from among 'members', 'mods', and
    2146  *         'admins'.
     2174 *                     returns the group invite status, from among 'members',
     2175 *                     'mods', and 'admins'.
    21472176 */
    21482177function bp_group_get_invite_status( $group_id = false ) {
     
    22582287 * @since BuddyPress (1.0.0)
    22592288 * @todo Remove in 1.4
     2289 *
     2290 * @param bool $admin_list
     2291 * @param bool $group
    22602292 */
    22612293function bp_group_admin_memberlist( $admin_list = false, $group = false ) {
     
    23332365 *
    23342366 * @todo Deprecate.
     2367 *
     2368 * @param bool $admin_list
     2369 * @param bool $group
    23352370 */
    23362371function bp_group_mod_memberlist( $admin_list = false, $group = false ) {
     
    23992434 * Determine whether a group has moderators.
    24002435 *
    2401  * @param object $group Optional. Group object. Default: current group in loop.
     2436 * @param object|bool $group Optional. Group object. Default: current group in loop.
     2437 *
    24022438 * @return array Info about group admins (user_id + date_modified).
    24032439 */
     
    24212457 * Output a URL for promoting a user to moderator.
    24222458 *
    2423  * @param array $args See {@link bp_get_group_member_promote_mod_link()}.
     2459 * @param array|string $args See {@link bp_get_group_member_promote_mod_link()}.
    24242460 */
    24252461function bp_group_member_promote_mod_link( $args = '' ) {
     
    24292465         * Generate a URL for promoting a user to moderator.
    24302466         *
    2431          * @param array $args {
    2432          *     @type int $user_id ID of the member to promote. Default:
    2433          *           current member in a group member loop.
    2434          *     @type object $group Group object. Default: current group.
     2467         * @param array|string $args {
     2468         *     @type int    $user_id ID of the member to promote. Default:
     2469         *                           current member in a group member loop.
     2470         *     @type object $group   Group object. Default: current group.
    24352471         * }
    24362472         * @return string
     
    24602496 * Output a URL for promoting a user to admin.
    24612497 *
    2462  * @param array $args See {@link bp_get_group_member_promote_admin_link()}.
     2498 * @param array|string $args See {@link bp_get_group_member_promote_admin_link()}.
    24632499 */
    24642500function bp_group_member_promote_admin_link( $args = '' ) {
     
    24682504         * Generate a URL for promoting a user to admin.
    24692505         *
    2470          * @param array $args {
    2471          *     @type int $user_id ID of the member to promote. Default:
    2472          *           current member in a group member loop.
    2473          *     @type object $group Group object. Default: current group.
     2506         * @param array|string $args {
     2507         *     @type int    $user_id ID of the member to promote. Default:
     2508         *                           current member in a group member loop.
     2509         *     @type object $group   Group object. Default: current group.
    24742510         * }
    24752511         * @return string
     
    25002536 *
    25012537 * @param int $user_id ID of the member to demote. Default: current member in
    2502  *        a member loop.
     2538 *                     a member loop.
    25032539 */
    25042540function bp_group_member_demote_link( $user_id = 0 ) {
     
    25132549         * Generate a URL for demoting a user to member.
    25142550         *
    2515          * @param int $user_id ID of the member to demote. Default: current
    2516          *        member in a member loop.
    2517          * @param object $group Optional. Group object. Default: current group.
     2551         * @param int         $user_id ID of the member to demote. Default: current
     2552         *                             member in a member loop.
     2553         * @param object|bool $group   Optional. Group object. Default: current group.
     2554         *
    25182555         * @return string
    25192556         */
     
    25402577 * Output a URL for banning a member from a group.
    25412578 *
    2542  * @param int $user_id ID of the member to ban. Default: current member in
    2543  *        a member loop.
     2579 * @param int $user_id ID of the member to ban.
     2580 *                     Default: current member in a member loop.
    25442581 */
    25452582function bp_group_member_ban_link( $user_id = 0 ) {
     
    25542591         * Generate a URL for banning a member from a group.
    25552592         *
    2556          * @param int $user_id ID of the member to ban. Default: current
    2557          *        member in a member loop.
    2558          * @param object $group Optional. Group object. Default: current group.
     2593         * @param int         $user_id ID of the member to ban.
     2594         *                             Default: current member in a member loop.
     2595         * @param object|bool $group   Optional. Group object. Default: current group.
     2596         *
    25592597         * @return string
    25602598         */
     
    25782616 * Output a URL for unbanning a member from a group.
    25792617 *
    2580  * @param int $user_id ID of the member to unban. Default: current member in
    2581  *        a member loop.
     2618 * @param int $user_id ID of the member to unban.
     2619 *                     Default: current member in a member loop.
    25822620 */
    25832621function bp_group_member_unban_link( $user_id = 0 ) {
     
    25922630         * Generate a URL for unbanning a member from a group.
    25932631         *
    2594          * @param int $user_id ID of the member to unban. Default: current
    2595          *        member in a member loop.
    2596          * @param object $group Optional. Group object. Default: current group.
     2632         * @param int         $user_id ID of the member to unban.
     2633         *                             Default: current member in a member loop.
     2634         * @param object|bool $group   Optional. Group object. Default: current group.
     2635         *
    25972636         * @return string
    25982637         */
     
    26192658 * Output a URL for removing a member from a group.
    26202659 *
    2621  * @param int $user_id ID of the member to remove. Default: current member in
    2622  *        a member loop.
     2660 * @param int $user_id ID of the member to remove.
     2661 *                     Default: current member in a member loop.
    26232662 */
    26242663function bp_group_member_remove_link( $user_id = 0 ) {
     
    26332672         * Generate a URL for removing a member from a group.
    26342673         *
    2635          * @param int $user_id ID of the member to remove. Default: current
    2636          *        member in a member loop.
    2637          * @param object $group Optional. Group object. Default: current group.
     2674         * @param int         $user_id ID of the member to remove.
     2675         *                             Default: current member in a member loop.
     2676         * @param object|bool $group   Optional. Group object. Default: current group.
     2677         *
    26382678         * @return string
    26392679         */
     
    26572697 * HTML admin subnav items for group pages.
    26582698 *
    2659  * @param object $group Optional. Group object. Default: current group in
    2660  *        the loop.
     2699 * @param object|bool $group Optional. Group object.
     2700 *                           Default: current group in the loop.
    26612701 */
    26622702function bp_group_admin_tabs( $group = false ) {
     
    26822722/**
    26832723 * BackCompat for plugins/themes directly hooking groups_admin_tabs
    2684  * without using the Groups Extension API
    2685  *
    2686  * @param  string $subnav_output subnav item output
    2687  * @param  string $subnav_item   subnav item params
    2688  * @param  string $selected_item current selected tab
     2724 * without using the Groups Extension API.
     2725 *
     2726 * @param  string $subnav_output Subnav item output.
     2727 * @param  string $subnav_item   subnav item params.
     2728 * @param  string $selected_item Surrent selected tab.
     2729 *
    26892730 * @return string HTML output
    26902731 */
     
    27452786         * Generate the 'action' attribute for a group form.
    27462787         *
    2747          * @param string $page Page slug.
    2748          * @param object $group Optional. Group object. Default: current group
    2749          *        in the loop.
     2788         * @param string      $page  Page slug.
     2789         * @param object|bool $group Optional. Group object.
     2790         *                           Default: current group in the loop.
     2791         *
    27502792         * @return string
    27512793         */
     
    27692811 * Output the 'action' attribute for a group admin form.
    27702812 *
    2771  * @param string $page Optional. Page slug.
     2813 * @param string|bool $page Optional. Page slug.
    27722814 */
    27732815function bp_group_admin_form_action( $page = false ) {
     
    27772819         * Generate the 'action' attribute for a group admin form.
    27782820         *
    2779          * @param string $page Optional. Page slug.
    2780          * @param object $group Optional. Group object. Default: current group
    2781          *        in the loop.
     2821         * @param string|bool $page  Optional. Page slug.
     2822         * @param object|bool $group Optional. Group object.
     2823         *                           Default: current group in the loop.
     2824         *
    27822825         * @return string
    27832826         */
     
    28042847 * Determine whether the logged-in user has requested membership to a group.
    28052848 *
    2806  * @param object $group Optional. Group object. Default: current group in
    2807  *        the loop.
     2849 * @param object|bool $group Optional. Group object.
     2850 *                           Default: current group in the loop.
     2851 *
    28082852 * @return bool
    28092853 */
     
    28252869 * @global object $groups_template
    28262870 *
    2827  * @param object $group Optional. Group to check is_member. Default: current
    2828  *        group in the loop.
     2871 * @param object|bool $group Optional. Group to check is_member.
     2872 *                           Default: current group in the loop.
     2873 *
    28292874 * @return bool If user is member of group or not.
    28302875 */
     
    28522897 * Check whether the current user has an outstanding invite to the current group in the loop.
    28532898 *
    2854  * @param object $group Optional. Group data object. Default: the current
    2855  *        group in the groups loop.
     2899 * @param object|bool $group Optional. Group data object.
     2900 *                           Default: the current group in the groups loop.
     2901 *
    28562902 * @return bool True if the user has an outstanding invite, otherwise false.
    28572903 */
     
    28882934 * @since BuddyPress (1.5.0)
    28892935 *
    2890  * @global BP_Groups_Template $groups_template Group template loop object
    2891  * @param BP_Groups_Group $group Group to check if user is banned
    2892  * @param int $user_id The user ID to check
     2936 * @global BP_Groups_Template $groups_template Group template loop object.
     2937 *
     2938 * @param BP_Groups_Group|bool $group   Group to check if user is banned.
     2939 * @param int                  $user_id The user ID to check.
     2940 *
    28932941 * @return bool True if user is banned.  False if user isn't banned.
    28942942 */
     
    29432991         * Generate the URL for accepting an invitation to a group.
    29442992         *
    2945          * @param object $group Optional. Group object. Default: Current group
    2946          *        in the loop.
     2993         * @param object|bool $group Optional. Group object.
     2994         *                           Default: Current group in the loop.
     2995         *
    29472996         * @return string
    29482997         */
     
    29743023         * Generate the URL for rejecting an invitation to a group.
    29753024         *
    2976          * @param object $group Optional. Group object. Default: Current group
    2977          *        in the loop.
     3025         * @param object|bool $group Optional. Group object.
     3026         *                           Default: Current group in the loop.
     3027         *
    29783028         * @return string
    29793029         */
     
    30053055         * Generate the URL for confirming a request to leave a group.
    30063056         *
    3007          * @param object $group Optional. Group object. Default: Current group
    3008          *        in the loop.
     3057         * @param object|bool $group Optional. Group object.
     3058         *                           Default: Current group in the loop.
     3059         *
    30093060         * @return string
    30103061         */
     
    30343085         * Generate the URL for rejecting a request to leave a group.
    30353086         *
    3036          * @param object $group Optional. Group object. Default: Current group
    3037          *        in the loop.
     3087         * @param object|bool $group Optional. Group object.
     3088         *                           Default: Current group in the loop.
     3089         *
    30383090         * @return string
    30393091         */
     
    30633115         * Output the 'action' attribute for a group send invite form.
    30643116         *
    3065          * @param object $page Optional. Group object. Default: current group
    3066          *        in the loop.
     3117         * @param object|bool $group Optional. Group object.
     3118         *                           Default: current group in the loop.
     3119         *
    30673120         * @return string
    30683121         */
     
    30863139 * Determine whether the current user has friends to invite to a group.
    30873140 *
    3088  * @param object $group Optional. Group object. Default: current group in
    3089  *        the loop.
     3141 * @param object|bool $group Optional. Group object.
     3142 *                           Default: current group in the loop.
     3143 *
    30903144 * @return bool
    30913145 */
     
    31113165 *
    31123166 * @param BP_Groups_Group|bool $group The BP Groups_Group object if passed,
    3113  *        boolean false if not passed.
     3167 *                                    boolean false if not passed.
    31143168 */
    31153169function bp_group_new_topic_button( $group = false ) {
    31163170        echo bp_get_group_new_topic_button( $group );
    31173171}
     3172
    31183173        /**
    31193174         * Returns a 'New Topic' button for a group.
     
    31223177         *
    31233178         * @param BP_Groups_Group|bool $group The BP Groups_Group object if
    3124          *        passed, boolean false if not passed.
     3179         *                                    passed, boolean false if not passed.
     3180         *
    31253181         * @return string HTML code for the button.
    31263182         */
     
    31583214
    31593215/**
    3160  * Output button to join a group
     3216 * Output button to join a group.
    31613217 *
    31623218 * @since BuddyPress (1.0.0)
    31633219 *
    3164  * @param object $group Single group object
     3220 * @param object|bool $group Single group object.
    31653221 */
    31663222function bp_group_join_button( $group = false ) {
     
    31683224}
    31693225        /**
    3170          * Return button to join a group
     3226         * Return button to join a group.
    31713227         *
    31723228         * @since BuddyPress (1.0.0)
    31733229         *
    3174          * @param object $group Single group object
     3230         * @param object|bool $group Single group object.
     3231         *
     3232         * @return mixed
    31753233         */
    31763234        function bp_get_group_join_button( $group = false ) {
     
    33913449 * @since BuddyPress (2.2.0)
    33923450 *
    3393  * @uses   bp_group_create_nav_item() to output the create a Group nav item
     3451 * @uses   bp_group_create_nav_item() to output the create a Group nav item.
    33943452 * @return string HTML Output
    33953453 */
     
    34153473 * @since BuddyPress (1.0.0)
    34163474 *
    3417  * @global BP_Groups_Template $groups_template Groups template object
     3475 * @global BP_Groups_Template $groups_template Groups template object.
    34183476 * @param object $group Group to get status message for. Optional; defaults to current group.
    34193477 */
     
    34953553
    34963554/**
    3497  * Output the total number of groups
     3555 * Output the total number of groups.
    34983556 *
    34993557 * @since BuddyPress (1.0.0)
     
    35033561}
    35043562        /**
    3505          * Return the total number of groups
     3563         * Return the total number of groups.
    35063564         *
    35073565         * @since BuddyPress (1.0.0)
     
    35213579
    35223580/**
    3523  * Output the total number of groups a user belongs to
     3581 * Output the total number of groups a user belongs to.
    35243582 *
    35253583 * @since BuddyPress (1.0.0)
    35263584 *
    3527  * @param int $user_id User ID to get group membership count
     3585 * @param int $user_id User ID to get group membership count.
    35283586 */
    35293587function bp_total_group_count_for_user( $user_id = 0 ) {
     
    35313589}
    35323590        /**
    3533          * Return the total number of groups a user belongs to
     3591         * Return the total number of groups a user belongs to.
    35343592         *
    35353593         * Filtered by `bp_core_number_format()` by default
     
    35373595         * @since BuddyPress (1.0.0)
    35383596         *
    3539          * @param int $user_id User ID to get group membership count
     3597         * @param int $user_id User ID to get group membership count.
     3598         *
     3599         * @return int
    35403600         */
    35413601        function bp_get_total_group_count_for_user( $user_id = 0 ) {
     
    35733633         * @param array $args {
    35743634         *     An array of optional arguments.
    3575          *     @type int $group_id ID of the group whose members are being
    3576          *           queried. Default: current group ID.
    3577          *     @type int $page Page of results to be queried. Default: 1.
    3578          *     @type int $per_page Number of items to return per page of
    3579          *           results. Default: 20.
    3580          *     @type int $max Optional. Max number of items to return.
    3581          *     @type array $exclude Optional. Array of user IDs to exclude.
    3582          *     @type bool|int True (or 1) to exclude admins and mods from
    3583          *           results. Default: 1.
    3584          *     @type bool|int True (or 1) to exclude banned users from results.
    3585          *           Default: 1.
    3586          *     @type array $group_role Optional. Array of group roles to include.
    3587          *     @type string $search_terms Optional. Search terms to match.
     3635         *     @type int      $group_id          ID of the group whose members are being
     3636         *                                            queried. Default: current group ID.
     3637         *     @type int      $page              Page of results to be queried. Default: 1.
     3638         *     @type int      $per_page          Number of items to return per page of
     3639         *                                        results. Default: 20.
     3640         *     @type int      $max                Optional. Max number of items to return.
     3641         *     @type array    $exclude            Optional. Array of user IDs to exclude.
     3642         *     @type bool|int $exclude_admin_mods True (or 1) to exclude admins and mods from
     3643         *                                        results. Default: 1.
     3644         *     @type bool|int $exclude_banned     True (or 1) to exclude banned users from results.
     3645         *                                        Default: 1.
     3646         *     @type array    $group_role        Optional. Array of group roles to include.
     3647         *     @type string   $search_terms      Optional. Search terms to match.
    35883648         * }
    35893649         */
     
    37453805 * Initialize a group member query loop.
    37463806 *
    3747  * @param array $args {
     3807 * @param array|string $args {
    37483808 *     An array of optional arguments.
    3749  *     @type int $group_id ID of the group whose members are being queried.
    3750  *           Default: current group ID.
    3751  *     @type int $page Page of results to be queried. Default: 1.
    3752  *     @type int $per_page Number of items to return per page of results.
    3753  *           Default: 20.
    3754  *     @type int $max Optional. Max number of items to return.
    3755  *     @type array $exclude Optional. Array of user IDs to exclude.
    3756  *     @type bool|int True (or 1) to exclude admins and mods from results.
    3757  *           Default: 1.
    3758  *     @type bool|int True (or 1) to exclude banned users from results.
    3759  *           Default: 1.
    3760  *     @type array $group_role Optional. Array of group roles to include.
    3761  *     @type string $type Optional. Sort order of results. 'last_joined',
    3762  *           'first_joined', or any of the $type params available in
    3763  *           {@link BP_User_Query}. Default: 'last_joined'.
    3764  *     @type string $search_terms Optional. Search terms to match. Pass an
    3765  *           empty string to force-disable search, even in the presence of
    3766  *           $_REQUEST['s']. Default: null.
     3809 *     @type int      $group_id          ID of the group whose members are being queried.
     3810 *                                        Default: current group ID.
     3811 *     @type int      $page              Page of results to be queried. Default: 1.
     3812 *     @type int      $per_page          Number of items to return per page of results.
     3813 *                                        Default: 20.
     3814 *     @type int      $max                Optional. Max number of items to return.
     3815 *     @type array    $exclude            Optional. Array of user IDs to exclude.
     3816 *     @type bool|int $exclude_admin_mods True (or 1) to exclude admins and mods from results.
     3817 *                                        Default: 1.
     3818 *     @type bool|int $exclude_banned     True (or 1) to exclude banned users from results.
     3819 *                                        Default: 1.
     3820 *     @type array    $group_role        Optional. Array of group roles to include.
     3821 *     @type string   $type              Optional. Sort order of results. 'last_joined',
     3822 *                                        'first_joined', or any of the $type params available in
     3823 *                                        {@link BP_User_Query}. Default: 'last_joined'.
     3824 *     @type string   $search_terms      Optional. Search terms to match. Pass an
     3825 *                                        empty string to force-disable search, even in
     3826 *                                        the presence of $_REQUEST['s']. Default: null.
    37673827 * }
     3828 *
     3829 * @return bool
    37683830 */
    37693831function bp_group_has_members( $args = '' ) {
     
    38233885 * @since BuddyPress (1.0.0)
    38243886 *
    3825  * @param array $args {@see bp_core_fetch_avatar()}
     3887 * @param array|string $args {@see bp_core_fetch_avatar()}
    38263888 */
    38273889function bp_group_member_avatar( $args = '' ) {
     
    38333895         * @since BuddyPress (1.0.0)
    38343896         *
    3835          * @param array $args {@see bp_core_fetch_avatar()}
     3897         * @param array|string $args {@see bp_core_fetch_avatar()}
     3898         *
     3899         * @return string
    38363900         */
    38373901        function bp_get_group_member_avatar( $args = '' ) {
     
    38613925 * @since BuddyPress (1.0.0)
    38623926 *
    3863  * @param array $args {@see bp_core_fetch_avatar()}
     3927 * @param array|string $args {@see bp_core_fetch_avatar()}
    38643928 */
    38653929
     
    38723936         * @since BuddyPress (1.0.0)
    38733937         *
    3874          * @param array $args {@see bp_core_fetch_avatar()}
     3938         * @param array|string $args {@see bp_core_fetch_avatar()}
     3939         *
     3940         * @return string
    38753941         */
    38763942        function bp_get_group_member_avatar_thumb( $args = '' ) {
     
    39003966 * @since BuddyPress (1.0.0)
    39013967 *
    3902  * @param array $args {@see bp_core_fetch_avatar()}
     3968 * @param int $width  Width of avatar to fetch.
     3969 * @param int $height Height of avatar to fetch.
    39033970 */
    39043971function bp_group_member_avatar_mini( $width = 30, $height = 30 ) {
     
    39103977         * @since BuddyPress (1.0.0)
    39113978         *
    3912          * @param array $args {@see bp_core_fetch_avatar()}
     3979         * @param int $width  Width of avatar to fetch.
     3980         * @param int $height Height of avatar to fetch.
     3981         *
     3982         * @return string
    39133983         */
    39143984        function bp_get_group_member_avatar_mini( $width = 30, $height = 30 ) {
     
    45894659
    45904660/**
    4591  * Echoes the current group creation step
     4661 * Echoes the current group creation step.
    45924662 *
    45934663 * @since BuddyPress (1.6.0)
     
    45974667}
    45984668        /**
    4599          * Returns the current group creation step. If none is found, returns an empty string
     4669         * Returns the current group creation step. If none is found, returns an empty string.
    46004670         *
    46014671         * @since BuddyPress (1.6.0)
    46024672         *
    4603          * @uses apply_filters() Filter bp_get_groups_current_create_step to modify
     4673         * @uses apply_filters() Filter bp_get_groups_current_create_step to modify.
     4674         *
    46044675         * @return string $current_create_step
    46054676         */
     
    47184789
    47194790/**
    4720  * Displays group header tabs
     4791 * Displays group header tabs.
    47214792 *
    47224793 * @todo Deprecate?
     
    47374808
    47384809/**
    4739  * Displays group filter titles
     4810 * Displays group filter titles.
    47404811 *
    47414812 * @todo Deprecate?
     
    47734844 *
    47744845 * @param string $slug
     4846 *
    47754847 * @return bool
    47764848 */
     
    47804852
    47814853/**
    4782  * Echoes the current group admin tab slug
     4854 * Echoes the current group admin tab slug.
    47834855 *
    47844856 * @since BuddyPress (1.6.0)
     
    47884860}
    47894861        /**
    4790          * Returns the current group admin tab slug
     4862         * Returns the current group admin tab slug.
    47914863         *
    47924864         * @since BuddyPress (1.6.0)
    47934865         *
    4794          * @uses apply_filters() Filter bp_get_current_group_admin_tab to modify return value
    4795          * @return string $tab The current tab's slug
     4866         * @uses apply_filters() Filter bp_get_current_group_admin_tab to modify return value.
     4867         *
     4868         * @return string $tab The current tab's slug.
    47964869         */
    47974870        function bp_get_group_current_admin_tab() {
     
    48154888
    48164889/**
    4817  * Outputs the current group avatar
     4890 * Outputs the current group avatar.
    48184891 *
    48194892 * @since BuddyPress (1.0.0)
    48204893 * @param string $type thumb or full ?
    4821  * @uses bp_get_group_current_avatar() to get the avatar of the current group
     4894 * @uses bp_get_group_current_avatar() to get the avatar of the current group.
    48224895 */
    48234896function bp_group_current_avatar( $type = 'thumb' ) {
     
    48254898}
    48264899        /**
    4827          * Returns the current group avatar
     4900         * Returns the current group avatar.
    48284901         *
    48294902         * @since BuddyPress (2.0.0)
     
    48544927
    48554928/**
    4856  * Return whether a group has an avatar
     4929 * Return whether a group has an avatar.
    48574930 *
    48584931 * @since BuddyPress (1.1.0)
    48594932 *
    4860  * @param  int $group_id
     4933 * @param  int|bool $group_id
     4934 *
    48614935 * @return boolean
    48624936 */
     
    49375011         * @param array $args {
    49385012         *     @type int $group_id ID of the group whose membership requests
    4939          *           are being queried. Default: current group id.
     5013         *                         are being queried. Default: current group id.
    49405014         *     @type int $per_page Number of records to return per page of
    4941          *           results. Default: 10.
    4942          *     @type int $page Page of results to show. Default: 1.
    4943          *     @type int $max Max items to return. Default: false (show all)
     5015         *                         results. Default: 10.
     5016         *     @type int $page     Page of results to show. Default: 1.
     5017         *     @type int $max      Max items to return. Default: false (show all)
    49445018         * }
    49455019         */
     
    50865160 * Initialize a group membership request template loop.
    50875161 *
    5088  * @param array $args {
     5162 * @param array|string $args {
    50895163 *     @type int $group_id ID of the group. Defaults to current group.
    50905164 *     @type int $per_page Number of records to return per page. Default: 10.
    5091  *     @type int $page Page of results to return. Default: 1.
    5092  *     @type int $max Max number of items to return. Default: false.
     5165 *     @type int $page     Page of results to return. Default: 1.
     5166 *     @type int $max      Max number of items to return. Default: false.
    50935167 * }
    50945168 * @return bool True if there are requests, otherwise false.
     
    56615735
    56625736/**
    5663  * Hook group activity feed to <head>
     5737 * Hook group activity feed to <head>.
    56645738 *
    56655739 * @since BuddyPress (1.5.0)
     
    56795753
    56805754/**
    5681  * Output the current group activity-stream RSS URL
     5755 * Output the current group activity-stream RSS URL.
    56825756 *
    56835757 * @since BuddyPress (1.5.0)
     
    56875761}
    56885762        /**
    5689          * Return the current group activity-stream RSS URL
     5763         * Return the current group activity-stream RSS URL.
    56905764         *
    56915765         * @since BuddyPress (1.5.0)
     
    57105784
    57115785/**
    5712  * Echoes the output of bp_get_current_group_id()
     5786 * Echoes the output of bp_get_current_group_id().
    57135787 *
    57145788 * @since BuddyPress (1.5.0)
     
    57185792}
    57195793        /**
    5720          * Returns the ID of the current group
     5794         * Returns the ID of the current group.
    57215795         *
    57225796         * @since BuddyPress (1.5.0)
    5723          * @uses apply_filters() Filter bp_get_current_group_id to modify this output
    5724          *
    5725          * @return int $current_group_id The id of the current group, if there is one
     5797         * @uses apply_filters() Filter bp_get_current_group_id to modify this output.
     5798         *
     5799         * @return int $current_group_id The id of the current group, if there is one.
    57265800         */
    57275801        function bp_get_current_group_id() {
     
    57415815
    57425816/**
    5743  * Echoes the output of bp_get_current_group_slug()
     5817 * Echoes the output of bp_get_current_group_slug().
    57445818 *
    57455819 * @since BuddyPress (1.5.0)
     
    57495823}
    57505824        /**
    5751          * Returns the slug of the current group
     5825         * Returns the slug of the current group.
    57525826         *
    57535827         * @since BuddyPress (1.5.0)
    5754          * @uses apply_filters() Filter bp_get_current_group_slug to modify this output
    5755          *
    5756          * @return string $current_group_slug The slug of the current group, if there is one
     5828         * @uses apply_filters() Filter bp_get_current_group_slug to modify this output.
     5829         *
     5830         * @return string $current_group_slug The slug of the current group, if there is one.
    57575831         */
    57585832        function bp_get_current_group_slug() {
     
    57725846
    57735847/**
    5774  * Echoes the output of bp_get_current_group_name()
     5848 * Echoes the output of bp_get_current_group_name().
    57755849 *
    57765850 * @since BuddyPress (1.5.0)
     
    57805854}
    57815855        /**
    5782          * Returns the name of the current group
     5856         * Returns the name of the current group.
    57835857         *
    57845858         * @since BuddyPress (1.5.0)
    5785          * @uses apply_filters() Filter bp_get_current_group_name to modify this output
    5786          *
    5787          * @return string The name of the current group, if there is one
     5859         * @uses apply_filters() Filter bp_get_current_group_name to modify this output.
     5860         *
     5861         * @return string The name of the current group, if there is one.
    57885862         */
    57895863        function bp_get_current_group_name() {
     
    58065880
    58075881/**
    5808  * Echoes the output of bp_get_current_group_description()
     5882 * Echoes the output of bp_get_current_group_description().
    58095883 *
    58105884 * @since BuddyPress (2.1.0)
     
    58145888}
    58155889        /**
    5816          * Returns the description of the current group
     5890         * Returns the description of the current group.
    58175891         *
    58185892         * @since BuddyPress (2.1.0)
    58195893         * @uses apply_filters() Filter bp_get_current_group_description to modify
    5820          *                       this output
    5821          *
    5822          * @return string The description of the current group, if there is one
     5894         *                       this output.
     5895         *
     5896         * @return string The description of the current group, if there is one.
    58235897         */
    58245898        function bp_get_current_group_description() {
     
    58485922
    58495923/**
    5850  * Output a URL for a group component action
     5924 * Output a URL for a group component action.
    58515925 *
    58525926 * @since BuddyPress (1.2.0)
     
    58555929 * @param string $query_args
    58565930 * @param bool $nonce
     5931 *
    58575932 * @return string
    58585933 */
     
    58615936}
    58625937        /**
    5863          * Get a URL for a group component action
     5938         * Get a URL for a group component action.
    58645939         *
    58655940         * @since BuddyPress (1.2.0)
     
    58685943         * @param string $query_args
    58695944         * @param bool $nonce
     5945         *
    58705946         * @return string
    58715947         */
     
    59215997 * @since BuddyPress (2.0.0)
    59225998 *
    5923  * @param array $args before|after|user_id
    5924  * @uses bp_groups_get_profile_stats() to get the stats
     5999 * @param array|string $args before|after|user_id
     6000 *
     6001 * @uses bp_groups_get_profile_stats() to get the stats.
    59256002 */
    59266003function bp_groups_profile_stats( $args = '' ) {
     
    59346011 * @since BuddyPress (2.0.0)
    59356012 *
    5936  * @param array $args before|after|user_id
     6013 * @param array|string $args before|after|user_id
    59376014 * @return string HTML for stats output.
    59386015 */
  • trunk/src/bp-groups/classes/class-bp-group-extension.php

    r9819 r9906  
    290290         */
    291291
    292         // The content of the group tab
     292        /*
     293         * The content of the group tab
     294         *
     295         * @param int|null $group_id
     296         */
    293297        public function display( $group_id = null ) {}
    294298
    295         // Content displayed in a widget sidebar, if applicable
     299        /**
     300         * Content displayed in a widget sidebar, if applicable
     301         */
    296302        public function widget_display() {}
    297303
     
    10841090         *
    10851091         * @param string $screen The screen markup, captured in the output
    1086          *        buffer.
    1087          * @param string $screen The same markup, with a submit button added.
     1092         *                       buffer.
     1093         *
     1094         * @return string $screen The same markup, with a submit button added.
    10881095         */
    10891096        protected function maybe_add_submit_button( $screen = '' ) {
     
    11191126         * @since BuddyPress (2.1.0)
    11201127         *
    1121          * @param string $location
     1128         * @param string $redirect
     1129         *
    11221130         * @return string
    11231131         */
     
    16741682 *
    16751683 * @param string Name of the Extension class.
    1676  * @return bool|null Returns false on failure, otherwise null.
     1684 * @return false|null Returns false on failure, otherwise null.
    16771685 */
    16781686function bp_register_group_extension( $group_extension_class = '' ) {
  • trunk/src/bp-groups/classes/class-bp-group-member-query.php

    r9819 r9906  
    11<?php
    22/**
    3  * BuddyPress Groups Classes
     3 * BuddyPress Groups Classes.
    44 *
    55 * @package BuddyPress
     
    1414 *
    1515 * Special notes about the group members data schema:
    16  * - *Members* are entries with is_confirmed = 1
    17  * - *Pending requests* are entries with is_confirmed = 0 and inviter_id = 0
     16 * - *Members* are entries with is_confirmed = 1.
     17 * - *Pending requests* are entries with is_confirmed = 0 and inviter_id = 0.
    1818 * - *Pending and sent invitations* are entries with is_confirmed = 0 and
    19  *   inviter_id != 0 and invite_sent = 1
     19 *   inviter_id != 0 and invite_sent = 1.
    2020 * - *Pending and unsent invitations* are entries with is_confirmed = 0 and
    21  *   inviter_id != 0 and invite_sent = 0
     21 *   inviter_id != 0 and invite_sent = 0.
    2222 * - *Membership requests* are entries with is_confirmed = 0 and
    23  *   inviter_id = 0 (and invite_sent = 0)
     23 *   inviter_id = 0 (and invite_sent = 0).
    2424 *
    2525 * @since BuddyPress (1.8.0)
    2626 *
    27  * @param array $args {
     27 * @param array $args  {
    2828 *     Array of arguments. Accepts all arguments from
    2929 *     {@link BP_User_Query}, with the following additions:
    30  *     @type int $group_id ID of the group to limit results to.
    31  *     @type array $group_role Array of group roles to match ('member',
    32  *           'mod', 'admin', 'banned'). Default: array( 'member' ).
    33  *     @type bool $is_confirmed Whether to limit to confirmed members.
    34  *           Default: true.
    35  *     @type string $type Sort order. Accepts any value supported by
    36  *           {@link BP_User_Query}, in addition to 'last_joined' and
    37  *           'first_joined'. Default: 'last_joined'.
     30 *
     31 *     @type int    $group_id     ID of the group to limit results to.
     32 *     @type array  $group_role   Array of group roles to match ('member',
     33 *                                'mod', 'admin', 'banned').
     34 *                                Default: array( 'member' ).
     35 *     @type bool   $is_confirmed Whether to limit to confirmed members.
     36 *                                Default: true.
     37 *     @type string $type         Sort order. Accepts any value supported by
     38 *                                {@link BP_User_Query}, in addition to 'last_joined'
     39 *                                and 'first_joined'. Default: 'last_joined'.
    3840 * }
    3941 */
     
    7880         *
    7981         * @param array $include Existing group IDs in the $include parameter,
    80          *        as calculated in BP_User_Query.
     82         *                       as calculated in BP_User_Query.
    8183         * @return array
    8284         */
     
    298300         * @since BuddyPress (1.8.0)
    299301         *
    300          * @param BP_User_Query $query BP_User_Query object. Because we're
    301          *        filtering the current object, we use $this inside of the
    302          *        method instead.
    303          * @param string $user_ids_sql Sanitized, comma-separated string of
    304          *        the user ids returned by the main query.
     302         * @param BP_User_Query $query        BP_User_Query object. Because we're
     303         *                                    filtering the current object, we use
     304         *                                    $this inside of the method instead.
     305         * @param string        $user_ids_sql Sanitized, comma-separated string of
     306         *                                    the user ids returned by the main query.
    305307         */
    306308        public function populate_group_member_extras( $query, $user_ids_sql ) {
     
    336338         * @since BuddyPress (2.1.0)
    337339         *
    338          * @param BP_User_Query $query BP_User_Query object.
    339          * @param array $gm_ids array of group member ids.
     340         * @param BP_User_Query $query  BP_User_Query object.
     341         * @param array         $gm_ids array of group member ids.
     342         *
    340343         * @return array
    341344         */
  • trunk/src/bp-groups/classes/class-bp-groups-group.php

    r9819 r9906  
    156156         * Constructor method.
    157157         *
    158          * @param int $id Optional. If the ID of an existing group is provided,
    159          *        the object will be pre-populated with info about that group.
    160          * @param array $args {
     158         * @param int|null $id Optional. If the ID of an existing group is provided,
     159         *                     the object will be pre-populated with info about that group.
     160         * @param array    $args {
    161161         *     Array of optional arguments.
    162162         *     @type bool $populate_extras Whether to fetch "extra" data about
     
    284284                 * @since BuddyPress (1.0.0)
    285285                 *
    286                  * @param BP_Groups_Group Current instance of the group item being saved. Passed by reference.
     286                 * @param BP_Groups_Group $this Current instance of the group item being saved. Passed by reference.
    287287                 */
    288288                do_action_ref_array( 'groups_group_before_save', array( &$this ) );
     
    364364                 * @since BuddyPress (1.0.0)
    365365                 *
    366                  * @param BP_Groups_Group Current instance of the group item that was saved. Passed by reference.
     366                 * @param BP_Groups_Group $this Current instance of the group item that was saved. Passed by reference.
    367367                 */
    368368                do_action_ref_array( 'groups_group_after_save', array( &$this ) );
     
    420420         * Get whether a group exists for a given slug.
    421421         *
    422          * @param string $slug Slug to check.
    423          * @param string $table_name Optional. Name of the table to check
    424          *        against. Default: $bp->groups->table_name.
     422         * @param string      $slug       Slug to check.
     423         * @param string|bool $table_name Optional. Name of the table to check
     424         *                                against. Default: $bp->groups->table_name.
     425         *
    425426         * @return string|null ID of the group, if one is found, else null.
    426427         */
     
    473474         *        Default: the displayed user.
    474475         * @param mixed $order Not used.
    475          * @param int $limit Optional. The max number of results to return.
     476         * @param int|null $limit Optional. The max number of results to return.
    476477         *        Default: null (no limit).
    477          * @param int $page Optional. The page offset of results to return.
     478         * @param int|null $page Optional. The page offset of results to return.
    478479         *        Default: null (no limit).
     480         * @return false|array {
     481         *     @type array $groups Array of matched and paginated group objects.
     482         *     @type int $total Total count of groups matching the query.
     483         * }
     484         */
     485        public static function filter_user_groups( $filter, $user_id = 0, $order = false, $limit = null, $page = null ) {
     486                global $wpdb;
     487
     488                if ( empty( $user_id ) )
     489                        $user_id = bp_displayed_user_id();
     490
     491                $search_terms_like = bp_esc_like( $filter ) . '%';
     492
     493                $pag_sql = $order_sql = $hidden_sql = '';
     494
     495                if ( !empty( $limit ) && !empty( $page ) )
     496                        $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
     497
     498                // Get all the group ids for the current user's groups.
     499                $gids = BP_Groups_Member::get_group_ids( $user_id );
     500
     501                if ( empty( $gids['groups'] ) )
     502                        return false;
     503
     504                $bp = buddypress();
     505
     506                $gids = esc_sql( implode( ',', wp_parse_id_list( $gids['groups'] ) ) );
     507
     508                $paged_groups = $wpdb->get_results( $wpdb->prepare( "SELECT id as group_id FROM {$bp->groups->table_name} WHERE ( name LIKE %s OR description LIKE %s ) AND id IN ({$gids}) {$pag_sql}", $search_terms_like, $search_terms_like ) );
     509                $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$bp->groups->table_name} WHERE ( name LIKE %s OR description LIKE %s ) AND id IN ({$gids})", $search_terms_like, $search_terms_like ) );
     510
     511                return array( 'groups' => $paged_groups, 'total' => $total_groups );
     512        }
     513
     514        /**
     515         * Get a list of groups, filtered by a search string.
     516         *
     517         * @param string $filter Search term. Matches against 'name' and
     518         *        'description' fields.
     519         * @param int|null $limit Optional. The max number of results to return.
     520         *        Default: null (no limit).
     521         * @param int|null $page Optional. The page offset of results to return.
     522         *        Default: null (no limit).
     523         * @param string|bool $sort_by Column to sort by. Default: false (default
     524         *        sort).
     525         * @param string|bool $order ASC or DESC. Default: false (default sort).
    479526         * @return array {
    480527         *     @type array $groups Array of matched and paginated group objects.
     
    482529         * }
    483530         */
    484         public static function filter_user_groups( $filter, $user_id = 0, $order = false, $limit = null, $page = null ) {
    485                 global $wpdb;
    486 
    487                 if ( empty( $user_id ) )
    488                         $user_id = bp_displayed_user_id();
    489 
    490                 $search_terms_like = bp_esc_like( $filter ) . '%';
    491 
    492                 $pag_sql = $order_sql = $hidden_sql = '';
    493 
    494                 if ( !empty( $limit ) && !empty( $page ) )
    495                         $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
    496 
    497                 // Get all the group ids for the current user's groups.
    498                 $gids = BP_Groups_Member::get_group_ids( $user_id );
    499 
    500                 if ( empty( $gids['groups'] ) )
    501                         return false;
    502 
    503                 $bp = buddypress();
    504 
    505                 $gids = esc_sql( implode( ',', wp_parse_id_list( $gids['groups'] ) ) );
    506 
    507                 $paged_groups = $wpdb->get_results( $wpdb->prepare( "SELECT id as group_id FROM {$bp->groups->table_name} WHERE ( name LIKE %s OR description LIKE %s ) AND id IN ({$gids}) {$pag_sql}", $search_terms_like, $search_terms_like ) );
    508                 $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$bp->groups->table_name} WHERE ( name LIKE %s OR description LIKE %s ) AND id IN ({$gids})", $search_terms_like, $search_terms_like ) );
    509 
    510                 return array( 'groups' => $paged_groups, 'total' => $total_groups );
    511         }
    512 
    513         /**
    514          * Get a list of groups, filtered by a search string.
    515          *
    516          * @param string $filter Search term. Matches against 'name' and
    517          *        'description' fields.
    518          * @param int $limit Optional. The max number of results to return.
    519          *        Default: null (no limit).
    520          * @param int $page Optional. The page offset of results to return.
    521          *        Default: null (no limit).
    522          * @param string $sort_by Column to sort by. Default: false (default
    523          *        sort).
    524          * @param string $order ASC or DESC. Default: false (default sort).
    525          * @return array {
    526          *     @type array $groups Array of matched and paginated group objects.
    527          *     @type int $total Total count of groups matching the query.
    528          * }
    529          */
    530531        public static function search_groups( $filter, $limit = null, $page = null, $sort_by = false, $order = false ) {
    531532                global $wpdb;
     
    621622         *
    622623         * @param int $group_id ID of the group.
    623          * @param int $limit Optional. Max number of results to return.
     624         * @param int|null $limit Optional. Max number of results to return.
    624625         *        Default: null (no limit).
    625          * @param int $page Optional. Page offset of results returned. Default:
     626         * @param int|null $page Optional. Page offset of results returned. Default:
    626627         *        null (no limit).
    627628         * @return array {
     
    10781079         * Get a list of groups, sorted by those that have the most legacy forum topics.
    10791080         *
    1080          * @param int $limit Optional. The max number of results to return.
     1081         * @param int|null $limit Optional. The max number of results to return.
    10811082         *        Default: null (no limit).
    1082          * @param int $page Optional. The page offset of results to return.
     1083         * @param int|null $page Optional. The page offset of results to return.
    10831084         *        Default: null (no limit).
    10841085         * @param int $user_id Optional. If present, groups will be limited to
    10851086         *        those of which the specified user is a member.
    1086          * @param string $search_terms Optional. Limit groups to those whose
     1087         * @param string|bool $search_terms Optional. Limit groups to those whose
    10871088         *        name or description field contain the search string.
    10881089         * @param bool $populate_extras Optional. Whether to fetch extra
    10891090         *        information about the groups. Default: true.
    1090          * @param string|array Optional. Array or comma-separated list of group
     1091         * @param string|array|bool $exclude Optional. Array or comma-separated list of group
    10911092         *        IDs to exclude from results.
    10921093         * @return array {
     
    11471148         * Get a list of groups, sorted by those that have the most legacy forum posts.
    11481149         *
    1149          * @param int $limit Optional. The max number of results to return.
     1150         * @param int|null $limit Optional. The max number of results to return.
    11501151         *        Default: null (no limit).
    1151          * @param int $page Optional. The page offset of results to return.
     1152         * @param int|null $page Optional. The page offset of results to return.
    11521153         *        Default: null (no limit).
    1153          * @param int $user_id Optional. If present, groups will be limited to
    1154          *        those of which the specified user is a member.
    1155          * @param string $search_terms Optional. Limit groups to those whose
     1154         * @param string|bool $search_terms Optional. Limit groups to those whose
    11561155         *        name or description field contain the search string.
    11571156         * @param bool $populate_extras Optional. Whether to fetch extra
    11581157         *        information about the groups. Default: true.
    1159          * @param string|array Optional. Array or comma-separated list of group
     1158         * @param string|array|bool Optional. Array or comma-separated list of group
    11601159         *        IDs to exclude from results.
    11611160         * @return array {
     
    12171216         *
    12181217         * @param string $letter The letter.
    1219          * @param int $limit Optional. The max number of results to return.
     1218         * @param int|null $limit Optional. The max number of results to return.
    12201219         *        Default: null (no limit).
    1221          * @param int $page Optional. The page offset of results to return.
     1220         * @param int|null $page Optional. The page offset of results to return.
    12221221         *        Default: null (no limit).
    12231222         * @param bool $populate_extras Optional. Whether to fetch extra
    12241223         *        information about the groups. Default: true.
    1225          * @param string|array Optional. Array or comma-separated list of group
     1224         * @param string|array|bool $exclude Optional. Array or comma-separated list of group
    12261225         *        IDs to exclude from results.
    1227          * @return array {
     1226         * @return false|array {
    12281227         *     @type array $groups Array of group objects returned by the
    12291228         *           paginated query.
     
    12831282         * Use BP_Groups_Group::get() with 'type' = 'random' instead.
    12841283         *
    1285          * @param int $limit Optional. The max number of results to return.
     1284         * @param int|null $limit Optional. The max number of results to return.
    12861285         *        Default: null (no limit).
    1287          * @param int $page Optional. The page offset of results to return.
     1286         * @param int|null $page Optional. The page offset of results to return.
    12881287         *        Default: null (no limit).
    12891288         * @param int $user_id Optional. If present, groups will be limited to
    12901289         *        those of which the specified user is a member.
    1291          * @param string $search_terms Optional. Limit groups to those whose
     1290         * @param string|bool $search_terms Optional. Limit groups to those whose
    12921291         *        name or description field contain the search string.
    12931292         * @param bool $populate_extras Optional. Whether to fetch extra
    12941293         *        information about the groups. Default: true.
    1295          * @param string|array Optional. Array or comma-separated list of group
     1294         * @param string|array|bool $exclude Optional. Array or comma-separated list of group
    12961295         *        IDs to exclude from results.
    12971296         * @return array {
     
    13591358         * @param string|array Array or comma-separated list of IDs matching
    13601359         *        $paged_groups.
    1361          * @param string $type Not used.
     1360         * @param string|bool $type Not used.
    13621361         * @return array $paged_groups
    13631362         */
     
    14691468         * Get global count of forum topics in public groups (legacy forums).
    14701469         *
    1471          * @param $type Optional. If 'unreplied', count will be limited to
     1470         * @param string $type Optional. If 'unreplied', count will be limited to
    14721471         *        those topics that have received no replies.
    14731472         * @return int Forum topic count.
     
    15211520         * @param string $status Which group type to count. 'public', 'private',
    15221521         *        'hidden', or 'all'. Default: 'public'.
     1522         * @param string|bool $search_terms Provided search terms.
     1523         *
    15231524         * @return int The topic count
    15241525         */
  • trunk/src/bp-groups/classes/class-bp-groups-member-suggestions.php

    r9819 r9906  
    11<?php
    22/**
    3  * BuddyPress Groups Classes
     3 * BuddyPress Groups Classes.
    44 *
    55 * @package BuddyPress
     
    2323         * @access protected
    2424         * @var array $args {
    25          *     @type int $group_id Positive integers will restrict the search to members in that group.
    26          *           Negative integers will restrict the search to members in every other group.
    27          *     @type int $limit Maximum number of results to display. Default: 16.
    28          *     @type bool $only_friends If true, only match the current user's friends. Default: false.
    29          *     @type string $term The suggestion service will try to find results that contain this string.
    30          *           Mandatory.
     25         *     @type int    $group_id    Positive integers will restrict the search to members in that group.
     26         *                                Negative integers will restrict the search to members in every other group.
     27         *     @type int    $limit        Maximum number of results to display. Default: 16.
     28         *     @type bool   $only_friends If true, only match the current user's friends. Default: false.
     29         *     @type string $term         The suggestion service will try to find results that contain this string.
     30         *                                Mandatory.
    3131         * }
    3232         */
     
    4343         * Validate and sanitise the parameters for the suggestion service query.
    4444         *
     45         * @since BuddyPress (2.1.0)
     46         *
    4547         * @return true|WP_Error If validation fails, return a WP_Error object. On success, return true (bool).
    46          * @since BuddyPress (2.1.0)
    4748         */
    4849        public function validate() {
     
    8889         * Find and return a list of username suggestions that match the query.
    8990         *
     91         * @since BuddyPress (2.1.0)
     92         *
    9093         * @return array|WP_Error Array of results. If there were problems, returns a WP_Error object.
    91          * @since BuddyPress (2.1.0)
    9294         */
    9395        public function get_suggestions() {
  • trunk/src/bp-groups/classes/class-bp-groups-member.php

    r9901 r9906  
    138138         * @param int $group_id Optional. Along with $user_id, can be used to
    139139         *        look up a membership.
    140          * @param int $id Optional. The unique ID of the membership object.
     140         * @param int|bool $id Optional. The unique ID of the membership object.
    141141         * @param bool $populate Whether to populate the properties of the
    142142         *        located membership. Default: true.
     
    227227                 * @since BuddyPress (1.0.0)
    228228                 *
    229                  * @param BP_Groups_Member Current instance of the group membership item being saved. Passed by reference.
     229                 * @param BP_Groups_Member $this Current instance of the group membership item being saved. Passed by reference.
    230230                 */
    231231                do_action_ref_array( 'groups_member_before_save', array( &$this ) );
     
    260260                 * @since BuddyPress (1.0.0)
    261261                 *
    262                  * @param BP_Groups_Member Current instance of the group membership item has been saved. Passed by reference.
     262                 * @param BP_Groups_Member $this Current instance of the group membership item has been saved. Passed by reference.
    263263                 */
    264264                do_action_ref_array( 'groups_member_after_save', array( &$this ) );
     
    361361                 * @since BuddyPress (2.3.0)
    362362                 *
    363                  * @param BP_Groups_Member Current group membership object.
     363                 * @param BP_Groups_Member $this Current group membership object.
    364364                 */
    365365                do_action_ref_array( 'groups_member_before_remove', array( $this ) );
     
    382382                 * @since BuddyPress (2.3.0)
    383383                 *
    384                  * @param BP_Groups_Member Current group membership object.
     384                 * @param BP_Groups_Member $this Current group membership object.
    385385                 */
    386386                do_action_ref_array( 'groups_member_after_remove', array( $this ) );
     
    461461         *
    462462         * @param int $user_id ID of the user.
    463          * @param int $limit Optional. Max number of results to return.
     463         * @param int|bool $limit Optional. Max number of results to return.
    464464         *        Default: false (no limit).
    465          * @param int $page Optional. Page offset of results to return.
     465         * @param int|bool $page Optional. Page offset of results to return.
    466466         *        Default: false (no limit).
    467467         * @return array {
     
    497497         *
    498498         * @param int $user_id ID of the user.
    499          * @param int $limit Optional. Max number of results to return.
     499         * @param int|bool $limit Optional. Max number of results to return.
    500500         *        Default: false (no limit).
    501          * @param int $page Optional. Page offset of results to return.
     501         * @param int|bool $page Optional. Page offset of results to return.
    502502         *        Default: false (no limit).
    503          * @param string $filter Optional. Limit results to groups whose name or
     503         * @param string|bool $filter Optional. Limit results to groups whose name or
    504504         *        description field matches search terms.
    505505         * @return array {
     
    538538         *
    539539         * @param int $user_id ID of the user.
    540          * @param int $limit Optional. Max number of results to return.
     540         * @param int|bool $limit Optional. Max number of results to return.
    541541         *        Default: false (no limit).
    542          * @param int $page Optional. Page offset of results to return.
     542         * @param int|bool $page Optional. Page offset of results to return.
    543543         *        Default: false (no limit).
    544          * @param string $filter Optional. Limit results to groups whose name or
     544         * @param string|bool $filter Optional. Limit results to groups whose name or
    545545         *        description field matches search terms.
    546546         * @return array {
     
    579579         *
    580580         * @param int $user_id ID of the user.
    581          * @param int $limit Optional. Max number of results to return.
     581         * @param int|bool $limit Optional. Max number of results to return.
    582582         *        Default: false (no limit).
    583          * @param int $page Optional. Page offset of results to return.
     583         * @param int|bool $page Optional. Page offset of results to return.
    584584         *        Default: false (no limit).
    585          * @param string $filter Optional. Limit results to groups whose name or
     585         * @param string|bool $filter Optional. Limit results to groups whose name or
    586586         *        description field matches search terms.
    587587         * @return array {
     
    641641         *
    642642         * @param int $user_id ID of the invitee.
    643          * @param int $limit Optional. Max number of results to return.
     643         * @param int|bool $limit Optional. Max number of results to return.
    644644         *        Default: false (no limit).
    645          * @param int $page Optional. Page offset of results to return.
     645         * @param int|bool $page Optional. Page offset of results to return.
    646646         *        Default: false (no limit).
    647          * @param string|array $exclude Optional. Array or comma-separated list
     647         * @param string|array|bool $exclude Optional. Array or comma-separated list
    648648         *        of group IDs to exclude from results.
    649649         * @return array {
     
    773773         * @param int|null ID of the membership if the user is an admin,
    774774         *        otherwise null.
     775         *
     776         * @return mixed
    775777         */
    776778        public static function check_is_admin( $user_id, $group_id ) {
     
    792794         * @param int|null ID of the membership if the user is a mod,
    793795         *        otherwise null.
     796         *
     797         * @return mixed
    794798         */
    795799        public static function check_is_mod( $user_id, $group_id ) {
     
    811815         * @param int|null ID of the membership if the user is a member,
    812816         *        otherwise null.
     817         *
     818         * @return mixed
    813819         */
    814820        public static function check_is_member( $user_id, $group_id ) {
     
    830836         * @param int|null ID of the membership if the user is banned,
    831837         *        otherwise null.
     838         *
     839         * @return mixed
    832840         */
    833841        public static function check_is_banned( $user_id, $group_id ) {
     
    968976         *
    969977         * @deprecated BuddyPress (1.8.0)
     978         *
     979         * @param $group_id
     980         * @param $limit
     981         * @param $page
     982         * @param $exclude_admins_mods
     983         * @param $exclude_banned
     984         * @param $exclude
     985         *
     986         * @return mixed
    970987         */
    971988        public static function get_all_for_group( $group_id, $limit = false, $page = false, $exclude_admins_mods = true, $exclude_banned = true, $exclude = false ) {
     
    10681085         *
    10691086         * @param int $user_id ID of the user.
     1087         *
     1088         * @return mixed
    10701089         */
    10711090        public static function delete_all_for_user( $user_id ) {
Note: See TracChangeset for help on using the changeset viewer.