From 9ed425438f3f19442a3a26aef4d091a7b62f22f9 Mon Sep 17 00:00:00 2001 From: Ian Stewart Date: Fri, 17 Oct 2014 20:52:19 +0000 Subject: [PATCH] Twenty Fifteen: Removing unused custom color controls. Props cainm, fixes #29982 and #29959. Built from https://develop.svn.wordpress.org/trunk@29944 git-svn-id: http://core.svn.wordpress.org/trunk@29694 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- .../themes/twentyfifteen/inc/customizer.php | 57 ++++----------- .../twentyfifteen/js/color-scheme-control.js | 70 ++++++++++--------- 2 files changed, 51 insertions(+), 76 deletions(-) diff --git a/wp-content/themes/twentyfifteen/inc/customizer.php b/wp-content/themes/twentyfifteen/inc/customizer.php index a4a5e91c4f..08b2d73c94 100644 --- a/wp-content/themes/twentyfifteen/inc/customizer.php +++ b/wp-content/themes/twentyfifteen/inc/customizer.php @@ -27,12 +27,13 @@ function twentyfifteen_customize_register( $wp_customize ) { 'sanitize_callback' => 'twentyfifteen_sanitize_color_scheme', ) ); - $wp_customize->add_control( new Twentyfifteen_Customize_Color_Scheme_Control( $wp_customize, 'color_scheme', array( + $wp_customize->add_control( 'color_scheme', array( 'label' => esc_html__( 'Color Scheme', 'twentyfifteen' ), 'section' => 'colors', + 'type' => 'select', 'choices' => twentyfifteen_get_color_scheme_choices(), 'priority' => 1, - ) ) ); + ) ); // Add custom sidebar text color setting and control. $wp_customize->add_setting( 'sidebar_textcolor', array( @@ -58,46 +59,6 @@ function twentyfifteen_customize_register( $wp_customize ) { } add_action( 'customize_register', 'twentyfifteen_customize_register', 11 ); -/** - * Custom control for Color Schemes - * - * @since Twenty Fifteen 1.0 - */ -function twentyfifteen_customize_color_scheme_control() { - class Twentyfifteen_Customize_Color_Scheme_Control extends WP_Customize_Control { - public $type = 'colorScheme'; - - function enqueue() { - wp_enqueue_script( 'color-scheme-control', get_template_directory_uri() . '/js/color-scheme-control.js', array( 'customize-controls' ), '', true ); - wp_localize_script( 'color-scheme-control', 'colorScheme', twentyfifteen_get_color_schemes() ); - } - - public function render_content() { - if ( empty( $this->choices ) ) - return; - - ?> - -