array( 'value' => 'k1000', 'label' => __( 'K1000', 'vintage-camera' ), 'defaults' => array( 'default-color' => 'ededed', 'default-image' => get_template_directory_uri() . '/img/background-light.png', 'default-text-color' => '333', 'default-description-color' => 'a9c137', 'default-header-image' => get_template_directory_uri() . '/img/headers/k1000.png', ) ), 'brownie' => array( 'value' => 'brownie', 'label' => __( 'Brownie', 'vintage-camera' ), 'defaults' => array( 'default-color' => 'c0b5a4', 'default-image' => get_template_directory_uri() . '/img/background.png', 'default-text-color' => '333', 'default-description-color' => 'a1440b', 'default-header-image' => get_template_directory_uri() . '/img/headers/brownie.png', ) ), 'polaroid' => array( 'value' => 'polaroid', 'label' => __( 'Land', 'vintage-camera' ), 'defaults' => array( 'default-color' => 'c4c4c4', 'default-image' => get_template_directory_uri() . '/img/background.png', 'default-text-color' => 'fff', 'default-description-color' => 'a5443f', 'default-header-image' => get_template_directory_uri() . '/img/headers/polaroid.png', ) ), 'diana' => array( 'value' => 'diana', 'label' => __( 'Diana', 'vintage-camera' ), 'defaults' => array( 'default-color' => '555', 'default-image' => get_template_directory_uri() . '/img/background-dark.png', 'default-text-color' => 'fff', 'default-description-color' => '5ab9c1', 'default-header-image' => get_template_directory_uri() . '/img/headers/diana.png', ) ), 'sabre' => array( 'value' => 'sabre', 'label' => __( 'Sabre', 'vintage-camera' ), 'defaults' => array( 'default-color' => 'e7e4d3', 'default-image' => get_template_directory_uri() . '/img/background-light.png', 'default-text-color' => '333', 'default-description-color' => 'e27d8c', 'default-header-image' => get_template_directory_uri() . '/img/headers/sabre.png', ) ), 'savoy' => array( 'value' => 'savoy', 'label' => __( 'Savoy', 'vintage-camera' ), 'defaults' => array( 'default-color' => 'e7e4d3', 'default-image' => get_template_directory_uri() . '/img/background-light.png', 'default-text-color' => '333', 'default-description-color' => 'c64', 'default-header-image' => get_template_directory_uri() . '/img/headers/savoy.png', ) ) ); return apply_filters( 'vintage_camera_theme_style', $vintage_camera_theme_style ); } /** * Returns the default options for Vintage Camera. */ function vintage_camera_get_default_theme_options() { $default_theme_options = array( 'theme_style' => 'k1000' ); return apply_filters( 'vintage_camera_default_theme_options', $default_theme_options ); } /** * Returns the options array for Vintage Camera. */ function vintage_camera_get_theme_options() { return get_option( 'vintage_camera_theme_options', vintage_camera_get_default_theme_options() ); } /** * Returns layout defaults */ function vintage_camera_get_layout_defaults() { $options = vintage_camera_get_theme_options(); $theme_style = $options['theme_style']; $default_theme_options = vintage_camera_get_default_theme_options(); $default_theme_style = $default_theme_options['theme_style']; $theme_style_values = vintage_camera_theme_style(); if ( $theme_style ) { $defaults = $theme_style_values[$theme_style]['defaults']; } else { $defaults = $theme_style_values[$default_theme_style]['defaults']; } return apply_filters( 'vintage_camera_get_layout_defaults', $defaults ); } /** * Renders the Theme Style setting field. * */ function vintage_camera_settings_field_theme_style() { $options = vintage_camera_get_theme_options(); foreach ( vintage_camera_theme_style() as $button ) { ?>

"; echo ".layout .description { width: 300px; float: left; text-align: center; margin-bottom: 10px; padding: 10px; }"; echo ""; } add_action( 'admin_print_styles-appearance_page_theme_options', 'vintage_camera_theme_options_admin_styles' ); /** * Add support for Theme Options in the Customizer */ function vintage_camera_customize_register( $wp_customize ) { $wp_customize->add_section( 'vintage_camera_theme_options', array( 'title' => __( 'Theme Options', 'vintage-camera' ), 'priority' => 35, 'transport' => 'postMessage', ) ); $wp_customize->add_setting( 'vintage_camera_theme_options[theme_style]', array( 'default' => 'k1000', 'type' => 'option', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( 'vintage_camera_theme_style', array( 'label' => __( 'Theme Style', 'vintage-camera' ), 'section' => 'vintage_camera_theme_options', 'settings' => 'vintage_camera_theme_options[theme_style]', 'type' => 'select', 'choices' => array( 'brownie' => __( 'Brownie', 'vintage-camera' ), 'polaroid' => __( 'Land', 'vintage-camera' ), 'diana' => __( 'Diana', 'vintage-camera' ), 'k1000' => __( 'K1000', 'vintage-camera' ), 'sabre' => __( 'Sabre', 'vintage-camera' ), 'savoy' => __( 'Savoy', 'vintage-camera' ), ), ) ); } add_action( 'customize_register', 'vintage_camera_customize_register' );