mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
Rewrite and %category% fixes.
git-svn-id: https://develop.svn.wordpress.org/trunk@1388 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user