Yoast\WP\SEO\Schema_Aggregator\User_Interface

Site_Schema_Aggregator_Cache_Cli_Command::aggregate_site_schema_clear_cachepublicYoast 1.0

Aggregates the schema for a certain site.

OPTIONS

[--post_type=<post_type>]
The current page to process. [--page=<page>]
The current page to process.
--- ## EXAMPLES
wp yoast aggregate_site_schema_clear_cache

Метод класса: Site_Schema_Aggregator_Cache_Cli_Command{}

Хуков нет.

Возвращает

null. Ничего (null).

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

$Site_Schema_Aggregator_Cache_Cli_Command = new Site_Schema_Aggregator_Cache_Cli_Command();
$Site_Schema_Aggregator_Cache_Cli_Command->aggregate_site_schema_clear_cache( $args, $assoc_args );
$args(array|null)
The arguments.
По умолчанию: null
$assoc_args(array|null)
The associative arguments.
По умолчанию: null

Код Site_Schema_Aggregator_Cache_Cli_Command::aggregate_site_schema_clear_cache() Yoast 27.7

public function aggregate_site_schema_clear_cache( $args = null, $assoc_args = null ) {
	if ( ( isset( $assoc_args['page'] ) && (int) $assoc_args['page'] >= 1 ) && isset( $assoc_args['post_type'] ) ) {
		$this->cache_manager->invalidate( $assoc_args['post_type'], $assoc_args['page'] );
		$this->xml_manager->invalidate();
		WP_CLI::log(
			\__( 'The site schema cache has been cleared successfully.', 'wordpress-seo' ),
		);

		return;
	}
	$this->cache_manager->invalidate_all();
	$this->xml_manager->invalidate();

	WP_CLI::log(
		\__( 'All site schema cache has been cleared successfully.', 'wordpress-seo' ),
	);
}