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?


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.

|improve this answer|||||
  • Worked great, and thanks for the additional information – tbwiii Apr 24 '13 at 1:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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