Skip to:
Content

BuddyPress.org

Ticket #6089: 6089.01.patch

File 6089.01.patch, 3.2 KB (added by dcavins, 10 years ago)

Clarifies return values for groups_is_user_* functions.

  • src/bp-groups/bp-groups-classes.php

    diff --git src/bp-groups/bp-groups-classes.php src/bp-groups/bp-groups-classes.php
    index b9017b9..fdd5c47 100644
    class BP_Groups_Member { 
    24932493         *
    24942494         * @param int $user_id ID of the user.
    24952495         * @param int $group_id ID of the group.
    2496          * @param int|null ID of the membership if the user is an admin,
    2497          *        otherwise null.
     2496         * @return int|false ID of the membership if the user is an admin, 0 if not an admin,
     2497         *         false if no user_id is provided.
    24982498         */
    24992499        public static function check_is_admin( $user_id, $group_id ) {
    25002500                global $wpdb, $bp;
    class BP_Groups_Member { 
    25102510         *
    25112511         * @param int $user_id ID of the user.
    25122512         * @param int $group_id ID of the group.
    2513          * @param int|null ID of the membership if the user is a mod,
    2514          *        otherwise null.
     2513         * @return int|false ID of the membership if the user is a mod, 0 if not a mod,
     2514         *         false if no user_id is provided.
    25152515         */
    25162516        public static function check_is_mod( $user_id, $group_id ) {
    25172517                global $wpdb, $bp;
    class BP_Groups_Member { 
    25272527         *
    25282528         * @param int $user_id ID of the user.
    25292529         * @param int $group_id ID of the group.
    2530          * @param int|null ID of the membership if the user is a member,
    2531          *        otherwise null.
     2530         * @return int|false ID of the membership if the user is a member, 0 if not a member,
     2531         *        false if no user_id is provided.
    25322532         */
    25332533        public static function check_is_member( $user_id, $group_id ) {
    25342534                global $wpdb, $bp;
  • src/bp-groups/bp-groups-functions.php

    diff --git src/bp-groups/bp-groups-functions.php src/bp-groups/bp-groups-functions.php
    index ec3ec01..f533a4b 100644
    function groups_avatar_upload_dir( $group_id = 0 ) { 
    746746 *
    747747 * @param int $user_id ID of the user.
    748748 * @param int $group_id ID of the group.
    749  * @param int|null ID of the membership if the user is an admin, otherwise null.
     749 * @return int|false ID of the membership if the user is an admin, 0 if not an admin,
     750 *         false if no user_id is provided.
    750751 */
    751752function groups_is_user_admin( $user_id, $group_id ) {
    752753        return BP_Groups_Member::check_is_admin( $user_id, $group_id );
    function groups_is_user_admin( $user_id, $group_id ) { 
    757758 *
    758759 * @param int $user_id ID of the user.
    759760 * @param int $group_id ID of the group.
    760  * @param int|null ID of the membership if the user is a mod, otherwise null.
    761  */
     761 * @return int|false ID of the membership if the user is a mod, 0 if not a mod,
     762 *         false if no user_id is provided.
     763  */
    762764function groups_is_user_mod( $user_id, $group_id ) {
    763765        return BP_Groups_Member::check_is_mod( $user_id, $group_id );
    764766}
    function groups_is_user_mod( $user_id, $group_id ) { 
    768770 *
    769771 * @param int $user_id ID of the user.
    770772 * @param int $group_id ID of the group.
    771  * @param int|null ID of the membership if the user is a member, otherwise null.
     773 * @return int|false ID of the membership if the user is a member, 0 if not a member,
     774 *         false if no user_id is provided.
    772775 */
    773776function groups_is_user_member( $user_id, $group_id ) {
    774777        return BP_Groups_Member::check_is_member( $user_id, $group_id );