WC_Post_Data::transition_post_status()public staticWC 1.0

When a post status changes.

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

Хуков нет.

Возвращает

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

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

$result = WC_Post_Data::transition_post_status( $new_status, $old_status, $post );
$new_status(строка) (обязательный)
New status.
$old_status(строка) (обязательный)
Old status.
$post(WP_Post) (обязательный)
Post data.

Код WC_Post_Data::transition_post_status() WC 8.7.0

public static function transition_post_status( $new_status, $old_status, $post ) {
	if ( ( 'publish' === $new_status || 'publish' === $old_status ) && in_array( $post->post_type, array( 'product', 'product_variation' ), true ) ) {
		self::delete_product_query_transients();
	}
}