WPSEO_Sitemaps_Cache::invalidate_post()public staticYoast 1.5.4

Invalidate sitemap cache for the post type of a post.

Don't invalidate for revisions.

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

Хуков нет.

Возвращает

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

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

$result = WPSEO_Sitemaps_Cache::invalidate_post( $post_id );
$post_id(int) (обязательный)
Post ID to invalidate type for.

Список изменений

С версии 1.5.4 Введена.
С версии 3.2 Changed from function wpseo_invalidate_sitemap_cache_on_save_post() to method in this class.

Код WPSEO_Sitemaps_Cache::invalidate_post() Yoast 22.4

public static function invalidate_post( $post_id ) {

	if ( wp_is_post_revision( $post_id ) ) {
		return;
	}

	self::invalidate( get_post_type( $post_id ) );
}