Add a permalink_structure_changed action to allow plugins to do something once the new structure has been applied to WP_Rewrite.
git-svn-id: http://svn.automattic.com/wordpress/trunk@11325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
0d81b0ea1a
commit
55ce914fbc
|
@ -1841,6 +1841,9 @@ class WP_Rewrite {
|
|||
* between the current permalink structure and the parameter value. Calls
|
||||
* {@link WP_Rewrite::init()} after the option is updated.
|
||||
*
|
||||
* Fires the 'permalink_structure_changed' action once the init call has
|
||||
* processed passing the old and new values
|
||||
*
|
||||
* @since 1.5.0
|
||||
* @access public
|
||||
*
|
||||
|
@ -1850,6 +1853,7 @@ class WP_Rewrite {
|
|||
if ($permalink_structure != $this->permalink_structure) {
|
||||
update_option('permalink_structure', $permalink_structure);
|
||||
$this->init();
|
||||
do_action('permalink_structure_changed', $this->permalink_structure, $permalink_structure);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue