Opened 3 years ago
Last modified 8 months ago
#15249 assigned enhancement
Filtering get_search_sql for advanced queries
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Future Release |
| Component: | Plugins | Version: | 3.1 |
| Severity: | normal | Keywords: | has-patch dev-feedback |
| Cc: |
Description
Currently in the code for 3.1 (trunk) there are no filters running on the new function get_search_sql which would be useful for plugins to perform more complex MySQL functionality on specific columns.
I suggest adding a filter ;)
Attachments (5)
Change History (15)
comment:1
sc0ttkclark — 3 years ago
comment:3
sc0ttkclark — 3 years ago
For search, we already have the 'posts_search' filter. Should figure out what to do with that.
comment:5
sc0ttkclark — 3 years ago
In both cases (comment.php / user.php within /wp-includes/), as long as the array passed to get_search_sql is within $this then it can be useful as it is now there is no information available as to what fields are being searched unless the dev copies that code - making it less future proof. Thoughts?
comment:6
sc0ttkclark — 3 years ago
- Keywords has-patch needs-review added
Added patch that includes the new filters for Users / Comments - implemented in comment.php and user.php (not within get_search_sql function itself due to the lack of information the function is given like no access to $this)
- Keywords 3.2-early added
- Milestone changed from Awaiting Review to Future Release
All the Search SQL's should have consistent filters to allow for other search engines to be droped in amongst other things.
This needs a review to ensure that all required locations are changed.
comment:9
sc0ttkclark — 8 months ago
- Keywords dev-feedback added; needs-review 3.2-early removed
Refreshed the patch on this ticket for 3.5
comment:10
scribu — 8 months ago
Related: #21803

At the moment, it appears this function has disappeared from trunk for whatever reason. It's no longer in /wp-includes/classes.php so I'll keep an eye out for where it's being moved to before patching.