[wp-trac] [WordPress Trac] #30018: 404 error and redirect when using url with query string

WordPress Trac noreply at wordpress.org
Tue Sep 15 18:32:52 UTC 2015


#30018: 404 error and redirect when using url with query string
-------------------------------+------------------
 Reporter:  pmwp               |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  4.4
Component:  Posts, Post Types  |     Version:  4.0
 Severity:  normal             |  Resolution:
 Keywords:  has-patch          |     Focuses:
-------------------------------+------------------
Changes (by wonderboymusic):

 * keywords:  has-patch dev-feedback => has-patch


Comment:

 In [attachment:30018.2.diff 30018.2.diff], non-viewable post types
 shouldn't have their query vars parsed in `WP::parse_request()`. Unit test
 (surprise, surprise) demonstrates this behavior. If you parse their query
 vars, and the var does not actually exist to represent that item, the
 request goes 404. The default value for `query_var` is `true`, which means
 it will be set to `$post_type` if you don't specify something else.
 `register_post_type()` then indiscriminately adds it to
 `WP::public_query_vars`

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


More information about the wp-trac mailing list