WordPress.org

Make WordPress Core

Ticket #37174: 37174.0.diff

File 37174.0.diff, 667 bytes (added by westonruter, 5 years ago)

Check if default value _.isString()

  • src/wp-includes/customize/class-wp-customize-color-control.php

    diff --git src/wp-includes/customize/class-wp-customize-color-control.php src/wp-includes/customize/class-wp-customize-color-control.php
    index fac9a7d..fe7fc8b 100644
    class WP_Customize_Color_Control extends WP_Customize_Control { 
    7979        public function content_template() {
    8080                ?>
    8181                <# var defaultValue = '';
    82                 if ( data.defaultValue ) {
     82                if ( data.defaultValue && _.isString( data.defaultValue ) ) {
    8383                        if ( '#' !== data.defaultValue.substring( 0, 1 ) ) {
    8484                                defaultValue = '#' + data.defaultValue;
    8585                        } else {