Created
January 1, 2014 17:32
-
-
Save michaelcarwile/8209798 to your computer and use it in GitHub Desktop.
Clear wordpress royalslider caches on post save
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//* Add this code to functions.php - ignore opening php tag and this comment. | |
//* Clear slider caches on new post save - replace num with slider id | |
function rs_clear_cache() { | |
delete_transient( 'new-royalslider-posts-1' ); | |
delete_transient( 'new-royalslider-posts-2' ); | |
delete_transient( 'new-royalslider-posts-3' ); | |
delete_transient( 'new-royalslider-posts-4' ); | |
} | |
add_action( 'save_post', 'rs_clear_cache' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment