Changeset 1373 for trunk/wp-includes/template-functions-links.php
- Timestamp:
- 05/31/2004 05:22:25 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/template-functions-links.php
r1355 r1373 84 84 if (!$month) $month = gmdate('m', time()+(get_settings('gmt_offset') * 3600)); 85 85 if ('' != get_settings('permalink_structure')) { 86 $off = strpos(get_settings('permalink_structure'), '%monthnum%'); 86 $permalink = get_settings('permalink_structure'); 87 88 // If the permalink structure does not contain year and month, make 89 // one that does. 90 if (! (strstr($permalink, '%year') && strstr($permalink, '%monthnum')) ) { 91 $front = substr($permalink, 0, strpos($permalink, '%')); 92 $permalink = $front . '%year%/%monthnum%/'; 93 } 94 95 $off = strpos($permalink, '%monthnum%'); 87 96 $offset = $off + 11; 88 $monthlink = substr( get_settings('permalink_structure'), 0, $offset);97 $monthlink = substr($permalink, 0, $offset); 89 98 if ('/' != substr($monthlink, -1)) $monthlink = substr($monthlink, 0, -1); 90 99 $monthlink = str_replace('%year%', $year, $monthlink); … … 103 112 if (!$day) $day = gmdate('j', time()+(get_settings('gmt_offset') * 3600)); 104 113 if ('' != get_settings('permalink_structure')) { 105 $off = strpos(get_settings('permalink_structure'), '%day%'); 114 $permalink = get_settings('permalink_structure'); 115 116 // If the permalink structure does not contain year, month, and day, 117 // make one that does. 118 if (! (strstr($permalink, '%year') && strstr($permalink, '%monthnum')) ) { 119 $front = substr($permalink, 0, strpos($permalink, '%')); 120 $permalink = $front . '%year%/%monthnum%/%day%/'; 121 } 122 123 $off = strpos($permalink, '%day%'); 106 124 $offset = $off + 6; 107 $daylink = substr( get_settings('permalink_structure'), 0, $offset);125 $daylink = substr($permalink, 0, $offset); 108 126 if ('/' != substr($daylink, -1)) $daylink = substr($daylink, 0, -1); 109 127 $daylink = str_replace('%year%', $year, $daylink);
Note: See TracChangeset
for help on using the changeset viewer.