#13992 closed enhancement (fixed)
get_terms() has 'search' and 'name__like'
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 3.7 | Priority: | normal |
| Severity: | normal | Version: | 3.0 |
| Component: | Taxonomy | Keywords: | has-patch commit |
| Focuses: | Cc: |
Description (last modified by )
Both do similar things:
if ( !empty($name__like) )
$where .= " AND t.name LIKE '{$name__like}%'";
...
if ( !empty($search) ) {
$search = like_escape($search);
$where .= " AND (t.name LIKE '%$search%')";
}
name__like should be removed in favour of search IMO, unless that functionality is intended, and in that case, name__like should get like_escape() applied
Attachments (3)
Change History (17)
#3
@
16 years ago
I would prefer removing 'search' instead, as it's unclear what fields are actually being searched.
#4
@
16 years ago
After thinking a bit more
name__likeshould get escaped, and work as it currently doessearchshould do both name AND slug, Not sure description is worth it?
#6
@
16 years ago
- Keywords gsoc added
Added diff that includes your suggestions, with search looking for name OR slug. No need to include description IMO.
#8
@
15 years ago
- Milestone changed from Awaiting Triage to Future Release
- Type changed from defect (bug) to enhancement
#9
@
13 years ago
- Keywords gsoc removed
- Milestone changed from Future Release to 3.7
Refreshed against trunk, only thing missing from trunk is the search for name AND slug
Note: See
TracTickets for help on using
tickets.
in addition to that, Terms are stored in the database htmlspecialchar'd by the looks of it (ie. '&'), The search should take that into consideration and apply the same filtering to the searching term.