page' ) )->publish; $settings['onboarding']['postCount'] = (int) ( wp_count_posts( 'post' ) )->publish; $settings['onboarding']['isBlockTheme'] = wp_is_block_theme(); } // phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingHookComment return apply_filters( 'woocommerce_admin_onboarding_preloaded_data', $settings ); } /** * Preload WC setting options to prime state of the application. * * @param array $options Array of options to preload. * @return array */ public function preload_settings( $options ) { $options[] = 'general'; return $options; } /** * Set the admin full screen class when loading to prevent flashes of unstyled content. * * @param bool $classes Body classes. * @return array */ public function add_loading_classes( $classes ) { /* phpcs:disable WordPress.Security.NonceVerification */ if ( $this->is_setup_wizard() ) { $classes .= ' woocommerce-admin-full-screen'; } /* phpcs: enable */ return $classes; } /** * Remove the install notice that prompts the user to visit the old onboarding setup wizard. * * @param bool $show Show or hide the notice. * @param string $notice The slug of the notice. * @return bool */ public function remove_old_install_notice( $show, $notice ) { if ( 'install' === $notice ) { return false; } return $show; } /** * Set the viewport meta tag for the setup wizard. * * @param string $viewport_meta Viewport meta content value. * @return string Viewport meta content value. * * @since 9.0.0 */ public function set_viewport_meta_tag( $viewport_meta ) { if ( ! $this->is_setup_wizard() ) { return $viewport_meta; } return 'width=device-width, initial-scale=1.0, maximum-scale=1.0'; } /** * Install options for core profiler plugin install. * * When a plugin is installed from the core profiler, this method is called to process the install options. * * Install options are a list of options that are set for the plugin being installed. * * @param string $slug Plugin slug. * @param string $source Source of the plugin install. * * @return void|null */ public function install_options_for_core_profiler_plugin_install( $slug, $source ) { // Only proceed if the plugin install was initiated from the core profiler. if ( 'core-profiler' !== $source ) { return; } // Retrieve the core profiler spec. $specs = array_filter( Init::get_specs(), fn( $spec ) => 'obw/core-profiler' === $spec->key ); if ( ! $specs ) { return null; } $install_options = new ProcessCoreProfilerPluginInstallOptions( current( $specs )->plugins, $slug, wc_get_logger() ); $install_options->process_install_options(); } }