Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
WC_WCCOM_Site_Installer::do_install_step( int $product_id, array $install_args, string $step, WP_Upgrader $upgrader )
Perform product installation step.
Description Description
Parameters Parameters
- $product_id
-
(Required) Product ID.
- $install_args
-
(Required) Install args.
- $step
-
(Required) Installation step.
- $upgrader
-
(Required) Core class to handle installation.
Source Source
File: includes/wccom-site/class-wc-wccom-site-installer.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 ); }
Changelog Changelog
Version | Description |
---|---|
3.7.0 | Introduced. |