[wp-trac] [WordPress Trac] #25143: Appending registered query vars to home URL sets is_home to true when should be false

WordPress Trac noreply at wordpress.org
Thu Oct 16 02:21:43 UTC 2014


#25143: Appending registered query vars to home URL sets is_home to true when
should be false
------------------------------------------+-----------------------------
 Reporter:  mordauk                       |       Owner:
     Type:  defect (bug)                  |      Status:  reopened
 Priority:  normal                        |   Milestone:  Future Release
Component:  Query                         |     Version:  3.6
 Severity:  normal                        |  Resolution:
 Keywords:  needs-patch needs-unit-tests  |     Focuses:
------------------------------------------+-----------------------------

Comment (by mordauk):

 I just ran into this in the
 [https://github.com/affiliatewp/AffiliateWP/issues/423 wild again].

 In AffiliateWP, we allow use a URL variable to detect when an affiliate's
 URL is being used. The URL looks something like this:
 `http://site.com/?ref=1`

 That is all well and good and works just fine, so long as we don't
 register `ref` as an actual query arg.

 We recently added "pretty" affiliate URL support by adding an endpoint:
 `add_rewrite_endpoint( $this->get_referral_var(), EP_ALL );`

 This results in `http://site.com/?ref=1` and `http://site.com/ref/1`
 loading the blog page since `is_home` gets set to true.

 `http://site.com/page-name/?ref=1` and `http://site.com/page-name/ref/1`
 continue to work just fine though.

 I'm going to dig back into it to see if I can work up a patch.

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


More information about the wp-trac mailing list