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;