get_mods_defaults(); /* $wp_customize->add_section( 'bluesquirrel_colors', array( 'title' => __( 'Colors', 'blue-squirrel' ), //Visible title of section 'description' => __('Allows you to customize colors.', 'blue-squirrel'), //Descriptive tooltip ) ); */ $wp_customize->add_setting( 'title_color', //No need to use a SERIALIZED name, as `theme_mod` settings already live under one db record array( 'default' => $defs['title_color'], //Default setting/value to save 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage' ) ); $wp_customize->add_setting( 'description_color', //No need to use a SERIALIZED name, as `theme_mod` settings already live under one db record array( 'default' => $defs['description_color'], //Default setting/value to save 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage' ) ); $wp_customize->add_setting( 'main_background_color', //No need to use a SERIALIZED name, as `theme_mod` settings already live under one db record array( 'default' => $defs['main_background_color'], //Default setting/value to save 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage' ) ); $wp_customize->add_setting( 'footer_background_color', //No need to use a SERIALIZED name, as `theme_mod` settings already live under one db record array( 'default' => $defs['footer_background_color'], //Default setting/value to save 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage' ) ); $wp_customize->add_setting( 'links_color', //No need to use a SERIALIZED name, as `theme_mod` settings already live under one db record array( 'default' => $defs['links_color'], //Default setting/value to save 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage' ) ); $wp_customize->add_setting( 'visited_links_color', //No need to use a SERIALIZED name, as `theme_mod` settings already live under one db record array( 'default' => $defs['visited_links_color'], //Default setting/value to save 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage' ) ); $wp_customize->add_setting( 'hover_links_color', //No need to use a SERIALIZED name, as `theme_mod` settings already live under one db record array( 'default' => $defs['hover_links_color'], //Default setting/value to save 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'title_color', array( 'label' => __('Edit Title Color', 'blue-squirrel'), //'section' => 'bluesquirrel_colors', 'section' => 'colors', 'settings' => 'title_color', ) )); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'description_color', array( 'label' => __('Edit Description Color', 'blue-squirrel'), //'section' => 'bluesquirrel_colors', 'section' => 'colors', 'settings' => 'description_color', ) )); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'main_background_color', array( 'label' => __('Edit Background Color', 'blue-squirrel'), //'section' => 'bluesquirrel_colors', 'section' => 'colors', 'settings' => 'main_background_color', ) )); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'footer_background_color', array( 'label' => __('Edit Footer Color', 'blue-squirrel'), //'section' => 'bluesquirrel_colors', 'section' => 'colors', 'settings' => 'footer_background_color', ) )); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'links_color', array( 'label' => __('Edit Links Color', 'blue-squirrel'), //'section' => 'bluesquirrel_colors', 'section' => 'colors', 'settings' => 'links_color', ) )); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'visited_links_color', array( 'label' => __('Edit Visited Links Color', 'blue-squirrel'), //'section' => 'bluesquirrel_colors', 'section' => 'colors', 'settings' => 'visited_links_color', ) )); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'hover_links_color', array( 'label' => __('Edit Hover Links Color', 'blue-squirrel'), //'section' => 'bluesquirrel_colors', 'section' => 'colors', 'settings' => 'hover_links_color', ) )); //BACKGROUND $wp_customize->add_setting( 'background_image', //No need to use a SERIALIZED name, as `theme_mod` settings already live under one db record array( 'default' => '', //Default setting/value to save 'sanitize_callback' => 'esc_url_raw', 'transport' => 'postMessage' ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'background_image', array( 'label' => __('Background Image', 'blue-squirrel'), //'section' => 'bluesquirrel_colors', 'section' => 'background_image', 'settings' => 'background_image', ) )); //HEADER $wp_customize->add_setting( 'header_image', //No need to use a SERIALIZED name, as `theme_mod` settings already live under one db record array( 'default' => '', //Default setting/value to save 'sanitize_callback' => 'esc_url_raw', 'transport' => 'postMessage' ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'header_image', array( 'label' => __('Header Image', 'blue-squirrel'), //'section' => 'bluesquirrel_colors', 'section' => 'header_image', 'settings' => 'header_image', ) )); $wp_customize->remove_control('background_color'); //$wp_customize->add_control('background_color')->theme_supports=false; } //Insert saved customizer values into theme function bluesquirrel_css_customizer(){ $data_proc = new \bluesquirrel\Data_Processing(); $mods = $data_proc->option_default_mods(); $bg_style = customize_background_img($mods); ?>