0

I have an options page setup for a ticker tape on a theme I am working on. It has a number of options such as Title, number of posts to display and what categories to display posts from.

I have also set it up using a transient cache option. Obviously I need to delete the transient key when any of the options are updated. I can set each of the options callback functions to delete the key ok. But what I am wondering can I write a function and add a filter so that when Save Changes is clicked the transient is deleted, so I won't need to code into each of the callback functions to delete the transient key.

0

Right, jumped the gun again and just wasn't thinking.

You can delete the transient cache when sanitizing the options data.

When you create a function to sanitizing the options by adding in the code to delete the transient here, the transient is deleted when you click on save settings.

| improve this answer | |

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.