Skip to:
Content

BuddyPress.org

Ticket #8567: 8567.patch

File 8567.patch, 1.2 KB (added by imath, 3 years ago)
  • src/bp-groups/bp-groups-functions.php

    diff --git src/bp-groups/bp-groups-functions.php src/bp-groups/bp-groups-functions.php
    index 901ef22a7..5ba4299bf 100644
    function bp_get_group_by( $field, $value ) { 
    105105 *
    106106 * @global BP_Groups_Template $groups_template Groups template object.
    107107 *
    108  * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object.
    109  *                                                Default: false.
     108 * @param false|int|string|object|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object.
     109 *                                                       Default: false.
    110110 * @return BP_Groups_Group|bool The Group object if found, false otherwise.
    111111 */
    112112function bp_get_group( $group = false ) {
    function bp_get_group( $group = false ) { 
    114114
    115115        $group_obj = false;
    116116
    117         if ( $group instanceof BP_Groups_Group ) {
     117        if ( $group instanceof BP_Groups_Group || ( is_object( $group ) && ! empty( $group->id ) ) ) {
    118118                $group_obj = $group;
    119119
    120120                // Nothing requested? Let's use the current Group of the Groups Loop, if available.