Changeset 1388
- Timestamp:
- 06/06/2004 02:02:27 AM (22 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 2 edited
-
functions.php (modified) (2 diffs)
-
template-functions-links.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions.php
r1382 r1388 1239 1239 } 1240 1240 1241 $structure = str_replace($front, '', $permalink_structure); 1241 $structure = $permalink_structure; 1242 if ($front != '/') { 1243 $structure = str_replace($front, '', $structure); 1244 } 1242 1245 $structure = trim($structure, '/'); 1243 1246 $dirs = explode('/', $structure); … … 1313 1316 // separate archive rule. 1314 1317 $doarchive = false; 1315 if (! (strstr($permalink_structure, '%year') && strstr($permalink_structure, '%monthnum') && strstr($permalink_structure, '%day')) ) { 1318 if (! (strstr($permalink_structure, '%year%') && strstr($permalink_structure, '%monthnum%') && strstr($permalink_structure, '%day%')) || 1319 preg_match('/%category%.*(%year%|%monthnum%|%day%)/', $permalink_structure)) { 1316 1320 $doarchive = true; 1317 1321 $archive_structure = $front . '%year%/%monthnum%/%day%/'; -
trunk/wp-includes/template-functions-links.php
r1385 r1388 81 81 // If the permalink structure does not contain year and month, make 82 82 // one that does. 83 if (! (strstr($permalink, '%year') && strstr($permalink, '%monthnum')) ) { 83 if (! (strstr($permalink, '%year%') && strstr($permalink, '%monthnum%')) 84 || preg_match('/%category%.*(%year%|%monthnum%|%day%)/', $permalink)) { 84 85 $front = substr($permalink, 0, strpos($permalink, '%')); 85 86 $permalink = $front . '%year%/%monthnum%/'; … … 93 94 $monthlink = str_replace('%monthnum%', zeroise(intval($month), 2), $monthlink); 94 95 $monthlink = str_replace('%post_id%', '', $monthlink); 96 $monthlink = str_replace('%category%', '', $monthlink); 95 97 return get_settings('home') . $monthlink; 96 98 } else { … … 109 111 // If the permalink structure does not contain year, month, and day, 110 112 // make one that does. 111 if (! (strstr($permalink, '%year') && strstr($permalink, '%monthnum')) ) { 113 if (! (strstr($permalink, '%year%') && strstr($permalink, '%monthnum%')&& strstr($permalink, '%day%')) 114 || preg_match('/%category%.*(%year%|%monthnum%|%day%)/', $permalink)) { 112 115 $front = substr($permalink, 0, strpos($permalink, '%')); 113 116 $permalink = $front . '%year%/%monthnum%/%day%/'; … … 122 125 $daylink = str_replace('%day%', zeroise(intval($day), 2), $daylink); 123 126 $daylink = str_replace('%post_id%', '', $daylink); 127 $daylink = str_replace('%category%', '', $daylink); 124 128 return get_settings('home') . $daylink; 125 129 } else {
Note: See TracChangeset
for help on using the changeset viewer.