add_setting( 'layout_style', array( * 'default' => 'no-sidebar', * 'sanitize_callback' => 'sanitize_key' * ) ); * * $wp_customize->add_control( new Beetan_Customize_Color_Scheme_Control( $wp_customize, 'layout_style', array( * 'label' => esc_html__( 'Scheme / Palette', 'beetan' ), * 'description' => __( 'Choose a layout for the blog posts.', 'beetan' ), * 'section' => 'blog_options', * 'choices' => array( * 'sandy-stone' => array( * 'label' => esc_html__( 'Sandy Stone', 'beetan' ), * 'color' => array('#E6E2AF', '#A7A37E', '#EFECCA', '#046380', '#002F2F') * ), * 'firenze' => array( * 'label' => esc_html__( 'Firenze', 'beetan' ), * 'color' => array('#468966', '#FFF0A5', '#FFB03B', '#B64926', '#8E2800') * ) * ) * ) ) ); * * COLOR SCHEMES URLs: * https://coolors.co/browser/latest/1 * http://colorhunt.co/ * https://color.hailpixel.com/ * https://color.adobe.com/explore/?filter=most-popular&time=all */ if ( ! class_exists( 'Beetan_Customize_Color_Scheme_Control' ) ): class Beetan_Customize_Color_Scheme_Control extends WP_Customize_Control { public $type = 'color-scheme'; public function enqueue() { $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; wp_enqueue_script( 'customize-color-scheme-control', esc_url( get_theme_file_uri( "/assets/js/customize-color-scheme-control$suffix.js" ) ), array( 'jquery' ), FALSE, TRUE ); wp_enqueue_style( 'customize-color-scheme-control', esc_url( get_theme_file_uri( "/assets/css/customize-color-scheme-control$suffix.css" ) ) ); } protected function render_content() { if ( empty( $this->choices ) ) { return; } $name = '_customize-color-scheme-' . $this->id; ?> label ) ) : ?> label ); ?>