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

WC_WCCOM_Site_Installer::do_install_step() private WC 3.7.0

Perform product installation step.

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

Хуков нет.

Возвращает

Null. Ничего.

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

$result = WC_WCCOM_Site_Installer::do_install_step( $product_id, $install_args, $step, $upgrader );
$product_id(число) (обязательный)
Product ID.
$install_args(массив) (обязательный)
Install args.
$step(строка) (обязательный)
Installation step.
$upgrader(\WP_Upgrader) (обязательный)
Core class to handle installation.

Список изменений

С версии 3.7.0 Введена.

Код WC_WCCOM_Site_Installer::do_install_step() WC 4.7.1

<?php
private static function do_install_step( $product_id, $install_args, $step, $upgrader ) {
	$state_steps = self::get_state( 'steps' );
	if ( empty( $state_steps[ $product_id ] ) ) {
		$state_steps[ $product_id ] = self::$default_step_state;
	}

	if ( ! empty( $state_steps[ $product_id ]['last_error'] ) ) {
		return;
	}

	$state_steps[ $product_id ]['last_step'] = $step;

	if ( ! empty( $install_args['activate'] ) ) {
		$state_steps[ $product_id ]['activate'] = true;
	}

	self::update_state(
		'current_step',
		array(
			'product_id' => $product_id,
			'step'       => $step,
		)
	);

	$result = call_user_func( array( __CLASS__, $step ), $product_id, $upgrader );
	if ( is_wp_error( $result ) ) {
		$state_steps[ $product_id ]['last_error'] = $result->get_error_message();
	} else {
		switch ( $step ) {
			case 'get_product_info':
				$state_steps[ $product_id ]['download_url'] = $result['download_url'];
				$state_steps[ $product_id ]['product_type'] = $result['product_type'];
				$state_steps[ $product_id ]['product_name'] = $result['product_name'];
				break;
			case 'download_product':
				$state_steps[ $product_id ]['download_path'] = $result;
				break;
			case 'unpack_product':
				$state_steps[ $product_id ]['unpacked_path'] = $result;
				break;
			case 'move_product':
				$state_steps[ $product_id ]['installed_path'] = $result['destination'];
				if ( isset( $result[ self::$folder_exists ] ) ) {
					$state_steps[ $product_id ]['warning'] = array(
						'message'     => self::$folder_exists,
						'plugin_info' => self::get_plugin_info( $state_steps[ $product_id ]['installed_path'] ),
					);
				}
				break;
		}
	}

	self::update_state( 'steps', $state_steps );
}