Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Clear transient on post save
<?php
function yournamespace_delete_transient( $post_id, $post, $update ) {
delete_transient('yournamespace_data_example');
}
//{your_post_type} with a custom post type
add_action('save_post_{your_post_type}', 'yournamespace_delete_transient', 10, 3);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.