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

WPSEO_Sitemaps_Admin::status_transition() public Yoast 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.

Ищем WP-разработчика! Фулл-тайм, удаленка, хорошая зарплата, соц. пакет. Подробности.
Компания Boosta.

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

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

Возвращает

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 17.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.

	// Not something we're interested in.
	if ( $post_type === 'nav_menu_item' ) {
		return;
	}

	// If the post type is excluded in options, we can stop.
	if ( WPSEO_Options::get( 'noindex-' . $post_type, false ) ) {
		return;
	}

	if ( wp_get_environment_type() !== 'production' ) {
		return;
	}

	/**
	 * Filter: 'wpseo_allow_xml_sitemap_ping' - Check if pinging is not allowed (allowed by default).
	 *
	 * @api boolean $allow_ping The boolean that is set to true by default.
	 */
	if ( apply_filters( 'wpseo_allow_xml_sitemap_ping', true ) === false ) {
		return;
	}

	if ( defined( 'YOAST_SEO_PING_IMMEDIATELY' ) && YOAST_SEO_PING_IMMEDIATELY ) {
		WPSEO_Sitemaps::ping_search_engines();
	}
	elseif ( ! wp_next_scheduled( 'wpseo_ping_search_engines' ) ) {
		wp_schedule_single_event( ( time() + 300 ), 'wpseo_ping_search_engines' );
	}
}