Add Endpoints for Attachments, Paging, Comment paging and custom Endpoints to custom post_type's. See #12597

git-svn-id: https://develop.svn.wordpress.org/trunk@13688 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse 2010-03-13 06:59:07 +00:00
parent af2148aaf0
commit 327d84d8f8
1 changed files with 10 additions and 0 deletions

View File

@ -1439,6 +1439,16 @@ class WP_Rewrite {
$page = true;
}
if ( ! $post ) {
// For custom post types, we need to add on endpoints as well.
foreach ( get_post_types( array('_builtin' => false ) ) as $ptype ) {
if ( strpos($struct, "%$ptype%") !== false ) {
$post = true;
$page = false;
}
}
}
//if we're creating rules for a permalink, do all the endpoints like attachments etc
if ($post) {
$post = true;