4

In my plugin, I have a list of titles and permalinks in the options table. It's updated every time my custom post type is saved.

Since I'm saving permalinks the option data can become bad if the user changes their permalink structure.

I need a action that I can hook into that happens whenever the permalink structure is updated. Is there one?

1 Answer 1

7

The action is update_option_permalink_structure. You get the old and the new value as parameters.

add_action( 'update_option_permalink_structure' , 'my_custom_function', 10, 2 );

function my_custom_function( $oldvalue, $_newvalue )
{
    // do something
}

There are also the actions update_option_category_base and update_option_tag_base.

1
  • Worked great, and thanks for the additional information
    – tbwiii
    Commented Apr 24, 2013 at 1:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.