[wp-trac] [WordPress Trac] #57996: Change $search_columns type from array to string[].

WordPress Trac noreply at wordpress.org
Tue Mar 28 10:30:13 UTC 2023


#57996: Change $search_columns type from array to string[].
-----------------------------+---------------------
 Reporter:  tmatsuur         |       Owner:  (none)
     Type:  feature request  |      Status:  new
 Priority:  normal           |   Milestone:  6.2.1
Component:  Query            |     Version:  trunk
 Severity:  normal           |  Resolution:
 Keywords:                   |     Focuses:  docs
-----------------------------+---------------------
Changes (by SergeyBiryukov):

 * milestone:  Awaiting Review => 6.2.1


Comment:

 Thanks for the ticket!

 The `search_columns` parameter is already documented as `string[]` in
 `WP_User_Query` as of [49693], and in `WP_Site_Query` as of [51184], so it
 definitely makes sense for `WP_Query` too. Introduced in [55248].

 To match the above two classes, I think `string[]` would be preferable
 here, rather than `string|string[]`. While a string can technically be
 passed too, we should encourage passing an array for consistency.

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


More information about the wp-trac mailing list