[wp-trac] [WordPress Trac] #42409: Add LIKE support to meta_key comparisons in WP_Meta_Query

WordPress Trac noreply at wordpress.org
Mon Aug 26 19:10:58 UTC 2019


#42409: Add LIKE support to meta_key comparisons in WP_Meta_Query
-------------------------------------------------+-------------------------
 Reporter:  Otto42                               |       Owner:
                                                 |  boonebgorges
     Type:  enhancement                          |      Status:  closed
 Priority:  normal                               |   Milestone:  5.1
Component:  Query                                |     Version:  4.9
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  has-unit-tests has-dev-note needs-   |     Focuses:
  codex                                          |
-------------------------------------------------+-------------------------

Comment (by styledev):

 @Otto42 Advanced Custom Fields stores data in serialized arrays. This is a
 major plugin used on 1+ million plus websites (according to their site)
 and thus we are past "you should not store serialized values as meta
 anyway". That aside, MySQL handles wildcard percentages in the middle of a
 LIKE string and thus so should WordPress. If we need to escape a
 percentage then we (the developer) should be responsible for doing so and
 it shouldn't be done automatically on our behalf.

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


More information about the wp-trac mailing list