[wp-trac] [WordPress Trac] #15178: Empty endpoint same as missing endpoint: empty vs isset query_var.
WordPress Trac
wp-trac at lists.automattic.com
Mon Nov 7 17:01:38 UTC 2011
#15178: Empty endpoint same as missing endpoint: empty vs isset query_var.
------------------------------------+------------------------------
Reporter: 5ubliminal | Owner: johnbillion
Type: defect (bug) | Status: accepted
Priority: normal | Milestone: Awaiting Review
Component: Query | Version: 3.0.1
Severity: normal | Resolution:
Keywords: has-patch dev-feedback |
------------------------------------+------------------------------
Changes (by johnbillion):
* keywords: => has-patch dev-feedback
Comment:
Here's my take on this. To allow an empty endpoint (ie. an endpoint with
no trailing value) we need to set the endpoint's query var to something
suitable when the endpoint is present but empty.
In the attached patch I've opted to use string 'true' for empty endpoints.
`add_rewrite_endpoint()` gets an optional third parameter, `$allow_empty`,
which tells WP_Rerite to set the endpoint query var to string 'true' when
it's empty. The addition of this parameter maintains backwards
compatibilty with anything that's using `add_rewrite_endpoint()` and not
expecting an empty endpoint to have a value.
Inline docs have also been updated.
Feedback welcome.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/15178#comment:7>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list