add_section( 'bg_photo_frame_setting', array( 'title' => esc_html__('Theme Setting', 'bg-photo-frame'), 'priority' => 20, )); $wp_customize->add_setting('color_option', array( 'default' => 'light', 'capability' => 'manage_options', 'type' => 'theme_mod', 'transport' => 'refresh', 'sanitize_callback' => 'wpforge_sanitize_teheme_color', )); $wp_customize->add_control('bg_photo_frame_setting_color_scheme', array( 'label' => esc_html__('Theme Color', 'bg-photo-frame'), 'section' => 'bg_photo_frame_setting', 'settings' => 'color_option', 'type' => 'radio', 'choices' => array( 'light' => esc_html__('Light Side', 'bg-photo-frame'), 'dark' => esc_html__('Dark Side', 'bg-photo-frame'), ), )); $wp_customize->add_setting('image_order', array( 'default' => 'in_order', 'capability' => 'manage_options', 'type' => 'theme_mod', 'transport' => 'refresh', 'sanitize_callback' => 'wpforge_sanitize_image_order', )); $wp_customize->add_control('bg_photo_frame_setting_image_order', array( 'label' => esc_html__('Order of images', 'bg-photo-frame'), 'section' => 'bg_photo_frame_setting', 'settings' => 'image_order', 'type' => 'radio', 'choices' => array( 'in_order' => esc_html__('In order', 'bg-photo-frame'), 'shuffle' => esc_html__('Shuffle', 'bg-photo-frame'), ), )); } function wpforge_sanitize_teheme_color( $input ) { $valid = array( 'light' => esc_html__('Light Side', 'bg-photo-frame'), 'dark' => esc_html__('Dark Side', 'bg-photo-frame'), ); if ( array_key_exists( $input, $valid ) ) { return $input; } else { return ''; } } function wpforge_sanitize_image_order( $input ) { $valid = array( 'in_order' => esc_html__('In order', 'bg-photo-frame'), 'shuffle' => esc_html__('Shuffle', 'bg-photo-frame'), ); if ( array_key_exists( $input, $valid ) ) { return $input; } else { return ''; } } add_action('customize_register', 'bg_photo_frame_theme_color_customize_register'); /** * Custom_Header_Setup */ function bg_photo_frame_custom_header_setup_custom() { add_theme_support( 'custom-header', apply_filters( 'bg_photo_frame_custom_header_args', array( 'default-image' => '', 'default-text-color' => '000000', 'width' => 1280, 'height' => 720, 'flex-height' => true, 'wp-head-callback' => 'bg_photo_frame_header_style', 'admin-head-callback' => 'bg_photo_frame_admin_header_style', 'admin-preview-callback' => 'bg_photo_frame_admin_header_image', ) ) ); } add_action( 'after_setup_theme', 'bg_photo_frame_custom_header_setup_custom' ); ?>