Last active
February 27, 2020 11:55
-
-
Save kellenmace/938ef95049819b6a1978422d41ea2d7f to your computer and use it in GitHub Desktop.
This file contains 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 | |
function delete_all_post_count_transients() { | |
$post_types = get_post_types(); | |
$years = get_all_possible_years(); | |
$months = get_all_possible_months(); | |
foreach ( $post_types as $post_type ) { | |
foreach ( $years as $year ) { | |
foreach ( $months as $month ) { | |
$transient_key = "km_post_count_{$post_type}_{$year}_{$month}"; | |
delete_transient( $transient_key ); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment