[wp-trac] [WordPress Trac] #31781: Adding a query parameter that has same name as a CPT returns 404

WordPress Trac noreply at wordpress.org
Thu Sep 3 09:54:31 UTC 2015


#31781: Adding a query parameter that has same name as a CPT returns 404
---------------------------+------------------------------
 Reporter:  Collizo4sky    |       Owner:
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  Rewrite Rules  |     Version:  4.1.1
 Severity:  normal         |  Resolution:
 Keywords:  dev-feedback   |     Focuses:
---------------------------+------------------------------
Changes (by flixos90):

 * keywords:   => dev-feedback
 * component:  Posts, Post Types => Rewrite Rules


Comment:

 Hello @Collizo4sky, and thank you for the report. The issue you're having
 happens since the `demo` parameter in the URL is assumed to be the query
 var for the post type of the same name, you're right with the code example
 you mentioned.

 When the `%demo%` rewrite tag is added, that URL parameter is basically
 reserved by WordPress and cannot used in any other way. I'm not familiar
 enough with rewrites to judge whether this can or cannot be resolved -
 maybe it is possible to adjust the regular expression so the parameter is
 not considered a post type parameter if the value definitely does not
 apply to the intended usage. I'll move this to the Rewrites section for
 now.

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


More information about the wp-trac mailing list