get_cache()->delete_data(); MonsterInsights_Popular_Posts_Widget()->get_cache()->delete_data(); if ( monsterinsights_is_pro_version() ) { MonsterInsights_Popular_Posts_Products()->get_cache()->delete_data(); } } /** * Trigger when post status is changed. */ public function transition_post_status( $new_status, $old_status ) { // A post goes to any status from published. if ( $old_status == 'publish' && $new_status != 'publish' ) { $this->clear_cache(); } // A post is being to published. if ( $new_status == 'publish' && $old_status != 'publish' ) { $this->clear_cache(); } } } // Initiate here so that we can run hooks. MonsterInsights_Popular_Posts_Helper::get_instance();