Created
December 14, 2017 12:22
-
-
Save Netzberufler/694e8b966e390ac865360e9bdc1be2fc to your computer and use it in GitHub Desktop.
Reset Featured Content Cache on WordPress.com
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 | |
/* | |
Plugin Name: ThemeZee Featured Content Cache Reset | |
Plugin URI: https://themezee.com | |
Description: Resets the transient caching for featured posts on WordPress.com | |
Author: ThemeZee | |
Author URI: https://themezee.com/ | |
Version: 1.0 | |
Text Domain: themezee-featured-content-cache-reset | |
License: GPL v3 | |
License URI: http://www.gnu.org/licenses/gpl-3.0.html | |
*/ | |
// Exit if accessed directly. | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; | |
} | |
if ( ! function_exists( 'themezee_featured_content_cache_reset' ) ) : | |
/** | |
* Invalidates the WordPress.com Transient Cache for Featured Posts | |
* | |
*/ | |
function themezee_featured_content_cache_reset() { | |
delete_transient( 'featured_content_ids' ); | |
} | |
endif; | |
add_action( 'after_setup_theme', 'themezee_featured_content_cache_reset' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment