json['palette'] = $this->palette;
$this->json['defaultValue'] = $this->setting->default;
$this->json[ 'link' ] = $this->get_link();
$this->json[ 'show_opacity' ] = $this->show_opacity;
if ( is_array( $this->json['palette'] ) ) {
$this->json['palette'] = implode( '|', $this->json['palette'] );
} else {
// Default to true.
$this->json['palette'] = ( false === $this->json['palette'] || 'false' === $this->json['palette'] ) ? 'false' : 'true';
}
// Support passing show_opacity as string or boolean. Default to true.
$this->json[ 'show_opacity' ] = ( false === $this->json[ 'show_opacity' ] || 'false' === $this->json[ 'show_opacity' ] ) ? 'false' : 'true';
}
/**
* Render the control.
*/
public function render_content() {}
public function content_template() {
?>
<# if ( data.label && '' !== data.label ) { #>
{{ data.label }}
<# } #>