Search permalinks complete with feed and paging support.
git-svn-id: http://svn.automattic.com/wordpress/trunk@1540 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
17a630d374
commit
ba6ee1070a
|
@ -1206,7 +1206,8 @@ function generate_rewrite_rules($permalink_structure = '', $matches = '') {
|
||||||
'%post_id%',
|
'%post_id%',
|
||||||
'%category%',
|
'%category%',
|
||||||
'%author%',
|
'%author%',
|
||||||
'%pagename%'
|
'%pagename%',
|
||||||
|
'%search%'
|
||||||
);
|
);
|
||||||
|
|
||||||
$rewritereplace =
|
$rewritereplace =
|
||||||
|
@ -1222,6 +1223,7 @@ function generate_rewrite_rules($permalink_structure = '', $matches = '') {
|
||||||
'([/_0-9a-z-]+)',
|
'([/_0-9a-z-]+)',
|
||||||
'([_0-9a-z-]+)',
|
'([_0-9a-z-]+)',
|
||||||
'([_0-9a-z-]+)',
|
'([_0-9a-z-]+)',
|
||||||
|
'(.+)'
|
||||||
);
|
);
|
||||||
|
|
||||||
$queryreplace =
|
$queryreplace =
|
||||||
|
@ -1237,6 +1239,7 @@ function generate_rewrite_rules($permalink_structure = '', $matches = '') {
|
||||||
'category_name=',
|
'category_name=',
|
||||||
'author_name=',
|
'author_name=',
|
||||||
'pagename=',
|
'pagename=',
|
||||||
|
's='
|
||||||
);
|
);
|
||||||
|
|
||||||
$feedregex = '(feed|rdf|rss|rss2|atom)/?$';
|
$feedregex = '(feed|rdf|rss|rss2|atom)/?$';
|
||||||
|
@ -1363,6 +1366,10 @@ function rewrite_rules($matches = '', $permalink_structure = '') {
|
||||||
$sitepagematch => $sitepagequery,
|
$sitepagematch => $sitepagequery,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Search
|
||||||
|
$search_structure = $prefix . "search/%search%";
|
||||||
|
$search_rewrite = generate_rewrite_rules($search_structure, $matches);
|
||||||
|
|
||||||
// Categories
|
// Categories
|
||||||
if ( '' == get_settings('category_base') )
|
if ( '' == get_settings('category_base') )
|
||||||
$category_structure = $front . 'category/';
|
$category_structure = $front . 'category/';
|
||||||
|
@ -1381,7 +1388,7 @@ function rewrite_rules($matches = '', $permalink_structure = '') {
|
||||||
$page_rewrite = generate_rewrite_rules($page_structure, $matches);
|
$page_rewrite = generate_rewrite_rules($page_structure, $matches);
|
||||||
|
|
||||||
// Put them together.
|
// Put them together.
|
||||||
$rewrite = $site_rewrite + $page_rewrite + $category_rewrite + $author_rewrite;
|
$rewrite = $site_rewrite + $page_rewrite + $search_rewrite + $category_rewrite + $author_rewrite;
|
||||||
|
|
||||||
// Add on archive rewrite rules if needed.
|
// Add on archive rewrite rules if needed.
|
||||||
if ($doarchive) {
|
if ($doarchive) {
|
||||||
|
|
Loading…
Reference in New Issue