Automattic\WooCommerce\Blueprint\Importers

ImportActivateTheme::processpublicWC 1.0

Process the step.

Method of the class: ImportActivateTheme{}

No Hooks.

Returns

StepProcessorResult.

Usage

$ImportActivateTheme = new ImportActivateTheme();
$ImportActivateTheme->process( $schema ): StepProcessorResult;
$schema(object) (required)
The schema for the step.

ImportActivateTheme::process() code WC 9.9.5

public function process( $schema ): StepProcessorResult {
	$result = StepProcessorResult::success( ActivateTheme::get_step_name() );
	// phpcs:ignore
	$name   = $schema->themeName;

	$this->wp_switch_theme( $name );

	$current_theme = $this->wp_get_theme()->get_stylesheet();

	if ( $current_theme === $name ) {
		$result->add_debug( "Switched theme to '$name'." );
	}

	return $result;
}