#26277 closed defect (bug) (invalid)
Codex entry on "register post type" has incorrect information
Reported by: | beowulfenator | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Permalinks | Keywords: | |
Focuses: | Cc: |
Description
The Codex entry on the "register_post_type" function contains inaccurate information about the "rewrite" argument.
In the entry, the fields are named 'feeds' and 'pages', whereas the correct parameters to the function "add_permastruct" that gets called eventually are 'feed' and 'paged'.
Change History (10)
#2
@
11 years ago
- Keywords needs-codex removed
- Resolution set to invalid
- Status changed from new to closed
#6
@
11 years ago
- Keywords needs-codex added
That article documents the parameters for register_post_type()
, not for add_permastruct()
.
For register_post_type()
, the parameters were correct.
As documented in the inline docs, it's feeds
and pages
there, not feed
and paged
:
tags/3.7.1/src/wp-includes/post.php#L1275
In line 1316, feeds
is mapped to feed
(see [24830] for #23302):
tags/3.7.1/src/wp-includes/post.php#L1315
Not sure why pages
is not mapped, but it appears to be handled above. Probably worth investigating further.
I've reverted the Codex change since it's incorrect.
#9
@
11 years ago
Oops. I was looking at 3.6.1, and there is no such mapping there. But I see it is fixed now. Thanks!
#10
@
11 years ago
I tested this with 3.7.1, and here's what I got:
If register_post_type for a custom post type named "deposits" with 'pages'=>false, the following two rules are created (among others):
individuals/deposits/([^/]+)/page/?([0-9]{1,})/?$ => index.php?deposit=$matches[1]&paged=$matches[2] individuals/deposits/([^/]+)(/[0-9]+)?/?$ => index.php?deposit=$matches[1]&page=$matches[2]
However, if I call it with 'paged'=>false, the first rule is not created.
I believe this is incorrect.
Are you talking about the rewrite section on this Codex entry http://codex.wordpress.org/Function_Reference/register_post_type? If so, you can edit the page (as with any Codex page) at its edit link which, for this page, can be found here.