Automattic\WooCommerce\Internal\Admin\Onboarding
OnboardingSetupWizard::component_settings()
Add profiler items to component settings.
Метод класса: OnboardingSetupWizard{}
Хуки из метода
Возвращает
Массив
.
Использование
$OnboardingSetupWizard = new OnboardingSetupWizard(); $OnboardingSetupWizard->component_settings( $settings );
- $settings(массив) (обязательный)
- Component settings.
Код OnboardingSetupWizard::component_settings() OnboardingSetupWizard::component settings WC 9.8.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() ) // phpcs:ignore Generic.CodeAnalysis.RequireExplicitBooleanOperatorPrecedence.MissingParentheses || ! $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(); } // phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingHookComment return apply_filters( 'woocommerce_admin_onboarding_preloaded_data', $settings ); }