permalink_structure_changed

Fires after the permalink structure is updated.

Description

do_action( 'permalink_structure_changed', (string) $old_permalink_structure, (string) $permalink_structure ); 

Parameters (2)

0. $old_permalink_structure (string)
The previous permalink structure.
1. $permalink_structure (string)
The new permalink structure.

Usage

To run the hook, copy the example below.
  1. // run the action 
  2. do_action( 'permalink_structure_changed', $old_permalink_structure, $permalink_structure ); 
The following example is for adding a hook callback.
  1. // define the permalink_structure_changed callback 
  2. function action_permalink_structure_changed( $old_permalink_structure, $permalink_structure ) { 
  3. // make action magic happen here... 
  4. }; 
  5.  
  6. // add the action 
  7. add_action( 'permalink_structure_changed', 'action_permalink_structure_changed', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the action 
  2. remove_action( 'permalink_structure_changed', 'action_permalink_structure_changed', 10, 2 ); 

Defined (1)

The action is defined in the following location(s).

/wp-includes/class-wp-rewrite.php  
  1. do_action( 'permalink_structure_changed', $old_permalink_structure, $permalink_structure );