[wp-trac] [WordPress Trac] #38099: Ability to disable hyphen-based exclusion in searches

WordPress Trac noreply at wordpress.org
Mon Sep 19 17:16:44 UTC 2016


#38099: Ability to disable hyphen-based exclusion in searches
--------------------------+-----------------------------
 Reporter:  chriseverson  |      Owner:
     Type:  enhancement   |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Query         |    Version:  4.6.1
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 In 4.4.0, the ability to prepend a search term with hyphen to indicate
 exclusion was added to the codebase.

 This behavior is awesome 99.9% of the time, however I recently found
 myself working on site where this behavior is problematic due to the fact
 that their products are named, quite often, using hyphens, in the same
 fashion.

 https://sunrisescience.com/?s=PABA&post_type=product is an example of this
 need in action. Searching PABA returns all products with "PABA" in the
 title, however, the project requirements in this case require the ability
 to search for "-PABA" in the title and not "PABA" without the preceding
 hyphen.

 I'd propose a new filter to toggle this functionality on and off, and will
 send a patch for that as soon as I find some time over the next day or
 two.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/38099>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list