← All changes
|
admin/views/sp-framework/fields/image_select/image_select.php
+7
-17
2.3.6
→
2.2.10
View file →
| @@ -13,13 +13,8 @@ | ||
| 13 | 13 | public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) { |
| 14 | 14 | parent::__construct( $field, $value, $unique, $where, $parent ); |
| 15 | 15 | } |
| 16 | 16 | |
| 17 | - /** | |
| 18 | - * Render method. | |
| 19 | - * | |
| 20 | - * @return void | |
| 21 | - */ | |
| 22 | 17 | public function render() { |
| 23 | 18 | |
| 24 | 19 | $args = wp_parse_args( |
| 25 | 20 | $this->field, |
| @@ -30,13 +25,13 @@ | ||
| 30 | 25 | ); |
| 31 | 26 | |
| 32 | 27 | $value = ( is_array( $this->value ) ) ? $this->value : array_filter( (array) $this->value ); |
| 33 | 28 | |
| 34 | - echo wp_kses_post( $this->field_before() ); | |
| 29 | + echo $this->field_before(); | |
| 35 | 30 | |
| 36 | 31 | if ( ! empty( $args['options'] ) ) { |
| 37 | 32 | |
| 38 | - echo '<div class="spf-siblings spf--image-group" data-multiple="' . esc_attr( $args['multiple'] ) . '">'; | |
| 33 | + echo '<div class="spf-siblings spf--image-group" data-multiple="' . $args['multiple'] . '">'; | |
| 39 | 34 | |
| 40 | 35 | $num = 1; |
| 41 | 36 | |
| 42 | 37 | foreach ( $args['options'] as $key => $option ) { |
| @@ -45,12 +40,12 @@ | ||
| 45 | 40 | $extra = ( $args['multiple'] ) ? '[]' : ''; |
| 46 | 41 | $active = ( in_array( $key, $value ) ) ? ' spf--active' : ''; |
| 47 | 42 | $checked = ( in_array( $key, $value ) ) ? ' checked' : ''; |
| 48 | 43 | |
| 49 | - echo '<div class="spf--sibling spf--image' . esc_attr( $active ) . '">'; | |
| 50 | - echo '<img src="' . esc_url( $option ) . '" alt="' . esc_attr( $key ) . '" />'; | |
| 44 | + echo '<div class="spf--sibling spf--image' . $active . '">'; | |
| 45 | + echo '<img src="' . $option . '" alt="' . $key . '" />'; | |
| 51 | 46 | /* echo '<img src="' . $option . '" alt="' . $num++ . '" />'; */ |
| 52 | - echo '<input type="' . esc_attr( $type ) . '" name="' . esc_attr( $this->field_name( $extra ) ) . '" value="' . esc_attr( $key ) . '"' . wp_kses_post( $this->field_attributes() ) . esc_attr( $checked ) . '/>'; | |
| 47 | + echo '<input type="' . $type . '" name="' . $this->field_name( $extra ) . '" value="' . $key . '"' . $this->field_attributes() . $checked . '/>'; | |
| 53 | 48 | echo '</div>'; |
| 54 | 49 | |
| 55 | 50 | } |
| 56 | 51 | |
| @@ -59,17 +54,12 @@ | ||
| 59 | 54 | } |
| 60 | 55 | |
| 61 | 56 | echo '<div class="clear"></div>'; |
| 62 | 57 | |
| 63 | - echo wp_kses_post( $this->field_after() ); | |
| 58 | + echo $this->field_after(); | |
| 64 | 59 | |
| 65 | 60 | } |
| 66 | 61 | |
| 67 | - /** | |
| 68 | - * The output method. | |
| 69 | - * | |
| 70 | - * @return mixed | |
| 71 | - */ | |
| 72 | 62 | public function output() { |
| 73 | 63 | |
| 74 | 64 | $output = ''; |
| 75 | 65 | $bg_image = array(); |
| @@ -75,9 +65,9 @@ | ||
| 75 | 65 | $bg_image = array(); |
| 76 | 66 | $important = ( ! empty( $this->field['output_important'] ) ) ? '!important' : ''; |
| 77 | 67 | $elements = ( is_array( $this->field['output'] ) ) ? join( ',', $this->field['output'] ) : $this->field['output']; |
| 78 | 68 | |
| 79 | - if ( ! empty( $elements ) && isset( $this->value ) && '' !== $this->value ) { | |
| 69 | + if ( ! empty( $elements ) && isset( $this->value ) && $this->value !== '' ) { | |
| 80 | 70 | $output = $elements . '{background-image:url(' . $this->value . ')' . $important . ';}'; |
| 81 | 71 | } |
| 82 | 72 | |
| 83 | 73 | $this->parent->output_css .= $output; |