#13992 closed enhancement (fixed)
get_terms() has 'search' and 'name__like'
| Reported by: | dd32 | Owned by: | wonderboymusic |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.7 |
| Component: | Taxonomy | Version: | 3.0 |
| Severity: | normal | Keywords: | has-patch commit |
| Cc: | Focuses: |
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.
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
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.