WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Получай пассивный доход от сайта с помощью браузерных PUSH уведомлений
функция не описана

Automattic\WooCommerce\Admin\RemoteInboxNotifications

StoredStateSetupForProducts::run_on_transition_post_status() public WC 1.0

Runs when a post status transitions, but we're only interested if it is a product being published.

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

Хуков нет.

Возвращает

null. Ничего.

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

$result = StoredStateSetupForProducts::run_on_transition_post_status( $new_status, $old_status, $post );
$new_status(строка) (обязательный)
The new status.
$old_status(строка) (обязательный)
The old status.
$post(Post) (обязательный)
The post.

Код StoredStateSetupForProducts::run_on_transition_post_status() WC 5.3.0

<?php
public static function run_on_transition_post_status( $new_status, $old_status, $post ) {
	if (
		'product' !== $post->post_type ||
		'publish' !== $new_status
	) {
		return;
	}

	$stored_state                         = RemoteInboxNotificationsEngine::get_stored_state();
	$stored_state->there_are_now_products = true;

	// This is used to increment the product count yielded by the query,
	// which is one less than the actual product count at this point in the
	// product publish lifecycle. This is currently being used by
	// ProductCountRuleProcessor.
	$stored_state->new_product_count = 1;

	RemoteInboxNotificationsEngine::update_stored_state( $stored_state );

	RemoteInboxNotificationsEngine::run();

	$stored_state->new_product_count = 0;
	RemoteInboxNotificationsEngine::update_stored_state( $stored_state );
}