← All changes
|
admin/views/sp-framework/fields/box_shadow/box_shadow.php
+18
-23
2.4.11
→
2.2.10
View file →
| @@ -18,12 +18,12 @@ | ||
| 18 | 18 | |
| 19 | 19 | $args = wp_parse_args( |
| 20 | 20 | $this->field, |
| 21 | 21 | array( |
| 22 | - 'horizontal_icon' => __( 'X offset', 'post-carousel' ), | |
| 23 | - 'vertical_icon' => __( 'Y offset', 'post-carousel' ), | |
| 24 | - 'blur_icon' => __( 'Blur', 'post-carousel' ), | |
| 25 | - 'spread_icon' => __( 'Spread', 'post-carousel' ), | |
| 22 | + 'horizontal_icon' => __( 'X offset', 'smart-post-show' ), | |
| 23 | + 'vertical_icon' => __( 'Y offset', 'smart-post-show' ), | |
| 24 | + 'blur_icon' => __( 'Blur', 'smart-post-show' ), | |
| 25 | + 'spread_icon' => __( 'Spread', 'smart-post-show' ), | |
| 26 | 26 | 'horizontal_placeholder' => 'h-offset', |
| 27 | 27 | 'vertical_placeholder' => 'v-offset', |
| 28 | 28 | 'blur_placeholder' => 'blur', |
| 29 | 29 | 'spread_placeholder' => 'spread', |
| @@ -49,9 +49,9 @@ | ||
| 49 | 49 | $default_value = ( ! empty( $this->field['default'] ) ) ? wp_parse_args( $this->field['default'], $default_value ) : $default_value; |
| 50 | 50 | |
| 51 | 51 | $value = wp_parse_args( $this->value, $default_value ); |
| 52 | 52 | |
| 53 | - echo wp_kses_post( $this->field_before() ); | |
| 53 | + echo $this->field_before(); | |
| 54 | 54 | |
| 55 | 55 | echo '<div class="spf--inputs">'; |
| 56 | 56 | |
| 57 | 57 | $properties = array(); |
| @@ -66,11 +66,11 @@ | ||
| 66 | 66 | |
| 67 | 67 | $placeholder = ( ! empty( $args[ $property . '_placeholder' ] ) ) ? ' placeholder="' . $args[ $property . '_placeholder' ] . '"' : ''; |
| 68 | 68 | |
| 69 | 69 | echo '<div class="spf--input">'; |
| 70 | - echo ( ! empty( $args[ $property . '_icon' ] ) ) ? '<span class="spf--label spf--icon">' . wp_kses_post( $args[ $property . '_icon' ] ) . '</span>' : ''; | |
| 71 | - echo '<input type="number" name="' . esc_attr( $this->field_name( '[' . $property . ']' ) ) . '" value="' . esc_attr( $value[ $property ] ) . '"' . wp_kses_post( $placeholder ) . ' class="spf-input-number spf--is-unit" />'; | |
| 72 | - echo ( ! empty( $args['unit'] ) ) ? '<span class="spf--label spf--unit">' . esc_html( $args['unit'] ) . '</span>' : ''; | |
| 70 | + echo ( ! empty( $args[ $property . '_icon' ] ) ) ? '<span class="spf--label spf--icon">' . $args[ $property . '_icon' ] . '</span>' : ''; | |
| 71 | + echo '<input type="number" name="' . $this->field_name( '[' . $property . ']' ) . '" value="' . $value[ $property ] . '"' . $placeholder . ' class="spf-input-number spf--is-unit" />'; | |
| 72 | + echo ( ! empty( $args['unit'] ) ) ? '<span class="spf--label spf--unit">' . $args['unit'] . '</span>' : ''; | |
| 73 | 73 | echo '</div>'; |
| 74 | 74 | |
| 75 | 75 | } |
| 76 | 76 | |
| @@ -75,12 +75,12 @@ | ||
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | if ( ! empty( $args['style'] ) ) { |
| 78 | 78 | echo '<div class="spf--input">'; |
| 79 | - echo '<select name="' . esc_attr( $this->field_name( '[style]' ) ) . '">'; | |
| 79 | + echo '<select name="' . $this->field_name( '[style]' ) . '">'; | |
| 80 | 80 | foreach ( array( 'inset', 'outset' ) as $style ) { |
| 81 | 81 | $selected = ( $value['style'] === $style ) ? ' selected' : ''; |
| 82 | - echo '<option value="' . esc_attr( $style ) . '"' . esc_attr( $selected ) . '>' . esc_html( ucfirst( $style ) ) . '</option>'; | |
| 82 | + echo '<option value="' . $style . '"' . $selected . '>' . ucfirst( $style ) . '</option>'; | |
| 83 | 83 | } |
| 84 | 84 | echo '</select>'; |
| 85 | 85 | echo '</div>'; |
| 86 | 86 | } |
| @@ -89,23 +89,18 @@ | ||
| 89 | 89 | |
| 90 | 90 | if ( ! empty( $args['color'] ) ) { |
| 91 | 91 | $default_color_attr = ( ! empty( $default_value['color'] ) ) ? ' data-default-color="' . $default_value['color'] . '"' : ''; |
| 92 | 92 | echo '<div class="spf-field-color">'; |
| 93 | - echo '<input type="text" name="' . esc_attr( $this->field_name( '[color]' ) ) . '" value="' . esc_attr( $value['color'] ) . '" class="spf-color"' . wp_kses_post( $default_color_attr ) . ' />'; | |
| 93 | + echo '<input type="text" name="' . $this->field_name( '[color]' ) . '" value="' . $value['color'] . '" class="spf-color"' . $default_color_attr . ' />'; | |
| 94 | 94 | echo '</div>'; |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | echo '<div class="clear"></div>'; |
| 98 | 98 | |
| 99 | - echo wp_kses_post( $this->field_after() ); | |
| 99 | + echo $this->field_after(); | |
| 100 | 100 | |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | - /** | |
| 104 | - * The output function | |
| 105 | - * | |
| 106 | - * @return mixed | |
| 107 | - */ | |
| 108 | 103 | public function output() { |
| 109 | 104 | |
| 110 | 105 | $output = ''; |
| 111 | 106 | $unit = ( ! empty( $this->value['unit'] ) ) ? $this->value['unit'] : 'px'; |
| @@ -112,14 +107,14 @@ | ||
| 112 | 107 | $important = ( ! empty( $this->field['output_important'] ) ) ? '!important' : ''; |
| 113 | 108 | $element = ( is_array( $this->field['output'] ) ) ? join( ',', $this->field['output'] ) : $this->field['output']; |
| 114 | 109 | |
| 115 | 110 | // properties. |
| 116 | - $horizontal = ( isset( $this->value['horizontal'] ) && '' !== $this->value['horizontal'] ) ? $this->value['horizontal'] : ''; | |
| 117 | - $vertical = ( isset( $this->value['vertical'] ) && '' !== $this->value['vertical'] ) ? $this->value['vertical'] : ''; | |
| 118 | - $blur = ( isset( $this->value['blur'] ) && '' !== $this->value['blur'] ) ? $this->value['blur'] : ''; | |
| 119 | - $spread = ( isset( $this->value['spread'] ) && '' !== $this->value['spread'] ) ? $this->value['spread'] : ''; | |
| 120 | - $style = ( isset( $this->value['style'] ) && '' !== $this->value['style'] && 'outset' !== $this->value['style'] ) ? $this->value['style'] : ''; | |
| 121 | - $color = ( isset( $this->value['color'] ) && '' !== $this->value['color'] ) ? $this->value['color'] : ''; | |
| 111 | + $horizontal = ( isset( $this->value['horizontal'] ) && $this->value['horizontal'] !== '' ) ? $this->value['horizontal'] : ''; | |
| 112 | + $vertical = ( isset( $this->value['vertical'] ) && $this->value['vertical'] !== '' ) ? $this->value['vertical'] : ''; | |
| 113 | + $blur = ( isset( $this->value['blur'] ) && $this->value['blur'] !== '' ) ? $this->value['blur'] : ''; | |
| 114 | + $spread = ( isset( $this->value['spread'] ) && $this->value['spread'] !== '' ) ? $this->value['spread'] : ''; | |
| 115 | + $style = ( isset( $this->value['style'] ) && $this->value['style'] !== '' && $this->value['style'] !== 'outset' ) ? $this->value['style'] : ''; | |
| 116 | + $color = ( isset( $this->value['color'] ) && $this->value['color'] !== '' ) ? $this->value['color'] : ''; | |
| 122 | 117 | |
| 123 | 118 | $output = $element . '{ box-shadow: '; |
| 124 | 119 | $output .= ( '' !== $horizontal ) ? $horizontal . $unit : '0' . $unit; |
| 125 | 120 | $output .= ( '' !== $vertical ) ? $vertical . $unit : '0' . $unit; |