Skip to:
Content

BuddyPress.org

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#7418 closed enhancement (fixed)

Make group search more flexible.

Reported by: dcavins's profile dcavins Owned by: dcavins's profile dcavins
Milestone: 2.8 Priority: normal
Severity: normal Version: 2.7.2
Component: Groups Keywords: has-patch
Cc: dcavins

Description

While working on #6431, I realized that the group search could be more flexible, like the WP_User_Query search that allows the specification of where the wildcard should be set and which columns should be searched.

I'm attaching a patch that mostly duplicates the logic of WP_User_Query. The one difference is that our search has always assumed that the terms would be wild carded on both ends, so the default if no wildcard characters are detected is to follow the old behavior.

(Re #6431, then get_by_letter() could just use get().)

Attachments (1)

7418.1.patch (10.0 KB) - added by dcavins 8 years ago.
Add search_columns parameter and calculate wildcard placement in search string.

Download all attachments as: .zip

Change History (6)

@dcavins
8 years ago

Add search_columns parameter and calculate wildcard placement in search string.

This ticket was mentioned in Slack in #buddypress by dcavins. View the logs.


8 years ago

This ticket was mentioned in Slack in #buddypress by dcavins. View the logs.


8 years ago

#3 @boonebgorges
8 years ago

Yeah, this looks like a good change. Shared code might be worth a BP_Core_Search_Utils class or something in the long run, but not necessary for this ticket.

#4 @dcavins
8 years ago

  • Owner set to dcavins
  • Resolution set to fixed
  • Status changed from new to closed

In 11383:

BP_Groups_Group::get(): Add search_column parameter.

Allow developers to specify which column should be searched and where
wildcard characters should be placed in BP_Groups_Group::get().

Fixes #7418.

#5 @dcavins
8 years ago

  • Milestone changed from Awaiting Review to 2.8
Note: See TracTickets for help on using tickets.