From 356592efa74eeaa09bed5b7a49e3d5f0776fe4ce Mon Sep 17 00:00:00 2001 From: Peter Westwood Date: Thu, 14 May 2009 06:38:34 +0000 Subject: [PATCH] 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: https://develop.svn.wordpress.org/trunk@11325 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/rewrite.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wp-includes/rewrite.php b/wp-includes/rewrite.php index 23e1bac0f6..fe5b4ad47a 100644 --- a/wp-includes/rewrite.php +++ b/wp-includes/rewrite.php @@ -1840,6 +1840,9 @@ class WP_Rewrite { * Will update the 'permalink_structure' option, if there is a difference * 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); } }