diff --git a/includes/Services/FlowService.php b/includes/Services/FlowService.php index ce9e5e5..c4ffe84 100644 --- a/includes/Services/FlowService.php +++ b/includes/Services/FlowService.php @@ -439,4 +439,24 @@ public static function get_onboarding_coming_soon() { $data = self::read_data_from_wp_option( false ); return isset( $data['data']['comingSoon'] ) ? $data['data']['comingSoon'] : null; } + + /** + * Retrieves the selected header template part. + * + * @return string|null The selected header template part or null if not set. + */ + public static function get_selected_header_template_part() { + $data = self::read_data_from_wp_option( false ); + return ( ! empty( $data['data']['partHeader'] ) ) ? $data['data']['partHeader'] : null; + } + + /** + * Retrieves the selected font style. + * + * @return string|null The selected font style or null if not set. + */ + public static function get_selected_font_style() { + $data = self::read_data_from_wp_option( false ); + return ( ! empty( $data['data']['fontStyle'] ) ) ? $data['data']['fontStyle'] : null; + } } diff --git a/includes/Themes.php b/includes/Themes.php index 9a74050..c270227 100644 --- a/includes/Themes.php +++ b/includes/Themes.php @@ -114,4 +114,23 @@ public static function get_flow_default_theme_slug( $flow ) { public static function get_active_theme() { return ( \wp_get_theme() )->get( 'TextDomain' ); } + + /** + * Retrieves the selected DIY theme settings. + * + * @return mixed The stored DIY theme settings, or false if the option does not exist. + */ + public static function get_selected_diy_theme_settings() { + return get_option( Options::get_option_name( 'theme_settings' ) ); + } + + /** + * Updates the DIY theme settings. + * + * @param array $settings The new theme settings to store. + * @return bool True if the option value has changed, false if not or if an error occurred. + */ + public static function set_diy_theme_settings( $settings ) { + return update_option( Options::get_option_name( 'theme_settings' ), $settings ); + } } diff --git a/includes/Themes/Fonts.php b/includes/Themes/Fonts.php index 6c8c562..7107cb9 100644 --- a/includes/Themes/Fonts.php +++ b/includes/Themes/Fonts.php @@ -20,6 +20,7 @@ protected static function get_theme_fonts() { 'modern-approachable' => array( 'label' => __( 'Modern & approachable', 'wp-module-onboarding-data' ), 'matches' => 'yith-wonder/theme-json', + 'slugs' => array( 'mulish', 'poppins' ), 'styles' => array( 'typography' => array( 'fontFamily' => 'var(--wp--preset--font-family--mulish)', @@ -36,6 +37,7 @@ protected static function get_theme_fonts() { 'strong-sleek' => array( 'label' => __( 'Strong & sleek', 'wp-module-onboarding-data' ), 'matches' => 'yith-wonder/styles/01-blue-shades', + 'slugs' => array( 'raleway', 'oswald' ), 'styles' => array( 'typography' => array( 'fontFamily' => 'var(--wp--preset--font-family--raleway)', @@ -52,6 +54,7 @@ protected static function get_theme_fonts() { 'stately-elevated' => array( 'label' => __( 'Stately & elevated', 'wp-module-onboarding-data' ), 'matches' => 'yith-wonder/styles/02-pink-shades', + 'slugs' => array( 'source-sans-pro', 'playfair' ), 'styles' => array( 'typography' => array( 'fontFamily' => 'var(--wp--preset--font-family--source-sans-pro)', @@ -68,6 +71,7 @@ protected static function get_theme_fonts() { 'typewriter-crisp-midcentury' => array( 'label' => __( 'Typewriter & crisp midcentury', 'wp-module-onboarding-data' ), 'matches' => 'yith-wonder/styles/03-orange-shades', + 'slugs' => array( 'jost', 'solway' ), 'styles' => array( 'typography' => array( 'fontFamily' => 'var(--wp--preset--font-family--jost)', @@ -84,6 +88,7 @@ protected static function get_theme_fonts() { 'refined-traditional-newsletter' => array( 'label' => __( 'Refined traditional newsletter', 'wp-module-onboarding-data' ), 'matches' => 'yith-wonder/styles/04-black-shades', + 'slugs' => array( 'jost', 'merriweather' ), 'styles' => array( 'typography' => array( 'fontFamily' => 'var(--wp--preset--font-family--jost)', @@ -100,6 +105,7 @@ protected static function get_theme_fonts() { 'bold-stamp-slab' => array( 'label' => __( 'Bold stamp & slab', 'wp-module-onboarding-data' ), 'matches' => 'yith-wonder/styles/05-red-shades', + 'slugs' => array( 'changa-one', 'roboto-slab' ), 'styles' => array( 'typography' => array( 'fontFamily' => 'var(--wp--preset--font-family--roboto-slab)', @@ -116,6 +122,7 @@ protected static function get_theme_fonts() { 'fast-simple' => array( 'label' => __( 'Fast & Simple', 'wp-module-onboarding-data' ), 'matches' => 'newfold/onboarding-01', + 'slugs' => array( 'system' ), 'styles' => array( 'typography' => array( 'fontFamily' => 'var(--wp--preset--font-family--system)', @@ -132,6 +139,7 @@ protected static function get_theme_fonts() { 'timeless-traditional' => array( 'label' => __( 'Timeless & Traditional', 'wp-module-onboarding-data' ), 'matches' => 'newfold/onboarding-02', + 'slugs' => array( 'serif' ), 'styles' => array( 'typography' => array( 'fontFamily' => 'var(--wp--preset--font-family--serif)', @@ -148,6 +156,7 @@ protected static function get_theme_fonts() { 'sleek-sophisticated' => array( 'label' => __( 'Sleek & Sophisticated', 'wp-module-onboarding-data' ), 'matches' => 'newfold/onboarding-03', + 'slugs' => array( 'dm-sans' ), 'styles' => array( 'typography' => array( 'fontFamily' => 'var(--wp--preset--font-family--dm-sans)', @@ -164,6 +173,7 @@ protected static function get_theme_fonts() { 'clear-crisp' => array( 'label' => __( 'Clear & Crisp', 'wp-module-onboarding-data' ), 'matches' => 'newfold/onboarding-04', + 'slugs' => array( 'inter' ), 'styles' => array( 'typography' => array( 'fontFamily' => 'var(--wp--preset--font-family--inter)', @@ -180,6 +190,7 @@ protected static function get_theme_fonts() { 'retro-classy' => array( 'label' => __( 'Retro & Classy', 'wp-module-onboarding-data' ), 'matches' => 'newfold/onboarding-05', + 'slugs' => array( 'league-spartan' ), 'styles' => array( 'typography' => array( 'fontFamily' => 'var(--wp--preset--font-family--league-spartan)', @@ -196,6 +207,7 @@ protected static function get_theme_fonts() { 'defined-solid' => array( 'label' => __( 'Defined & Solid', 'wp-module-onboarding-data' ), 'matches' => 'newfold/onboarding-06', + 'slugs' => array( 'roboto-slab' ), 'styles' => array( 'typography' => array( 'fontFamily' => 'var(--wp--preset--font-family--roboto-slab)',