PluginProbe
Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News / 2.2.10
Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News v2.2.10
4.0.8 4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 4.0.2 4.0.1 2.3.5 2.3.6 2.4.0 2.4.1 2.4.10 2.4.11 2.4.12 2.4.13 2.4.14 2.4.15 2.4.16 2.4.17 2.4.18 2.4.19 2.4.2 2.4.20 2.4.21 All 88 releases
← All changes | admin/views/sp-framework/fields/switcher/switcher.php +10 -23 2.4.11 → 2.2.10 View file →
@@ -8,47 +8,34 @@
8 8 * @version 1.0.0
9 9 */
10 10 if ( ! class_exists( 'SP_PC_Field_switcher' ) ) {
11 11 class SP_PC_Field_switcher extends SP_PC_Fields {
12 - /**
13 - * The class constructor.
14 - *
15 - * @param [type] $field
16 - * @param string $value
17 - * @param string $unique
18 - * @param string $where
19 - * @param string $parent
20 - */
12 +
21 13 public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
22 14 parent::__construct( $field, $value, $unique, $where, $parent );
23 15 }
24 16
25 - /**
26 - * Render method.
27 - *
28 - * @return void
29 - */
30 17 public function render() {
31 18
32 19 $active = ( ! empty( $this->value ) ) ? ' spf--active' : '';
33 - $text_on = ( ! empty( $this->field['text_on'] ) ) ? $this->field['text_on'] : esc_html__( 'On', 'post-carousel' );
34 - $text_off = ( ! empty( $this->field['text_off'] ) ) ? $this->field['text_off'] : esc_html__( 'Off', 'post-carousel' );
20 + $text_on = ( ! empty( $this->field['text_on'] ) ) ? $this->field['text_on'] : esc_html__( 'On', 'smart-post-show' );
21 + $text_off = ( ! empty( $this->field['text_off'] ) ) ? $this->field['text_off'] : esc_html__( 'Off', 'smart-post-show' );
35 22 $text_width = ( ! empty( $this->field['text_width'] ) ) ? ' style="width: ' . $this->field['text_width'] . 'px;"' : '';
36 23
37 - echo wp_kses_post( $this->field_before() );
24 + echo $this->field_before();
38 25
39 - echo '<div class="spf--switcher' . esc_attr( $active ) . '"' . wp_kses_post( $text_width ) . '>';
40 - echo '<span class="spf--on">' . esc_html( $text_on ) . '</span>';
41 - echo '<span class="spf--off">' . esc_html( $text_off ) . '</span>';
26 + echo '<div class="spf--switcher' . $active . '"' . $text_width . '>';
27 + echo '<span class="spf--on">' . $text_on . '</span>';
28 + echo '<span class="spf--off">' . $text_off . '</span>';
42 29 echo '<span class="spf--ball"></span>';
43 - echo '<input type="text" name="' . esc_attr( $this->field_name() ) . '" value="' . esc_attr( $this->value ) . '"' . wp_kses_post( $this->field_attributes() ) . ' />';
30 + echo '<input type="text" name="' . $this->field_name() . '" value="' . $this->value . '"' . $this->field_attributes() . ' />';
44 31 echo '</div>';
45 32
46 - echo ( ! empty( $this->field['label'] ) ) ? '<span class="spf--label">' . esc_html( $this->field['label'] ) . '</span>' : '';
33 + echo ( ! empty( $this->field['label'] ) ) ? '<span class="spf--label">' . $this->field['label'] . '</span>' : '';
47 34
48 35 echo '<div class="clear"></div>';
49 36
50 - echo wp_kses_post( $this->field_after() );
37 + echo $this->field_after();
51 38
52 39 }
53 40
54 41 }