[wp-trac] [WordPress Trac] #21335: add_rewrite_endpoint() malfunction
WordPress Trac
wp-trac at lists.automattic.com
Sun Jul 22 02:45:45 UTC 2012
#21335: add_rewrite_endpoint() malfunction
---------------------------+------------------------------
Reporter: Fike | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Rewrite Rules | Version: 3.4.1
Severity: minor | Resolution:
Keywords: |
---------------------------+------------------------------
Comment (by SergeyBiryukov):
Point 1 also applies to `add_feed()` (#4619, #20431) and the other Rewrite
API functions, I suppose). There's a note in the
[http://codex.wordpress.org/Rewrite_API Codex article]:
Note that these rules are usually called inside the init hook.
I could not reproduce point 2. My steps:
1. Copy the example from Codex into a function:
{{{
function add_json_rewrite_endpoint() {
add_rewrite_endpoint( 'json', EP_PERMALINK | EP_PAGES );
}
add_action( 'init', 'add_json_rewrite_endpoint' );
}}}
2. Flush rewrite rules by visiting Permalink Settings screen.
3. A post with the endpoint (e.g. /2008/02/hello-world/json/) is properly
displayed, without a 404 error.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/21335#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list