From 297f2c78c512261991324c0b7cb05371abc880dd Mon Sep 17 00:00:00 2001 From: Ian Stewart Date: Fri, 17 Oct 2014 20:51:46 +0000 Subject: [PATCH] Twenty Fifteen: Removing unused custom color controls. Props cainm, fixes #29982 and #29959. git-svn-id: https://develop.svn.wordpress.org/trunk@29944 602fd350-edb4-49c9-b593-d223f7449a82 --- .../themes/twentyfifteen/inc/customizer.php | 57 ++++----------- .../twentyfifteen/js/color-scheme-control.js | 70 ++++++++++--------- 2 files changed, 51 insertions(+), 76 deletions(-) diff --git a/src/wp-content/themes/twentyfifteen/inc/customizer.php b/src/wp-content/themes/twentyfifteen/inc/customizer.php index a4a5e91c4f..08b2d73c94 100644 --- a/src/wp-content/themes/twentyfifteen/inc/customizer.php +++ b/src/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; - - ?> - -