mirror of
https://github.com/WordPress/WordPress.git
synced 2025-03-10 22:06:55 +01:00
Add generate_rewrite_rule().
git-svn-id: http://svn.automattic.com/wordpress/trunk@1973 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
71e989b683
commit
b3a3894b2a
@ -922,7 +922,11 @@ class WP_Rewrite {
|
|||||||
$structure = str_replace($front, '', $structure);
|
$structure = str_replace($front, '', $structure);
|
||||||
}
|
}
|
||||||
$structure = trim($structure, '/');
|
$structure = trim($structure, '/');
|
||||||
$dirs = explode('/', $structure);
|
if ($walk_dirs) {
|
||||||
|
$dirs = explode('/', $structure);
|
||||||
|
} else {
|
||||||
|
$dirs[] = $structure;
|
||||||
|
}
|
||||||
$num_dirs = count($dirs);
|
$num_dirs = count($dirs);
|
||||||
|
|
||||||
$front = preg_replace('|^/+|', '', $front);
|
$front = preg_replace('|^/+|', '', $front);
|
||||||
@ -983,6 +987,10 @@ class WP_Rewrite {
|
|||||||
return $post_rewrite;
|
return $post_rewrite;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function generate_rewrite_rule($permalink_structure, $walk_dirs = false) {
|
||||||
|
return $this->generate_rewrite_rules($permalink_structure, false, false, false, $walk_dirs);
|
||||||
|
}
|
||||||
|
|
||||||
/* rewrite_rules
|
/* rewrite_rules
|
||||||
* Construct rewrite matches and queries from permalink structure.
|
* Construct rewrite matches and queries from permalink structure.
|
||||||
* Returns an associate array of matches and queries.
|
* Returns an associate array of matches and queries.
|
||||||
|
Loading…
Reference in New Issue
Block a user