Update calls for groups from BP_Groups_Group::get to groups_get_groups

Home Forums Legacy Support Support queries Other issues Update calls for groups from BP_Groups_Group::get to groups_get_groups

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #71288
    eclipsedev
    Spectator
    Hello, I just wanted to point out that when retrieving a list of groups the groups_get_groups function should be utilized in place of the old BP_Groups_Group::get method so that the groups_get_groups filter is applied. They're basically identical other than a few different defaults and the fact the groups_get_groups filter is only applied via the groups_get_groups function. By using the old BP_Groups_Group::get method there's potential for plugin conflicts as the groups_get_groups filter doesn't get applied. Which in the case of the BP Sticky Groups plugin means any sticky group will be removed from the results and because groups_get_groups filter is never applied these sticky groups aren't re-added to the results meaning your requests will results in missing groups. More Info as I opened a ticket for this specifically with the plugin author; https://wordpress.org/support/topic/sticky-groups-missing-when-using-bp_groups_groupget-function/ I'm sure there's other plugins which can cause similar issues. Searching the WPLMS theme there's really only two instances of the old method which should be amended; 1. In the get_groups function of class.process_fields.php of the wplms_front_end plugin. 2. In the selectmultigroups case of the meta_box.php in the vibe-customtypes plugin In both these instances I also noticed there's a per_page of 999... a better approach is to use -1 when wanting to request all groups. And a final little note about the discrepency on how groups are called... also in meta_box.php for the get_groups ajax function groups are retrieved through $wpdb rather than using a BP function... this completely skips the filter as well. Would suggest this be consistent using groups_get_groups. Thank you
    #71372
    H.K. Latiyan
    Participant
    Thanks for the suggestion. We will add this in the next update. Track: https://trello.com/c/19DvtgWX
Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘Update calls for groups from BP_Groups_Group::get to groups_get_groups’ is closed to new replies.