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:
parent
9ca2d36ada
commit
d92c0fa794
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue