WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
класс не описан

WPSEO_Statistic_Integration{} Yoast 1.0

Class WPSEO_Statistic_Integration.

Хуков нет.

Возвращает

null. Ничего.

Использование

$WPSEO_Statistic_Integration = new WPSEO_Statistic_Integration();
// use class methods

Методы

  1. clear_cache()
  2. register_hooks()

Код WPSEO_Statistic_Integration{} Yoast 17.3

class WPSEO_Statistic_Integration implements WPSEO_WordPress_Integration {

	/**
	 * Adds hooks to clear the cache.
	 *
	 * @return void
	 */
	public function register_hooks() {
		add_action( 'wp_insert_post', [ $this, 'clear_cache' ] );
		add_action( 'delete_post', [ $this, 'clear_cache' ] );
	}

	/**
	 * Clears the dashboard widget items cache.
	 *
	 * @return void
	 */
	public function clear_cache() {
		// Bail if this is a multisite installation and the site has been switched.
		if ( is_multisite() && ms_is_switched() ) {
			return;
		}

		delete_transient( WPSEO_Statistics_Service::CACHE_TRANSIENT_KEY );
	}
}