wip
This commit is contained in:
@@ -92,8 +92,12 @@ class WP_Customize_Color_Control extends WP_Customize_Control {
|
||||
*/
|
||||
public function content_template() {
|
||||
?>
|
||||
<# var defaultValue = '#RRGGBB', defaultValueAttr = '',
|
||||
<#
|
||||
var defaultValue = '#RRGGBB',
|
||||
defaultValueAttr = '',
|
||||
inputId = _.uniqueId( 'customize-color-control-input-' ),
|
||||
isHueSlider = data.mode === 'hue';
|
||||
|
||||
if ( data.defaultValue && _.isString( data.defaultValue ) && ! isHueSlider ) {
|
||||
if ( '#' !== data.defaultValue.substring( 0, 1 ) ) {
|
||||
defaultValue = '#' + data.defaultValue;
|
||||
@@ -101,7 +105,8 @@ class WP_Customize_Color_Control extends WP_Customize_Control {
|
||||
defaultValue = data.defaultValue;
|
||||
}
|
||||
defaultValueAttr = ' data-default-color=' + defaultValue; // Quotes added automatically.
|
||||
} #>
|
||||
}
|
||||
#>
|
||||
<# if ( data.label ) { #>
|
||||
<span class="customize-control-title">{{{ data.label }}}</span>
|
||||
<# } #>
|
||||
@@ -109,13 +114,12 @@ class WP_Customize_Color_Control extends WP_Customize_Control {
|
||||
<span class="description customize-control-description">{{{ data.description }}}</span>
|
||||
<# } #>
|
||||
<div class="customize-control-content">
|
||||
<label><span class="screen-reader-text">{{{ data.label }}}</span>
|
||||
<label for="{{ inputId }}"><span class="screen-reader-text">{{{ data.label }}}</span></label>
|
||||
<# if ( isHueSlider ) { #>
|
||||
<input class="color-picker-hue" type="text" data-type="hue" />
|
||||
<input id="{{ inputId }}" class="color-picker-hue" type="number" min="1" max="359" data-type="hue" />
|
||||
<# } else { #>
|
||||
<input class="color-picker-hex" type="text" maxlength="7" placeholder="{{ defaultValue }}" {{ defaultValueAttr }} />
|
||||
<input id="{{ inputId }}" class="color-picker-hex" type="text" maxlength="7" placeholder="{{ defaultValue }}" {{ defaultValueAttr }} />
|
||||
<# } #>
|
||||
</label>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
@@ -197,9 +197,10 @@ final class WP_Customize_Custom_CSS_Setting extends WP_Customize_Setting {
|
||||
)
|
||||
);
|
||||
|
||||
if ( $r instanceof WP_Error ) {
|
||||
if ( is_wp_error( $r ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$post_id = $r->ID;
|
||||
|
||||
// Cache post ID in theme mod for performance to avoid additional DB query.
|
||||
|
||||
@@ -173,12 +173,6 @@ class WP_Customize_Header_Image_Control extends WP_Customize_Image_Control {
|
||||
<img src="{{data.header.thumbnail_url}}" alt="{{data.header.alt_text || data.header.description}}" />
|
||||
|
||||
<# } #>
|
||||
<# } else { #>
|
||||
|
||||
<div class="placeholder">
|
||||
<?php _e( 'No image set' ); ?>
|
||||
</div>
|
||||
|
||||
<# } #>
|
||||
</script>
|
||||
<?php
|
||||
@@ -246,7 +240,7 @@ class WP_Customize_Header_Image_Control extends WP_Customize_Image_Control {
|
||||
<div class="actions">
|
||||
<?php if ( current_user_can( 'upload_files' ) ) : ?>
|
||||
<button type="button"<?php echo $visibility; ?> class="button remove" aria-label="<?php esc_attr_e( 'Hide header image' ); ?>"><?php _e( 'Hide image' ); ?></button>
|
||||
<button type="button" class="button new" id="header_image-button" aria-label="<?php esc_attr_e( 'Add Header Image' ); ?>"><?php _e( 'Add Image' ); ?></button>
|
||||
<button type="button" class="button new <?php echo ! $this->get_current_image_src() ? '' : 'customize-header-image-not-selected'; ?>" id="header_image-button" aria-label="<?php esc_attr_e( 'Add Header Image' ); ?>"><?php _e( 'Add Image' ); ?></button>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="choices">
|
||||
|
||||
@@ -196,7 +196,7 @@ class WP_Customize_Media_Control extends WP_Customize_Control {
|
||||
<# } else { #>
|
||||
<div class="attachment-media-view">
|
||||
<# if ( data.canUpload ) { #>
|
||||
<button type="button" class="upload-button button-add-media" {{{ describedByAttr }}}>{{ data.button_labels.select }}</button>
|
||||
<button type="button" class="upload-button button" {{{ describedByAttr }}}>{{ data.button_labels.select }}</button>
|
||||
<# } #>
|
||||
<div class="actions">
|
||||
<# if ( data.defaultAttachment ) { #>
|
||||
|
||||
@@ -193,7 +193,7 @@ final class WP_Customize_Selective_Refresh {
|
||||
);
|
||||
|
||||
// Export data to JS.
|
||||
wp_print_inline_script_tag( sprintf( 'var _customizePartialRefreshExports = %s;', wp_json_encode( $exports ) ) );
|
||||
wp_print_inline_script_tag( sprintf( 'var _customizePartialRefreshExports = %s;', wp_json_encode( $exports, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ) ) . "\n//# sourceURL=" . rawurlencode( __METHOD__ ) );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -126,7 +126,7 @@ class WP_Customize_Site_Icon_Control extends WP_Customize_Cropped_Image_Control
|
||||
<# } else { #>
|
||||
<div class="attachment-media-view">
|
||||
<# if ( data.canUpload ) { #>
|
||||
<button type="button" class="upload-button button-add-media"><?php echo $this->button_labels['site_icon']; ?></button>
|
||||
<button type="button" class="upload-button button"><?php echo $this->button_labels['site_icon']; ?></button>
|
||||
<# } #>
|
||||
<div class="actions">
|
||||
<# if ( data.defaultAttachment ) { #>
|
||||
|
||||
Reference in New Issue
Block a user