WordPress.org

Make WordPress Core

Changes between Initial Version and Version 4 of Ticket #19525


Ignore:
Timestamp:
12/13/2011 03:16:08 AM (6 years ago)
Author:
scribu
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #19525

    • Property Cc xoodrew@… added
    • Property Severity changed from major to normal
  • Ticket #19525 – Description

    initial v4  
    44
    55{{{
    6 object(WP_Query)#1337 (44) {
    7   ["query_vars"]=>
    8   array(58) {
    9     ["category_name"]=>
    10     string(3) "customcat"
    11     ["post_status"]=>
    12     string(7) "publish"
    13     ["meta_key"]=>
    14     string(13) "time"
    15     ["meta_value"]=>
    16     string(9) "135784684"
    17     ["meta_type"]=>
    18     string(7) "numeric"
    19     ["meta_compare"]=>
    20     string(11) "NOT BETWEEN"
    21     ["error"]=>
    22     string(0) ""
    23     ["m"]=>
    24     int(0)
    25     ["p"]=>
    26     int(0)
    27     ["post_parent"]=>
    28     string(0) ""
    29     ["subpost"]=>
    30     string(0) ""
    31     ["subpost_id"]=>
    32     string(0) ""
    33     ["attachment"]=>
    34     string(0) ""
    35     ["attachment_id"]=>
    36     int(0)
    37     ["name"]=>
    38     string(0) ""
    39     ["static"]=>
    40     string(0) ""
    41     ["pagename"]=>
    42     string(0) ""
    43     ["page_id"]=>
    44     int(0)
    45     ["second"]=>
    46     string(0) ""
    47     ["minute"]=>
    48     string(0) ""
    49     ["hour"]=>
    50     string(0) ""
    51     ["day"]=>
    52     int(0)
    53     ["monthnum"]=>
    54     int(0)
    55     ["year"]=>
    56     int(0)
    57     ["w"]=>
    58     int(0)
    59     ["tag"]=>
    60     string(0) ""
    61     ["cat"]=>
    62     string(1) "7"
    63     ["tag_id"]=>
    64     string(0) ""
    65     ["author_name"]=>
    66     string(0) ""
    67     ["feed"]=>
    68     string(0) ""
    69     ["tb"]=>
    70     string(0) ""
    71     ["paged"]=>
    72     int(0)
    73     ["comments_popup"]=>
    74     string(0) ""
    75     ["preview"]=>
    76     string(0) ""
    77     ["s"]=>
    78     string(0) ""
    79     ["sentence"]=>
    80     string(0) ""
    81     ["fields"]=>
    82     string(0) ""
    83     ["category__in"]=>
    84     array(0) {
    85     }
    86     ["category__not_in"]=>
    87     array(0) {
    88     }
    89     ["category__and"]=>
    90     array(0) {
    91     }
    92     ["post__in"]=>
    93     array(0) {
    94     }
    95     ["post__not_in"]=>
    96     array(0) {
    97     }
    98     ["tag__in"]=>
    99     array(0) {
    100     }
    101     ["tag__not_in"]=>
    102     array(0) {
    103     }
    104     ["tag__and"]=>
    105     array(0) {
    106     }
    107     ["tag_slug__in"]=>
    108     array(0) {
    109     }
    110     ["tag_slug__and"]=>
    111     array(0) {
    112     }
    113     ["ignore_sticky_posts"]=>
    114     bool(false)
    115     ["suppress_filters"]=>
    116     bool(false)
    117     ["cache_results"]=>
    118     bool(true)
    119     ["update_post_term_cache"]=>
    120     bool(true)
    121     ["update_post_meta_cache"]=>
    122     bool(true)
    123     ["post_type"]=>
    124     string(0) ""
    125     ["posts_per_page"]=>
    126     int(10)
    127     ["nopaging"]=>
    128     bool(false)
    129     ["comments_per_page"]=>
    130     string(2) "50"
    131     ["no_found_rows"]=>
    132     bool(false)
    133     ["order"]=>
    134     string(4) "DESC"
    135   }
    136   ["tax_query"]=>
    137   object(WP_Tax_Query)#1337 (2) {
    138     ["queries"]=>
    139     array(1) {
    140       [0]=>
    141       array(5) {
    142         ["taxonomy"]=>
    143         string(8) "category"
    144         ["terms"]=>
    145         array(1) {
    146           [0]=>
    147           string(3) "customcat"
    148         }
    149         ["include_children"]=>
    150         bool(true)
    151         ["field"]=>
    152         string(4) "slug"
    153         ["operator"]=>
    154         string(2) "IN"
    155       }
    156     }
    157     ["relation"]=>
    158     string(3) "AND"
    159   }
    160   ["meta_query"]=>
    161   object(WP_Meta_Query)#1337 (2) {
    162     ["queries"]=>
    163     array(1) {
    164       [0]=>
    165       array(4) {
    166         ["key"]=>
    167         string(13) "time"
    168         ["compare"]=>
    169         string(11) "NOT BETWEEN"
    170         ["type"]=>
    171         string(7) "numeric"
    172         ["value"]=>
    173         string(9) "135784684"
    174       }
    175     }
    176     ["relation"]=>
    177     string(3) "AND"
    178   }
    179   ["post_count"]=>
    180   int(0)
    181   ["current_post"]=>
    182   int(-1)
    183   ["in_the_loop"]=>
    184   bool(false)
    185   ["comment_count"]=>
    186   int(0)
    187   ["current_comment"]=>
    188   int(-1)
    189   ["found_posts"]=>
    190   string(1) "1"
    191   ["max_num_pages"]=>
    192   float(1)
    193   ["max_num_comment_pages"]=>
    194   int(0)
    195   ["is_single"]=>
    196   bool(false)
    197   ["is_preview"]=>
    198   bool(false)
    199   ["is_page"]=>
    200   bool(false)
    201   ["is_archive"]=>
    202   bool(true)
    203   ["is_date"]=>
    204   bool(false)
    205   ["is_year"]=>
    206   bool(false)
    207   ["is_month"]=>
    208   bool(false)
    209   ["is_day"]=>
    210   bool(false)
    211   ["is_time"]=>
    212   bool(false)
    213   ["is_author"]=>
    214   bool(false)
    215   ["is_category"]=>
    216   bool(true)
    217   ["is_tag"]=>
    218   bool(false)
    219   ["is_tax"]=>
    220   bool(false)
    221   ["is_search"]=>
    222   bool(false)
    223   ["is_feed"]=>
    224   bool(false)
    225   ["is_comment_feed"]=>
    226   bool(false)
    227   ["is_trackback"]=>
    228   bool(false)
    229   ["is_home"]=>
    230   bool(false)
    231   ["is_404"]=>
    232   bool(false)
    233   ["is_comments_popup"]=>
    234   bool(false)
    235   ["is_paged"]=>
    236   bool(false)
    237   ["is_admin"]=>
    238   bool(false)
    239   ["is_attachment"]=>
    240   bool(false)
    241   ["is_singular"]=>
    242   bool(false)
    243   ["is_robots"]=>
    244   bool(false)
    245   ["is_posts_page"]=>
    246   bool(false)
    247   ["is_post_type_archive"]=>
    248   bool(false)
    249   ["query_vars_hash"]=>
    250   string(32) "5481e968160b92320b359a1818596c83"
    251   ["query_vars_changed"]=>
    252   bool(false)
    253   ["thumbnails_cached"]=>
    254   bool(false)
    255   ["query"]=>
    256   array(6) {
    257     ["category_name"]=>
    258     string(3) "customcat"
    259     ["post_status"]=>
    260     string(7) "publish"
    261     ["meta_key"]=>
    262     string(13) "time"
    263     ["meta_value"]=>
    264     string(9) "135784684"
    265     ["meta_type"]=>
    266     string(7) "numeric"
    267     ["meta_compare"]=>
    268     string(11) "NOT BETWEEN"
    269   }
    270   ["request"]=>
    271   string(469) " SELECT SQL_CALC_FOUND_ROWS  * FROM posts  INNER JOIN term_relationships ON (ID = term_relationships.object_id) INNER JOIN postmeta ON (ID = postmeta.post_id) WHERE 1=1  AND ( term_relationships.term_taxonomy_id IN (1) ) AND post_type = 'post' AND (post_status = 'publish') AND ( (postmeta.meta_key = 'time' AND  ) GROUP BY ID ORDER BY post_date DESC LIMIT 0, 10"
    272   ["posts"]=>
    273   array(0) {
    274   }
    275 }
     6SELECT SQL_CALC_FOUND_ROWS  *
     7FROM posts  INNER JOIN term_relationships ON (ID = term_relationships.object_id) INNER JOIN postmeta ON (ID = postmeta.post_id)
     8WHERE 1=1  AND ( term_relationships.term_taxonomy_id IN (1) ) AND post_type = 'post' AND (post_status = 'publish') AND ( (postmeta.meta_key = 'time' AND  ) GROUP BY ID ORDER BY post_date DESC LIMIT 0, 10
    2769}}}
    277 
    27810
    27911As you can see the meta query only inputs the meta_key and not the meta value/compare operator and as such the query ends up invalid.
    28012
    281 If it matters (all the vars are above, but still) this is how the query is getting called:
    282 
     13This is how the query is getting called:
    28314
    28415{{{