WPSEO_Sitemaps_Admin::status_transition()publicYoast 1.0

Hooked into transition_post_status. Will initiate search engine pings if the post is being published, is a post type that a sitemap is built for and is a post that is included in sitemaps.

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

Хуков нет.

Возвращает

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

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

$WPSEO_Sitemaps_Admin = new WPSEO_Sitemaps_Admin();
$WPSEO_Sitemaps_Admin->status_transition( $new_status, $old_status, $post );
$new_status(строка) (обязательный)
New post status.
$old_status(строка) (обязательный)
Old post status.
$post(WP_Post) (обязательный)
Post object.

Код WPSEO_Sitemaps_Admin::status_transition() Yoast 22.4

public function status_transition( $new_status, $old_status, $post ) {
	if ( $new_status !== 'publish' ) {
		return;
	}

	if ( defined( 'WP_IMPORTING' ) ) {
		$this->status_transition_bulk( $new_status, $old_status, $post );

		return;
	}

	$post_type = get_post_type( $post );

	wp_cache_delete( 'lastpostmodified:gmt:' . $post_type, 'timeinfo' ); // #17455.
}