From d92c0fa7946435e274d2732d16879d692e44f2ff Mon Sep 17 00:00:00 2001 From: ryan Date: Thu, 29 Mar 2007 00:17:40 +0000 Subject: [PATCH] Rewrit endpoint fixes from westi. see #3964 git-svn-id: http://svn.automattic.com/wordpress/trunk@5130 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/rewrite.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/wp-includes/rewrite.php b/wp-includes/rewrite.php index 06f8a16f0..93046e59f 100644 --- a/wp-includes/rewrite.php +++ b/wp-includes/rewrite.php @@ -582,6 +582,16 @@ class WP_Rewrite { if ($paged) //...and /page/xx ones $rewrite = array_merge($rewrite, array($pagematch => $pagequery)); + //do endpoints + if ($endpoints) { + foreach ($ep_query_append as $regex => $ep) { + //add the endpoints on if the mask fits + if ($ep[0] & $ep_mask || $ep[0] & $ep_mask_specific) { + $rewrite[$match . $regex] = $index . '?' . $query . $ep[1] . $this->preg_index($num_toks + 2); + } + } + } + //if we've got some tags in this dir if ($num_toks) { $post = false; @@ -599,16 +609,6 @@ class WP_Rewrite { $page = true; } - //do endpoints - if ($endpoints) { - foreach ($ep_query_append as $regex => $ep) { - //add the endpoints on if the mask fits - if ($ep[0] & $ep_mask || $ep[0] & $ep_mask_specific) { - $rewrite[$match . $regex] = $index . '?' . $query . $ep[1] . $this->preg_index($num_toks + 2); - } - } - } - //if we're creating rules for a permalink, do all the endpoints like attachments etc if ($post) { $post = true;