Add generate_rewrite_rule().
git-svn-id: https://develop.svn.wordpress.org/trunk@1973 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
0971447cf6
commit
09d522246e
|
@ -922,7 +922,11 @@ class WP_Rewrite {
|
|||
$structure = str_replace($front, '', $structure);
|
||||
}
|
||||
$structure = trim($structure, '/');
|
||||
if ($walk_dirs) {
|
||||
$dirs = explode('/', $structure);
|
||||
} else {
|
||||
$dirs[] = $structure;
|
||||
}
|
||||
$num_dirs = count($dirs);
|
||||
|
||||
$front = preg_replace('|^/+|', '', $front);
|
||||
|
@ -983,6 +987,10 @@ class WP_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
|
||||
* Construct rewrite matches and queries from permalink structure.
|
||||
* Returns an associate array of matches and queries.
|
||||
|
|
Loading…
Reference in New Issue