array( 'value' => 'purple', 'label' => __( 'Purple', 'babylog' ) ), 'pink' => array( 'value' => 'pink', 'label' => __( 'Pink', 'babylog' ) ), 'green' => array( 'value' => 'green', 'label' => __( 'Green', 'babylog' ) ), 'blue' => array( 'value' => 'blue', 'label' => __( 'Blue', 'babylog' ) ) ); return apply_filters( 'babylog_color_scheme', $color_scheme ); } /** * Returns an array of skin tones registered for Babylog. * * @since Babylog 1.0 */ function babylog_skin_tone() { $skin_tone = array( 'light' => array( 'value' => 'light', 'label' => __( 'Light', 'babylog' ) ), 'medium' => array( 'value' => 'medium', 'label' => __( 'Medium', 'babylog' ) ), 'dark' => array( 'value' => 'dark', 'label' => __( 'Dark', 'babylog' ) ) ); return apply_filters( 'babylog_skin_tone', $skin_tone ); } /** * Returns an array of hair colors registered for Babylog. * * @since Babylog 1.0 */ function babylog_hair_color() { $hair_color = array( 'brown' => array( 'value' => 'brown', 'label' => __( 'Brown', 'babylog' ) ), 'black' => array( 'value' => 'black', 'label' => __( 'Black', 'babylog' ) ), 'blonde' => array( 'value' => 'blonde', 'label' => __( 'Blonde', 'babylog' ) ), 'red' => array( 'value' => 'red', 'label' => __( 'Red', 'babylog' ) ) ); return apply_filters( 'babylog_hair_color', $hair_color ); } /** * Returns an array of hair colors registered for Babylog. * * @since Babylog 1.0 */ function babylog_show_baby() { $show_baby = array( 'yes' => array( 'value' => 'yes', 'label' => __( 'Yes', 'babylog' ) ), 'no' => array( 'value' => 'no', 'label' => __( 'No', 'babylog' ) ), ); return apply_filters( 'babylog_show_baby', $show_baby ); } /** * Returns the options array for Babylog. * * @since Babylog 1.0 */ function babylog_get_theme_options() { $saved = (array) get_option( 'babylog_theme_options' ); $defaults = array( 'color_scheme' => 'purple', 'skin_tone' => 'medium', 'hair_color' => 'brown', 'show_baby' => 'yes', ); $defaults = apply_filters( 'babylog_default_theme_options', $defaults ); $options = wp_parse_args( $saved, $defaults ); $options = array_intersect_key( $options, $defaults ); return $options; } /** * Renders the color scheme setting field. * * @since Babylog 1.0 */ function babylog_settings_field_color_scheme() { $options = babylog_get_theme_options(); foreach ( babylog_color_scheme() as $button ) { ?>
'; else : $imgstring = '' . esc_attr( 'Image preview', 'babylog' ) . ''; endif; if ( isset( $themecolor ) && ! empty( $themecolor ) ) { if ( 'green' == $themecolor ) $backgroundcolor = 'c2e2bf'; else if ( 'blue' == $themecolor ) $backgroundcolor = '86afbf'; else if ( 'pink' == $themecolor ) $backgroundcolor = 'e29393'; else if ( 'purple' == $themecolor ) $backgroundcolor = 'bfa1c6'; } else { $backgroundcolor = 'bfa1c6'; $themecolor = 'purple'; } if ( !isset( $haircolor ) || empty( $haircolor ) ) $haircolor = 'brown'; if ( !isset( $haircolor ) || empty( $haircolor ) ) $haircolor = 'brown'; ?>

add_section( 'babylog_theme_options', array( 'title' => __( 'Theme Options', 'babylog' ), 'priority' => 35, ) ); $wp_customize->add_setting( 'babylog_theme_options[color_scheme]', array( 'default' => 'purple', 'type' => 'option', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( 'babylog_theme_style', array( 'label' => 'Color Scheme:', 'section' => 'babylog_theme_options', 'settings' => 'babylog_theme_options[color_scheme]', 'type' => 'select', 'choices' => array( 'purple' => __( 'Purple', 'babylog' ), 'pink' => __( 'Pink', 'babylog' ), 'green' => __( 'Green', 'babylog' ), 'blue' => __( 'Blue', 'babylog' ), ) ) ); $wp_customize->add_setting( 'babylog_theme_options[skin_tone]', array( 'default' => 'medium', 'type' => 'option', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( 'babylog_skin_tone', array( 'label' => 'Skin Tone:', 'section' => 'babylog_theme_options', 'settings' => 'babylog_theme_options[skin_tone]', 'type' => 'select', 'choices' => array( 'light' => __( 'Light', 'babylog' ), 'medium' => __( 'Medium', 'babylog' ), 'dark' => __( 'Dark', 'babylog' ), ) ) ); $wp_customize->add_setting( 'babylog_theme_options[hair_color]', array( 'default' => 'brown', 'type' => 'option', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( 'babylog_hair_color', array( 'label' => 'Hair Color:', 'section' => 'babylog_theme_options', 'settings' => 'babylog_theme_options[hair_color]', 'type' => 'select', 'choices' => array( 'brown' => __( 'Brown', 'babylog' ), 'black' => __( 'Black', 'babylog' ), 'blonde' => __( 'Blonde', 'babylog' ), 'red' => __( 'Red', 'babylog' ), ) ) ); $wp_customize->add_setting( 'babylog_theme_options[show_baby]', array( 'default' => 'yes', 'type' => 'option', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( 'babylog_show_baby', array( 'label' => 'Show the baby graphic?', 'section' => 'babylog_theme_options', 'settings' => 'babylog_theme_options[show_baby]', 'type' => 'select', 'choices' => array( 'yes' => __( 'Yes', 'babylog' ), 'no' => __( 'No', 'babylog' ), ) ) ); } add_action( 'customize_register', 'babylog_customize_register' );