[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
Fri Apr 10 02:42:31 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 mordauk):
Replying to [comment:28 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.
That sounds like a good approach to me.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/25143#comment:29>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list