[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 Apr 9 22:46:43 UTC 2015


#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
Component:  Query                              |  Release
 Severity:  normal                             |     Version:  3.6
 Keywords:  has-patch needs-testing 4.3-early  |  Resolution:
                                               |     Focuses:
-----------------------------------------------+---------------------------

Comment (by boonebgorges):

 Replying to [comment:26 johnbillion]:
 > It would make more sense to use the existing `$query_var` parameter for
 this, rather than introducing a fourth parameter. It could accept boolean
 false to disable the query var. With [attachment:25143.3.patch],
 registering an endpoint with no query var requires that you pass in a
 useless value to the `$query_var` parameter.

 Yeah, I was thinking something similar. The only odd part about this is
 that passing `null` would have the opposite effect of passing `false`,
 which feels strange.

 Alternatively, we could change the default value from `null` to `true`,
 and fall back on `$name` when `true === $query_var`. This would break
 backward compatibility for anyone who is literally passing `null` to the
 function: `add_rewrite_endpoint( $foo, $bar, null )`. But ten bucks says
 that no one is doing that.

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


More information about the wp-trac mailing list