Automattic\WooCommerce\Internal\Admin\Onboarding
OnboardingSetupWizard::component_settings()
Add profiler items to component settings.
Method of the class: OnboardingSetupWizard{}
Hooks from the method
Return
Array
.
Usage
$OnboardingSetupWizard = new OnboardingSetupWizard(); $OnboardingSetupWizard->component_settings( $settings );
- $settings(array) (required)
- Component settings.
OnboardingSetupWizard::component_settings() OnboardingSetupWizard::component settings code WC 9.7.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; if ( $this->is_setup_wizard() ) { $settings['onboarding']['pageCount'] = (int) ( wp_count_posts( 'page' ) )->publish; $settings['onboarding']['postCount'] = (int) ( wp_count_posts( 'post' ) )->publish; $settings['onboarding']['isBlockTheme'] = wc_current_theme_is_fse_theme(); } return apply_filters( 'woocommerce_admin_onboarding_preloaded_data', $settings ); }