Automattic\WooCommerce\Internal\Admin\Onboarding

OnboardingSetupWizard::component_settings()publicWC 1.0

Add profiler items to component settings.

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

Хуки из метода

Возвращает

Массив.

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

$OnboardingSetupWizard = new OnboardingSetupWizard();
$OnboardingSetupWizard->component_settings( $settings );
$settings(массив) (обязательный)
Component settings.

Код OnboardingSetupWizard::component_settings() WC 6.6.1

public function component_settings( $settings ) {
	$profile                = (array) get_option( OnboardingProfile::DATA_OPTION, array() );
	$settings['onboarding'] = array(
		'profile' => $profile,
	);

	// Only fetch if the onboarding wizard OR the task list is incomplete or currently shown
	// or the current page is one of the WooCommerce Admin pages.
	if (
		( ! $this->should_show() && ! count( TaskLists::get_visible() )
		||
		! $this->is_woocommerce_page()
	)
	) {
		return $settings;
	}

	include_once WC_ABSPATH . 'includes/admin/helper/class-wc-helper-options.php';
	$wccom_auth                 = \WC_Helper_Options::get( 'auth' );
	$profile['wccom_connected'] = empty( $wccom_auth['access_token'] ) ? false : true;

	$settings['onboarding']['currencySymbols'] = get_woocommerce_currency_symbols();
	$settings['onboarding']['euCountries']     = WC()->countries->get_european_union_countries();
	$settings['onboarding']['localeInfo']      = include WC()->plugin_path() . '/i18n/locale-info.php';
	$settings['onboarding']['profile']         = $profile;

	return apply_filters( 'woocommerce_admin_onboarding_preloaded_data', $settings );
}