WPSEO_Sitemaps_Admin::status_transition_bulk_finished()publicYoast 1.0

After import finished, walk through imported post_types and update info.

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

Хуки из метода

Возвращает

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

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

$WPSEO_Sitemaps_Admin = new WPSEO_Sitemaps_Admin();
$WPSEO_Sitemaps_Admin->status_transition_bulk_finished();

Код WPSEO_Sitemaps_Admin::status_transition_bulk_finished() Yoast 22.4

public function status_transition_bulk_finished() {
	if ( ! defined( 'WP_IMPORTING' ) ) {
		return;
	}

	if ( empty( $this->importing_post_types ) ) {
		return;
	}

	$ping_search_engines = false;

	foreach ( $this->importing_post_types as $post_type ) {
		wp_cache_delete( 'lastpostmodified:gmt:' . $post_type, 'timeinfo' ); // #17455.

		// Just have the cache deleted for nav_menu_item.
		if ( $post_type === 'nav_menu_item' ) {
			continue;
		}

		if ( WPSEO_Options::get( 'noindex-' . $post_type, false ) === false ) {
			$ping_search_engines = true;
		}
	}

	// Nothing to do.
	if ( $ping_search_engines === false ) {
		return;
	}

	if ( WP_CACHE ) {
		do_action( 'wpseo_hit_sitemap_index' );
	}
}