Rewrit endpoint fixes from westi. see #3964

git-svn-id: http://svn.automattic.com/wordpress/trunk@5130 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2007-03-29 00:17:40 +00:00
parent 9ca2d36ada
commit d92c0fa794
1 changed files with 10 additions and 10 deletions

View File

@ -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;