Changeset 1381 for trunk/wp-includes/functions.php
- Timestamp:
- 06/02/2004 05:16:44 AM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions.php
r1376 r1381 1175 1175 } 1176 1176 1177 function generate_rewrite_rules($permalink_structure = '' ) {1177 function generate_rewrite_rules($permalink_structure = '', $matches = '') { 1178 1178 $rewritecode = 1179 1179 array( … … 1200 1200 '([_0-9a-z-]+)', 1201 1201 '([0-9]+)', 1202 '( .*)',1202 '([/_0-9a-z-]+)', 1203 1203 '([_0-9a-z-]+)' 1204 1204 ); … … 1268 1268 $query = $index . '?' . $query . '&page=' . preg_index($num_toks + 1, $matches); 1269 1269 } else { 1270 $match .= '? ';1270 $match .= '?$'; 1271 1271 $query = $index . '?' . $query; 1272 1272 } … … 1299 1299 } 1300 1300 1301 $post_rewrite = generate_rewrite_rules($permalink_structure); 1301 $post_rewrite = generate_rewrite_rules($permalink_structure, $matches); 1302 1303 $feedregex = '(feed|rdf|rss|rss2|atom)/?$'; 1304 $pageregex = 'page/?([0-9]{1,})/?$'; 1305 $front = substr($permalink_structure, 0, strpos($permalink_structure, '%')); 1302 1306 1303 1307 // If the permalink does not have year, month, and day, we need to create a … … 1307 1311 $doarchive = true; 1308 1312 $archive_structure = $front . '%year%/%monthnum%/%day%/'; 1309 $archive_rewrite = generate_rewrite_rules($archive_structure); 1310 } 1311 1312 $feedregex = '(feed|rdf|rss|rss2|atom)/?$'; 1313 $pageregex = 'page/?([0-9]{1,})/?$'; 1314 $front = substr($permalink_structure, 0, strpos($permalink_structure, '%')); 1313 $archive_rewrite = generate_rewrite_rules($archive_structure, $matches); 1314 } 1315 1315 1316 1316 // Site feed … … 1339 1339 1340 1340 $category_structure = $category_structure . '%category%'; 1341 $category_rewrite = generate_rewrite_rules($category_structure );1341 $category_rewrite = generate_rewrite_rules($category_structure, $matches); 1342 1342 1343 1343 // Authors 1344 1344 $author_structure = $front . 'author/%author%'; 1345 $author_rewrite = generate_rewrite_rules($author_structure );1345 $author_rewrite = generate_rewrite_rules($author_structure, $matches); 1346 1346 1347 1347 // Put them together. 1348 $rewrite = $site_rewrite + $category_rewrite + $author_rewrite + $post_rewrite;1348 $rewrite = $site_rewrite + $category_rewrite + $author_rewrite; 1349 1349 1350 1350 // Add on archive rewrite rules if needed. … … 1352 1352 $rewrite = $rewrite + $archive_rewrite; 1353 1353 } 1354 1355 $rewrite = $rewrite + $post_rewrite; 1354 1356 1355 1357 return $rewrite;
Note: See TracChangeset
for help on using the changeset viewer.