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/group/group.php +22 -47 2.4.212.2.10 View file →
@@ -1,40 +1,20 @@
1 -<?php
1 +<?php if ( ! defined( 'ABSPATH' ) ) {
2 + die; } // Cannot access directly.
2 3 /**
3 - * The framework group fields file.
4 4 *
5 - * @package Smart_Post_Show
6 - * @subpackage Smart_Post_Show/admin
5 + * Field: group
6 + *
7 + * @since 1.0.0
8 + * @version 1.0.0
7 9 */
8 -
9 -if ( ! defined( 'ABSPATH' ) ) {
10 - die;
11 -} // Cannot access directly.
12 -
13 -
14 10 if ( ! class_exists( 'SP_PC_Field_group' ) ) {
15 - /**
16 - * SP_PC_Field_group
17 - */
18 11 class SP_PC_Field_group extends SP_PC_Fields {
19 - /**
20 - * Field constructor.
21 - *
22 - * @param array $field The field type.
23 - * @param string $value The values of the field.
24 - * @param string $unique The unique ID for the field.
25 - * @param string $where To where show the output CSS.
26 - * @param string $parent The parent args.
27 - */
12 +
28 13 public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
29 14 parent::__construct( $field, $value, $unique, $where, $parent );
30 15 }
31 16
32 - /**
33 - * The render method.
34 - *
35 - * @return void
36 - */
37 17 public function render() {
38 18
39 19 $args = wp_parse_args(
40 20 $this->field,
@@ -41,9 +21,9 @@
41 21 array(
42 22 'max' => 0,
43 23 'min' => 0,
44 24 'fields' => array(),
45 - 'button_title' => esc_html__( 'Add New', 'post-carousel' ),
25 + 'button_title' => esc_html__( 'Add New', 'smart-post-show' ),
46 26 'accordion_title_prefix' => '',
47 27 'accordion_title_number' => false,
48 28 'accordion_title_auto' => true,
49 29 )
@@ -54,13 +34,13 @@
54 34 $title_auto = ( ! empty( $args['accordion_title_auto'] ) ) ? true : false;
55 35
56 36 if ( ! empty( $this->parent ) && preg_match( '/' . preg_quote( '[' . $this->field['id'] . ']' ) . '/', $this->parent ) ) {
57 37
58 - echo '<div class="spf-notice spf-notice-danger">' . esc_html__( 'Error: Nested field id can not be same with another nested field id.', 'post-carousel' ) . '</div>';
38 + echo '<div class="spf-notice spf-notice-danger">' . esc_html__( 'Error: Nested field id can not be same with another nested field id.', 'smart-post-show' ) . '</div>';
59 39
60 40 } else {
61 41
62 - echo wp_kses_post( $this->field_before() );
42 + echo $this->field_before();
63 43
64 44 echo '<div class="spf-cloneable-item spf-cloneable-hidden">';
65 45
66 46 echo '<div class="spf-cloneable-helper">';
@@ -65,15 +45,15 @@
65 45
66 46 echo '<div class="spf-cloneable-helper">';
67 47 echo '<i class="spf-cloneable-sort fa fa-arrows"></i>';
68 48 echo '<i class="spf-cloneable-clone fa fa-clone"></i>';
69 - echo '<i class="spf-cloneable-remove spf-confirm fa fa-times" data-confirm="' . esc_html__( 'Are you sure to delete this item?', 'post-carousel' ) . '"></i>';
49 + echo '<i class="spf-cloneable-remove spf-confirm fa fa-times" data-confirm="' . esc_html__( 'Are you sure to delete this item?', 'smart-post-show' ) . '"></i>';
70 50 echo '</div>';
71 51
72 52 echo '<h4 class="spf-cloneable-title">';
73 53 echo '<span class="spf-cloneable-text">';
74 54 echo ( $title_number ) ? '<span class="spf-cloneable-title-number"></span>' : '';
75 - echo ( $title_prefix ) ? '<span class="spf-cloneable-title-prefix">' . esc_html( $title_prefix ) . '</span>' : '';
55 + echo ( $title_prefix ) ? '<span class="spf-cloneable-title-prefix">' . $title_prefix . '</span>' : '';
76 56 echo ( $title_auto ) ? '<span class="spf-cloneable-value"><span class="spf-cloneable-placeholder"></span></span>' : '';
77 57 echo '</span>';
78 58 echo '</h4>';
79 59
@@ -89,9 +69,9 @@
89 69 echo '</div>';
90 70
91 71 echo '</div>';
92 72
93 - echo '<div class="spf-cloneable-wrapper spf-data-wrapper" data-title-number="' . esc_attr( $title_number ) . '" data-unique-id="' . esc_attr( $this->unique ) . '" data-field-id="[' . esc_attr( $this->field['id'] ) . ']" data-max="' . esc_attr( $args['max'] ) . '" data-min="' . esc_attr( $args['min'] ) . '">';
73 + echo '<div class="spf-cloneable-wrapper spf-data-wrapper" data-title-number="' . $title_number . '" data-unique-id="' . $this->unique . '" data-field-id="[' . $this->field['id'] . ']" data-max="' . $args['max'] . '" data-min="' . $args['min'] . '">';
94 74
95 75 if ( ! empty( $this->value ) ) {
96 76
97 77 $num = 0;
@@ -97,9 +77,9 @@
97 77 $num = 0;
98 78
99 79 foreach ( $this->value as $value ) {
100 80
101 - $first_id = ( isset( $this->field['fields'][0]['id'] ) ) ? $this->field['fields'][0]['id'] : '';
81 + $first_id = ( isset( $this->field['fields'][0]['id'] ) ) ? $this->field['fields'][0]['id'] : '';
102 82
103 83 $first_value = ( isset( $value[ $first_id ] ) ) ? $value[ $first_id ] : '';
104 84
105 85 echo '<div class="spf-cloneable-item">';
@@ -106,16 +86,16 @@
106 86
107 87 echo '<div class="spf-cloneable-helper">';
108 88 echo '<i class="spf-cloneable-sort fa fa-arrows"></i>';
109 89 echo '<i class="spf-cloneable-clone fa fa-clone"></i>';
110 - echo '<i class="spf-cloneable-remove spf-confirm fa fa-times" data-confirm="' . esc_html__( 'Are you sure to delete this item?', 'post-carousel' ) . '"></i>';
90 + echo '<i class="spf-cloneable-remove spf-confirm fa fa-times" data-confirm="' . esc_html__( 'Are you sure to delete this item?', 'smart-post-show' ) . '"></i>';
111 91 echo '</div>';
112 92
113 93 echo '<h4 class="spf-cloneable-title">';
114 94 echo '<span class="spf-cloneable-text">';
115 - echo ( $title_number ) ? '<span class="spf-cloneable-title-number">' . esc_html( ( $num + 1 ) ) . ' . </span>' : '';
116 - echo ( $title_prefix ) ? '<span class="spf-cloneable-title-prefix">' . esc_html( $title_prefix ) . '</span>' : '';
117 - echo ( $title_auto ) ? '<span class="spf-cloneable-value">' . esc_html( $first_value ) . '</span>' : '';
95 + echo ( $title_number ) ? '<span class="spf-cloneable-title-number">' . ( $num + 1 ) . ' . </span>' : '';
96 + echo ( $title_prefix ) ? '<span class="spf-cloneable-title-prefix">' . $title_prefix . '</span>' : '';
97 + echo ( $title_auto ) ? '<span class="spf-cloneable-value">' . $first_value . '</span>' : '';
118 98 echo '</span>';
119 99 echo '</h4>';
120 100
121 101 echo '<div class="spf-cloneable-content">';
@@ -140,24 +120,19 @@
140 120 }
141 121
142 122 echo '</div>';
143 123
144 - echo '<div class="spf-cloneable-alert spf-cloneable-max">' . esc_html__( 'You can not add more than', 'post-carousel' ) . ' ' . esc_html( $args['max'] ) . '</div>';
145 - echo '<div class="spf-cloneable-alert spf-cloneable-min">' . esc_html__( 'You can not remove less than', 'post-carousel' ) . ' ' . esc_html( $args['min'] ) . '</div>';
124 + echo '<div class="spf-cloneable-alert spf-cloneable-max">' . esc_html__( 'You can not add more than', 'smart-post-show' ) . ' ' . $args['max'] . '</div>';
125 + echo '<div class="spf-cloneable-alert spf-cloneable-min">' . esc_html__( 'You can not remove less than', 'smart-post-show' ) . ' ' . $args['min'] . '</div>';
146 126
147 - echo '<a href="#" class="button button-primary spf-cloneable-add">' . esc_html( $args['button_title'] ) . '</a>';
127 + echo '<a href="#" class="button button-primary spf-cloneable-add">' . $args['button_title'] . '</a>';
148 128
149 - echo wp_kses_post( $this->field_after() );
129 + echo $this->field_after();
150 130
151 131 }
152 132
153 133 }
154 134
155 - /**
156 - * Enqueue Accordion UI.
157 - *
158 - * @return void
159 - */
160 135 public function enqueue() {
161 136
162 137 if ( ! wp_script_is( 'jquery-ui-accordion' ) ) {
163 138 wp_enqueue_script( 'jquery-ui-accordion' );