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/layout_preset/layout_preset.php +7 -26 2.4.11 → 2.2.10 View file →
@@ -9,26 +9,12 @@
9 9 */
10 10 if ( ! class_exists( 'SP_PC_Field_layout_preset' ) ) {
11 11 class SP_PC_Field_layout_preset extends SP_PC_Fields {
12 12
13 - /**
14 - * Constructor.
15 - *
16 - * @param [type] $field
17 - * @param string $value
18 - * @param string $unique
19 - * @param string $where
20 - * @param string $parent
21 - */
22 13 public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
23 14 parent::__construct( $field, $value, $unique, $where, $parent );
24 15 }
25 16
26 - /**
27 - * Render method
28 - *
29 - * @return void
30 - */
31 17 public function render() {
32 18
33 19 $args = wp_parse_args(
34 20 $this->field,
@@ -39,13 +25,13 @@
39 25 );
40 26
41 27 $value = ( is_array( $this->value ) ) ? $this->value : array_filter( (array) $this->value );
42 28
43 - echo wp_kses_post( $this->field_before() );
29 + echo $this->field_before();
44 30
45 31 if ( ! empty( $args['options'] ) ) {
46 32
47 - 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'] . '">';
48 34
49 35 $num = 1;
50 36
51 37 foreach ( $args['options'] as $key => $option ) {
@@ -55,11 +41,11 @@
55 41 $active = ( in_array( $key, $value ) ) ? ' spf--active' : '';
56 42 $checked = ( in_array( $key, $value ) ) ? ' checked' : '';
57 43 $pcp_pro_only_class = isset( $option['pro_only'] ) ? ' pcp-pro-only' : '';
58 44
59 - echo '<div class="spf--sibling spf--image' . esc_attr( $active . $pcp_pro_only_class ) . '">';
60 - echo '<img src="' . esc_url( $option['image'] ) . '" alt="' . esc_attr( $option['text'] ) . '" />';
61 - 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 ) . '/>';
45 + echo '<div class="spf--sibling spf--image' . $active . $pcp_pro_only_class . '">';
46 + echo '<img src="' . esc_url( $option['image'] ) . '" alt="' . $option['text'] . '" />';
47 + echo '<input type="' . $type . '" name="' . esc_attr( $this->field_name( $extra ) ) . '" value="' . $key . '"' . $this->field_attributes() . $checked . '/>';
62 48 echo '<span class="sp-carousel-type">' . esc_html( $option['text'] ) . '</span>';
63 49 echo '</div>';
64 50
65 51 }
@@ -69,17 +55,12 @@
69 55 }
70 56
71 57 echo '<div class="clear"></div>';
72 58
73 - echo wp_kses_post( $this->field_after() );
59 + echo $this->field_after();
74 60
75 61 }
76 62
77 - /**
78 - * The output method.
79 - *
80 - * @return mixed
81 - */
82 63 public function output() {
83 64
84 65 $output = '';
85 66 $bg_image = array();
@@ -85,9 +66,9 @@
85 66 $bg_image = array();
86 67 $important = ( ! empty( $this->field['output_important'] ) ) ? '!important' : '';
87 68 $elements = ( is_array( $this->field['output'] ) ) ? join( ',', $this->field['output'] ) : $this->field['output'];
88 69
89 - if ( ! empty( $elements ) && isset( $this->value ) && '' !== $this->value ) {
70 + if ( ! empty( $elements ) && isset( $this->value ) && $this->value !== '' ) {
90 71 $output = $elements . '{background-image:url(' . $this->value . ')' . $important . ';}';
91 72 }
92 73
93 74 $this->parent->output_css .= $output;