Rewrite and %category% fixes.

git-svn-id: https://develop.svn.wordpress.org/trunk@1388 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2004-06-06 02:02:27 +00:00
parent af20c0a630
commit 44d532c6e3
2 changed files with 12 additions and 4 deletions
+6 -2
View File
@@ -1238,7 +1238,10 @@ function generate_rewrite_rules($permalink_structure = '', $matches = '') {
$queries[$i] .= $query_token;
}
$structure = str_replace($front, '', $permalink_structure);
$structure = $permalink_structure;
if ($front != '/') {
$structure = str_replace($front, '', $structure);
}
$structure = trim($structure, '/');
$dirs = explode('/', $structure);
$num_dirs = count($dirs);
@@ -1312,7 +1315,8 @@ function rewrite_rules($matches = '', $permalink_structure = '') {
// If the permalink does not have year, month, and day, we need to create a
// separate archive rule.
$doarchive = false;
if (! (strstr($permalink_structure, '%year') && strstr($permalink_structure, '%monthnum') && strstr($permalink_structure, '%day')) ) {
if (! (strstr($permalink_structure, '%year%') && strstr($permalink_structure, '%monthnum%') && strstr($permalink_structure, '%day%')) ||
preg_match('/%category%.*(%year%|%monthnum%|%day%)/', $permalink_structure)) {
$doarchive = true;
$archive_structure = $front . '%year%/%monthnum%/%day%/';
$archive_rewrite = generate_rewrite_rules($archive_structure, $matches);