From 327d84d8f8e30da8741ac552c138a9e5dc0a6634 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Sat, 13 Mar 2010 06:59:07 +0000 Subject: [PATCH] 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 --- wp-includes/rewrite.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/wp-includes/rewrite.php b/wp-includes/rewrite.php index d80ad00e6d..804daf5433 100644 --- a/wp-includes/rewrite.php +++ b/wp-includes/rewrite.php @@ -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;