Files
szkoleniauryzaj.pl/wp-content/plugins/youtube-feed-pro/inc/Services/Admin/CacheService.php
2026-04-26 23:47:49 +02:00

24 lines
549 B
PHP

<?php
namespace SmashBalloon\YouTubeFeed\Services\Admin;
use Smashballoon\Stubs\Services\ServiceProvider;
use SmashBalloon\YouTubeFeed\Helpers\Util;
class CacheService extends ServiceProvider {
public function register() {
add_action( 'wp_ajax_sby_clear_cache', [ $this, 'ajax_clear_cache' ] );
}
public function ajax_clear_cache() {
Util::ajaxPreflightChecks();
// clear object cache
sby_clear_object_cache();
// clear transients
sby_clear_cache();
wp_clear_scheduled_hook( 'sby_feed_update' );
wp_send_json_success();
}
}