[wp-trac] [WordPress Trac] #60269: URL parameter filtering with 'tag' parameter

WordPress Trac noreply at wordpress.org
Tue Jan 16 18:00:42 UTC 2024


#60269: URL parameter filtering with 'tag' parameter
--------------------------+-----------------------------
 Reporter:  harolair      |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Taxonomy      |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Specifically why is the tag url filtering locked behind this check for
 $this->query_vars_changed. Seems like this could be removed from the
 condition to me.
 This means post archive filtering using the tag url parameter doesn't work
 by default.
 But if for example any query_var is changed in the 'pre_get_posts' filter
 it suddenly does work. Even if the query_var changed is entirely
 unrelated.


 wp-includes/class-wp-query.php


 {{{
 class WP_Query {
   ...
   public function parse_tax_query( &$q ) {
     ...
     if ( '' !== $q['tag'] && ! $this->is_singular &&
 $this->query_vars_changed ) {
        ...
     }
     ...
   }
   ...
 }
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/60269>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list