[wp-trac] [WordPress Trac] #43867: Introduce the ability to control which fields are searched in a search query

WordPress Trac noreply at wordpress.org
Tue Feb 7 08:53:15 UTC 2023


#43867: Introduce the ability to control which fields are searched in a search
query
-------------------------------------------------+-------------------------
 Reporter:  johnbillion                          |       Owner:  audrasjb
     Type:  feature request                      |      Status:  closed
 Priority:  normal                               |   Milestone:  6.2
Component:  Query                                |     Version:
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests commit      |     Focuses:
  needs-dev-note add-to-field-guide              |
-------------------------------------------------+-------------------------
Changes (by audrasjb):

 * status:  accepted => closed
 * resolution:   => fixed


Comment:

 In [changeset:"55248" 55248]:
 {{{
 #!CommitTicketReference repository="" revision="55248"
 Query: Add a `search_columns` argument to control which fields are
 searched in a search query.

 Previously, the `s` argument of the `WP_Query::parse_query()` method
 searched the `post_title`, `post_excerpt`, and `post_content` fields, with
 no way of controlling this apart from using the `posts_search` filter and
 adjusting the SQL manually. This changeset adds the ability to specify
 which fields are searched when performing a query, using the
 `search_columns` argument.

 Props johnbillion, birgire, petitphp, audrasjb, costdev, mukesh27.
 Fixes #43867.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/43867#comment:20>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list