[wp-trac] [WordPress Trac] #42397: % symbol don't work anymore in args of wp_query

WordPress Trac noreply at wordpress.org
Wed Nov 1 16:27:13 UTC 2017


#42397: % symbol don't work anymore in args of wp_query
--------------------------+------------------------------
 Reporter:  pactivis132   |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Query         |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------
Changes (by mariovalney):

 * version:   => trunk


Comment:

 I'm trying to reproduce the problem, but I couldn't. Can you provide more
 information on how you are using '%' before 4.8.3?

 Actually, I created a 4.7.7 install and two new posts with "teste"
 meta_key and differente values.

 This query shows both:

 {{{#!php
 <?php
 $query = new WP_Query( array(
         'post_type'             => 'post',
         'meta_key'              => 'teste',
 ) );
 }}}

 But this don't show nothing:

 $query = new WP_Query( array(
 {{{#!php
 <?php
         'post_type'             => 'post',
         'meta_key'              => 'test%',
 ) );
 }}}

 Not even with LIKE compare:

 {{{#!php
 <?php
 $query = new WP_Query( array(
         'post_type'             => 'post',
         'meta_key'              => 'test%',
         'meta_compare'  => 'LIKE',
 ) );
 }}}

 (Same behaviour trying '%' in meta_value - LIKE compare is for them after
 all - and trying both tests in 4.8.3 version)

 Sorry if I misunderstood your point.

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


More information about the wp-trac mailing list