From cf16ccb24e2f244b6202f7b6e48dd287f58b7df7 Mon Sep 17 00:00:00 2001 From: Aristeides Stathopoulos Date: Sun, 18 Dec 2016 17:01:27 +0200 Subject: [PATCH] Allow defining a style for the label on radio-image controls --- controls/radio-image/class-kirki-control-radio-image.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/controls/radio-image/class-kirki-control-radio-image.php b/controls/radio-image/class-kirki-control-radio-image.php index 9a5992209..4a0acb130 100644 --- a/controls/radio-image/class-kirki-control-radio-image.php +++ b/controls/radio-image/class-kirki-control-radio-image.php @@ -95,8 +95,13 @@ public function to_json() { } $this->json['inputAttrs'] = ''; + $this->json['labelStyle'] = ''; foreach ( $this->input_attrs as $attr => $value ) { - $this->json['inputAttrs'] .= $attr . '="' . esc_attr( $value ) . '" '; + if ( 'style' !== $attr ) { + $this->json['inputAttrs'] .= $attr . '="' . esc_attr( $value ) . '" '; + } else { + $this->json['labelStyle'] = 'style="' . esc_attr( $value ) . '" '; + } } } @@ -124,7 +129,7 @@ protected function content_template() {
<# for ( key in data.choices ) { #> checked="checked"<# } #>> -