Post Grid - Version 2.0.55

Version Description

  • 2020-05-4 fix - remove empty read more text to avoid conflict old layout.
    • 2020-05-15 add - Element added for "kk Star Ratings" plugin
    • 2020-05-15 add - Element added for "Multi Rating" plugin
    • 2020-05-15 add - Element added for "Rate my Post" plugin
    • 2020-05-15 add - Element added for "Rating-Widget" plugin
    • 2020-05-15 add - Element added for "WP-PostRatings" plugin
    • 2020-05-15 add - Elements visitor votes, overall rating added for "Yasr Yet Another Stars Rating" plugin
    • 2020-05-15 add - Element added for "YITH - Add to Wishlist" plugin
Download this release

Release Info

Developer pickplugins
Plugin Icon 128x128 Post Grid
Version 2.0.55
Comparing to
See all releases

Code changes from version 2.0.54 to 2.0.55

assets/frontend/css/style.css CHANGED
@@ -224,75 +224,6 @@
224
 
225
  /*Grid Element CSS*/
226
 
227
- .post-grid .element.wc_add_to_cart {}
228
- .post-grid .element.wc_add_to_cart p {
229
- border: medium none !important;
230
- margin: 0 !important;
231
- padding: 0 !important;
232
- }
233
-
234
-
235
- .post-grid .element.wc_gallery {}
236
- .post-grid .element.wc_gallery img {
237
- border-radius: 0;
238
- box-shadow: none;
239
- display: inline-block;
240
- margin: 5px;
241
- vertical-align: top;
242
- width: 50px;
243
- }
244
-
245
- .post-grid .element.wc_full_price {}
246
- .post-grid .element.wc_full_price ins {
247
- background: rgba(0, 0, 0, 0) none repeat scroll 0 0;
248
- }
249
-
250
-
251
-
252
- .post-grid .share_button span {
253
- display: inline-block;
254
- margin: 3px;
255
-
256
- }
257
-
258
-
259
- .post-grid .share_button span a {
260
- display: inline-block;
261
- font-size: 25px;
262
- }
263
-
264
-
265
-
266
- .post-grid .zoom {
267
- background: #fff none repeat scroll 0 0;
268
- border-radius: 50%;
269
- box-shadow: 0 0 3px 0 rgb(153, 153, 153);
270
- cursor: pointer;
271
- display: inline;
272
- height: 50px;
273
- line-height: normal;
274
- text-align: center;
275
- width: 50px;
276
- }
277
-
278
- .post-grid .zoom .fa {
279
- color: #999;
280
- font-size: 24px;
281
- margin-top: 12px;
282
- }
283
-
284
- .post-grid .comments-area {
285
-
286
- }
287
-
288
- .post-grid .commentlist {
289
-
290
- }
291
-
292
- .post-grid .commentlist li {
293
- list-style: outside none none;
294
- margin: 0;
295
- }
296
 
297
 
298
  /*Lazy Load*/
224
 
225
  /*Grid Element CSS*/
226
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
227
 
228
 
229
  /*Lazy Load*/
includes/class-metabox-post-grid-layout-hook.php CHANGED
@@ -110,6 +110,8 @@ if(!function_exists('post_grid_layout_metabox_content_layout_builder')){
110
 
111
  <?php
112
 
 
 
113
  $elements_group['general'] = array(
114
  'group_title'=>'General',
115
  'items'=>array(
@@ -142,21 +144,16 @@ if(!function_exists('post_grid_layout_metabox_content_layout_builder')){
142
  ),
143
  );
144
 
145
- //
146
-
147
- //
148
-
149
- //
150
-
151
-
152
-
153
-
154
- //$elements_group['events_manager'] = array('group_title'=>'Events manager');
155
- //$elements_group['yith'] = array('group_title'=>'Yith');
156
-
157
-
158
 
 
 
 
 
159
 
 
 
 
 
160
 
161
  $elements_group = apply_filters('post_grid_layout_elements', $elements_group);
162
 
@@ -165,7 +162,9 @@ if(!function_exists('post_grid_layout_metabox_content_layout_builder')){
165
 
166
  if(!empty($elements_group))
167
  foreach ($elements_group as $group_index => $element_group):
168
- $group_items = $element_group['items'];
 
 
169
 
170
  foreach ($group_items as $elementIndex => $element):
171
  ob_start();
@@ -209,9 +208,11 @@ if(!function_exists('post_grid_layout_metabox_content_layout_builder')){
209
  if(!empty($elements_group))
210
  foreach ($elements_group as $group_index => $element_group):
211
 
212
- $group_title = $element_group['group_title'];
213
- $group_items = $element_group['items'];
 
214
 
 
215
  ?>
216
  <div class="item">
217
  <div class="element-title header ">
110
 
111
  <?php
112
 
113
+
114
+
115
  $elements_group['general'] = array(
116
  'group_title'=>'General',
117
  'items'=>array(
144
  ),
145
  );
146
 
 
 
 
 
 
 
 
 
 
 
 
 
 
147
 
148
+ $elements_group['star_rating'] = array(
149
+ 'group_title'=>'Star Rating',
150
+ 'items'=>array(),
151
+ );
152
 
153
+ $elements_group['wishlist'] = array(
154
+ 'group_title'=>'Wishlist',
155
+ 'items'=>array(),
156
+ );
157
 
158
  $elements_group = apply_filters('post_grid_layout_elements', $elements_group);
159
 
162
 
163
  if(!empty($elements_group))
164
  foreach ($elements_group as $group_index => $element_group):
165
+
166
+
167
+ $group_items = isset($element_group['items']) ? $element_group['items'] : array();
168
 
169
  foreach ($group_items as $elementIndex => $element):
170
  ob_start();
208
  if(!empty($elements_group))
209
  foreach ($elements_group as $group_index => $element_group):
210
 
211
+ $group_title = isset($element_group['group_title']) ? $element_group['group_title'] : '';
212
+ $group_items = isset($element_group['items']) ? $element_group['items'] : array();
213
+ //$group_items = apply_filters('post_grid_layout_group_'.$group_index, $group_items);
214
 
215
+ if(empty($group_items)) continue;
216
  ?>
217
  <div class="item">
218
  <div class="element-title header ">
includes/class-settings-tabs.php CHANGED
@@ -1671,6 +1671,7 @@ class settings_tabs_field{
1671
  .radio-img img{
1672
 
1673
  vertical-align: top;
 
1674
  }
1675
 
1676
  </style>
1671
  .radio-img img{
1672
 
1673
  vertical-align: top;
1674
+ width: 100%;
1675
  }
1676
 
1677
  </style>
includes/classes/class-post-grid-support.php CHANGED
@@ -65,155 +65,205 @@ class class_post_grid_support{
65
 
66
  $tutorials = array(
67
  array(
68
- 'question'=>__('Latest Version 2.0.46 Overview', 'post-grid'),
69
- 'answer_url'=>'https://youtu.be/YVtsIbEb9zs',
 
70
  ),
71
 
72
  array(
73
- 'question'=>__('How to create post grid', 'post-grid'),
74
- 'answer_url'=>'https://www.youtube.com/watch?v=g5kxtJIopXs',
 
75
  ),
76
  array(
77
- 'question'=>__('Custom read more text', 'post-grid'),
78
- 'answer_url'=>'https://www.youtube.com/watch?v=LY7IjS7SFNk',
 
79
  ),
80
  array(
81
- 'question'=>__('Remove read more text', 'post-grid'),
82
- 'answer_url'=>'https://www.youtube.com/watch?v=ZcS2vRcTe4A',
83
  ),
84
  array(
85
- 'question'=>__('Excerpt word count', 'post-grid'),
86
- 'answer_url'=>'https://www.youtube.com/watch?v=gZ6E3UiKQqk',
 
87
  ),
88
 
89
  array(
90
- 'question'=>__('Custom media height', 'post-grid'),
91
- 'answer_url'=>'https://www.youtube.com/watch?v=TupF2TpHHFA',
 
92
  ),
93
  array(
94
- 'question'=>__('Item custom padding margin', 'post-grid'),
95
- 'answer_url'=>'https://www.youtube.com/watch?v=HRZpoib1VvI',
 
96
  ),
97
  array(
98
- 'question'=>__('Grid item height', 'post-grid'),
99
- 'answer_url'=>'https://www.youtube.com/watch?v=ydqlgzfsboQ',
 
100
  ),
101
  array(
102
- 'question'=>__('Column Width or column number', 'post-grid'),
103
- 'answer_url'=>'https://www.youtube.com/watch?v=ZV8hd1ij5Wo',
 
104
  ),
105
  array(
106
- 'question'=>__('Post title linked', 'post-grid'),
107
- 'answer_url'=>'https://www.youtube.com/watch?v=oUVZB9F5d4U',
 
108
  ),
109
  array(
110
- 'question'=>__('Featured image linked to post', 'post-grid'),
111
- 'answer_url'=>'https://www.youtube.com/watch?v=stGOJLwUF-k',
 
112
  ),
113
  array(
114
- 'question'=>__('Query post by categories or terms', 'post-grid'),
115
- 'answer_url'=>'https://www.youtube.com/watch?v=xYzqtWRg8W4',
 
116
  ),
117
  array(
118
- 'question'=>__('Query post by tags or terms', 'post-grid'),
119
- 'answer_url'=>'https://www.youtube.com/watch?v=RKb-B_Q72Ak',
 
120
  ),
121
  array(
122
- 'question'=>__('Display search input', 'post-grid'),
123
- 'answer_url'=>'https://www.youtube.com/watch?v=psJR65Fmc_s',
 
124
  ),
125
  array(
126
- 'question'=>__('Work with layout editor', 'post-grid'),
127
- 'answer_url'=>'https://www.youtube.com/watch?v=9bQc7q40jMc',
 
128
  ),
129
  array(
130
- 'question'=>__('[ Pro ] Create filterable grid', 'post-grid'),
131
- 'answer_url'=>'https://www.youtube.com/watch?v=Zg2r7idmEm0',
 
132
  ),
133
  array(
134
- 'question'=>__('[ Pro ] Filterable custom filter type data logic', 'post-grid'),
135
- 'answer_url'=>'https://www.youtube.com/watch?v=5Dueav6Yoyc',
 
136
  ),
137
 
138
  array(
139
- 'question'=>__('[ Pro ] Filterable custom all text', 'post-grid'),
140
- 'answer_url'=>'https://www.youtube.com/watch?v=JvVkAyoXC3g',
 
141
  ),
142
  array(
143
- 'question'=>__('[ Pro ] Filterable default active filter', 'post-grid'),
144
- 'answer_url'=>'https://www.youtube.com/watch?v=h2rbyZNhMhU',
 
145
  ),
146
 
147
  array(
148
- 'question'=>__('[ Pro ] Filterable custom filter', 'post-grid'),
149
- 'answer_url'=>'https://www.youtube.com/watch?v=e8phxNKIRsU',
 
150
  ),
151
 
152
  array(
153
- 'question'=>__('[ Pro ] Filterable dropdown single filter', 'post-grid'),
154
- 'answer_url'=>'https://www.youtube.com/watch?v=ZHY8qf-z3H0',
 
155
  ),
156
 
157
  array(
158
- 'question'=>__('[ Pro ] Filterable display sort filter', 'post-grid'),
159
- 'answer_url'=>'https://www.youtube.com/watch?v=21TYNsp2OPI',
 
160
  ),
161
 
162
  array(
163
- 'question'=>__('[ Pro ] Filterable multi filter', 'post-grid'),
164
- 'answer_url'=>'https://www.youtube.com/watch?v=uRcfd_R9YCM',
 
165
  ),
166
 
167
 
168
 
169
  array(
170
- 'question'=>__('[ Pro ] Post grid on archive tags', 'post-grid'),
171
- 'answer_url'=>'https://youtu.be/lNyAjva_UXo',
 
172
  ),
173
 
174
 
175
 
176
 
177
  array(
178
- 'question'=>__('[ Pro ] Query post by meta field', 'post-grid'),
179
- 'answer_url'=>'https://www.youtube.com/watch?v=0AIDNJvZGR0',
 
180
  ),
181
 
182
 
183
  array(
184
- 'question'=>__('[ Pro ] Multi skin', 'post-grid'),
185
- 'answer_url'=>'https://www.youtube.com/watch?v=YzUs_P3cFCo',
 
186
  ),
187
  array(
188
- 'question'=>__('[ Pro ] Sticky post query', 'post-grid'),
189
- 'answer_url'=>'https://www.youtube.com/watch?v=nVIOUbVjML4',
 
190
  ),
191
  array(
192
- 'question'=>__('[ Pro ] Masonry layout', 'post-grid'),
193
- 'answer_url'=>'https://www.youtube.com/watch?v=qYjbv2euNpE',
 
194
  ),
195
  array(
196
- 'question'=>__('[ Pro ] Post query by author', 'post-grid'),
197
- 'answer_url'=>'https://www.youtube.com/watch?v=KtoGa8NB3ig',
 
198
  ),
199
  array(
200
- 'question'=>__('[ Pro ] Create glossary grid', 'post-grid'),
201
- 'answer_url'=>'https://www.youtube.com/watch?v=MKL4EZ-WYTs',
 
202
  ),
203
  array(
204
- 'question'=>__('[ Pro ] Post carousel slider', 'post-grid'),
205
- 'answer_url'=>'https://www.youtube.com/watch?v=A0bZ_luBtQQ',
 
206
  ),
207
 
208
  array(
209
- 'question'=>__('[ Pro ] Grid layout type', 'post-grid'),
210
- 'answer_url'=>'https://www.youtube.com/watch?v=58piQVkDZN4',
 
211
  ),
212
  array(
213
- 'question'=>__('[ Pro ] Thumbnail youtube', 'post-grid'),
214
- 'answer_url'=>'https://www.youtube.com/watch?v=Zm5vD15yvNM',
 
 
 
 
 
 
 
 
 
215
  ),
216
 
 
 
 
 
 
 
 
 
 
 
217
 
218
  );
219
 
@@ -227,30 +277,7 @@ class class_post_grid_support{
227
 
228
  public function faq(){
229
  $faq = array(
230
- array(
231
- 'question'=>__('How to Create a Post Grid?', 'post-grid'),
232
- 'answer_url'=>'https://www.pickplugins.com/documentation/post-grid/faq/how-to-create-a-post-grid/',
233
- ),
234
- array(
235
- 'question'=>__('How to upgrade to premium?', 'post-grid'),
236
- 'answer_url'=>'https://www.pickplugins.com/documentation/post-grid/upgrade-to-premium/',
237
- ),
238
-
239
- // array(
240
- // 'question'=>__('How to activate license?', 'post-grid'),
241
- // 'answer_url'=>'https://www.pickplugins.com/documentation/woocommerce-products-slider/faq/activate-license/',
242
- // ),
243
-
244
- array(
245
- 'question'=>__('Post grid on archive page?', 'post-grid'),
246
- 'answer_url'=>'https://www.pickplugins.com/documentation/post-grid/faq/post-grid-for-archive-page/',
247
- ),
248
-
249
 
250
- array(
251
- 'question'=>__('How to display HTML/Shortcode via layout editor ?', 'post-grid'),
252
- 'answer_url'=>'https://www.pickplugins.com/documentation/post-grid/faq/layout-editor-how-at-add-htmlshortcode/',
253
- ),
254
  );
255
 
256
 
65
 
66
  $tutorials = array(
67
  array(
68
+ 'title'=>__('Latest Version 2.0.46 Overview', 'post-grid'),
69
+ 'url'=>'https://youtu.be/YVtsIbEb9zs',
70
+ 'keywords'=>'overview latest version',
71
  ),
72
 
73
  array(
74
+ 'title'=>__('How to create post grid', 'post-grid'),
75
+ 'url'=>'https://www.youtube.com/watch?v=g5kxtJIopXs',
76
+ 'keywords'=>'',
77
  ),
78
  array(
79
+ 'title'=>__('Custom read more text', 'post-grid'),
80
+ 'url'=>'https://www.youtube.com/watch?v=LY7IjS7SFNk',
81
+ 'keywords'=>'',
82
  ),
83
  array(
84
+ 'title'=>__('Remove read more text', 'post-grid'),
85
+ 'url'=>'https://www.youtube.com/watch?v=ZcS2vRcTe4A',
86
  ),
87
  array(
88
+ 'title'=>__('Excerpt word count', 'post-grid'),
89
+ 'url'=>'https://www.youtube.com/watch?v=gZ6E3UiKQqk',
90
+ 'keywords'=>'',
91
  ),
92
 
93
  array(
94
+ 'title'=>__('Custom media height', 'post-grid'),
95
+ 'url'=>'https://www.youtube.com/watch?v=TupF2TpHHFA',
96
+ 'keywords'=>'',
97
  ),
98
  array(
99
+ 'title'=>__('Item custom padding margin', 'post-grid'),
100
+ 'url'=>'https://www.youtube.com/watch?v=HRZpoib1VvI',
101
+ 'keywords'=>'',
102
  ),
103
  array(
104
+ 'title'=>__('Grid item height', 'post-grid'),
105
+ 'url'=>'https://www.youtube.com/watch?v=ydqlgzfsboQ',
106
+ 'keywords'=>'',
107
  ),
108
  array(
109
+ 'title'=>__('Column Width or column number', 'post-grid'),
110
+ 'url'=>'https://www.youtube.com/watch?v=ZV8hd1ij5Wo',
111
+ 'keywords'=>'',
112
  ),
113
  array(
114
+ 'title'=>__('Post title linked', 'post-grid'),
115
+ 'url'=>'https://www.youtube.com/watch?v=oUVZB9F5d4U',
116
+ 'keywords'=>'',
117
  ),
118
  array(
119
+ 'title'=>__('Featured image linked to post', 'post-grid'),
120
+ 'url'=>'https://www.youtube.com/watch?v=stGOJLwUF-k',
121
+ 'keywords'=>'',
122
  ),
123
  array(
124
+ 'title'=>__('Query post by categories or terms', 'post-grid'),
125
+ 'url'=>'https://www.youtube.com/watch?v=xYzqtWRg8W4',
126
+ 'keywords'=>'',
127
  ),
128
  array(
129
+ 'title'=>__('Query post by tags or terms', 'post-grid'),
130
+ 'url'=>'https://www.youtube.com/watch?v=RKb-B_Q72Ak',
131
+ 'keywords'=>'',
132
  ),
133
  array(
134
+ 'title'=>__('Display search input', 'post-grid'),
135
+ 'url'=>'https://www.youtube.com/watch?v=psJR65Fmc_s',
136
+ 'keywords'=>'',
137
  ),
138
  array(
139
+ 'title'=>__('Work with layout editor', 'post-grid'),
140
+ 'url'=>'https://www.youtube.com/watch?v=9bQc7q40jMc',
141
+ 'keywords'=>'',
142
  ),
143
  array(
144
+ 'title'=>__('[ Pro ] Create filterable grid', 'post-grid'),
145
+ 'url'=>'https://www.youtube.com/watch?v=Zg2r7idmEm0',
146
+ 'keywords'=>'',
147
  ),
148
  array(
149
+ 'title'=>__('[ Pro ] Filterable custom filter type data logic', 'post-grid'),
150
+ 'url'=>'https://www.youtube.com/watch?v=5Dueav6Yoyc',
151
+ 'keywords'=>'',
152
  ),
153
 
154
  array(
155
+ 'title'=>__('[ Pro ] Filterable custom all text', 'post-grid'),
156
+ 'url'=>'https://www.youtube.com/watch?v=JvVkAyoXC3g',
157
+ 'keywords'=>'',
158
  ),
159
  array(
160
+ 'title'=>__('[ Pro ] Filterable default active filter', 'post-grid'),
161
+ 'url'=>'https://www.youtube.com/watch?v=h2rbyZNhMhU',
162
+ 'keywords'=>'',
163
  ),
164
 
165
  array(
166
+ 'title'=>__('[ Pro ] Filterable custom filter', 'post-grid'),
167
+ 'url'=>'https://www.youtube.com/watch?v=e8phxNKIRsU',
168
+ 'keywords'=>'',
169
  ),
170
 
171
  array(
172
+ 'title'=>__('[ Pro ] Filterable dropdown single filter', 'post-grid'),
173
+ 'url'=>'https://www.youtube.com/watch?v=ZHY8qf-z3H0',
174
+ 'keywords'=>'',
175
  ),
176
 
177
  array(
178
+ 'title'=>__('[ Pro ] Filterable display sort filter', 'post-grid'),
179
+ 'url'=>'https://www.youtube.com/watch?v=21TYNsp2OPI',
180
+ 'keywords'=>'',
181
  ),
182
 
183
  array(
184
+ 'title'=>__('[ Pro ] Filterable multi filter', 'post-grid'),
185
+ 'url'=>'https://www.youtube.com/watch?v=uRcfd_R9YCM',
186
+ 'keywords'=>'',
187
  ),
188
 
189
 
190
 
191
  array(
192
+ 'title'=>__('[ Pro ] Post grid on archive tags', 'post-grid'),
193
+ 'url'=>'https://youtu.be/lNyAjva_UXo',
194
+ 'keywords'=>'',
195
  ),
196
 
197
 
198
 
199
 
200
  array(
201
+ 'title'=>__('[ Pro ] Query post by meta field', 'post-grid'),
202
+ 'url'=>'https://www.youtube.com/watch?v=0AIDNJvZGR0',
203
+ 'keywords'=>'',
204
  ),
205
 
206
 
207
  array(
208
+ 'title'=>__('[ Pro ] Multi skin', 'post-grid'),
209
+ 'url'=>'https://www.youtube.com/watch?v=YzUs_P3cFCo',
210
+ 'keywords'=>'',
211
  ),
212
  array(
213
+ 'title'=>__('[ Pro ] Sticky post query', 'post-grid'),
214
+ 'url'=>'https://www.youtube.com/watch?v=nVIOUbVjML4',
215
+ 'keywords'=>'',
216
  ),
217
  array(
218
+ 'title'=>__('[ Pro ] Masonry layout', 'post-grid'),
219
+ 'url'=>'https://www.youtube.com/watch?v=qYjbv2euNpE',
220
+ 'keywords'=>'',
221
  ),
222
  array(
223
+ 'title'=>__('[ Pro ] Post query by author', 'post-grid'),
224
+ 'url'=>'https://www.youtube.com/watch?v=KtoGa8NB3ig',
225
+ 'keywords'=>'',
226
  ),
227
  array(
228
+ 'title'=>__('[ Pro ] Create glossary grid', 'post-grid'),
229
+ 'url'=>'https://www.youtube.com/watch?v=MKL4EZ-WYTs',
230
+ 'keywords'=>'',
231
  ),
232
  array(
233
+ 'title'=>__('[ Pro ] Post carousel slider', 'post-grid'),
234
+ 'url'=>'https://www.youtube.com/watch?v=A0bZ_luBtQQ',
235
+ 'keywords'=>'',
236
  ),
237
 
238
  array(
239
+ 'title'=>__('[ Pro ] Grid layout type', 'post-grid'),
240
+ 'url'=>'https://www.youtube.com/watch?v=58piQVkDZN4',
241
+ 'keywords'=>'',
242
  ),
243
  array(
244
+ 'title'=>__('[ Pro ] Thumbnail youtube', 'post-grid'),
245
+ 'url'=>'https://www.youtube.com/watch?v=Zm5vD15yvNM',
246
+ 'keywords'=>'',
247
+ ),
248
+ array(
249
+ 'title'=>__('How to Create a Post Grid?', 'post-grid'),
250
+ 'url'=>'https://www.pickplugins.com/documentation/post-grid/faq/how-to-create-a-post-grid/',
251
+ ),
252
+ array(
253
+ 'title'=>__('How to upgrade to premium?', 'post-grid'),
254
+ 'url'=>'https://www.pickplugins.com/documentation/post-grid/upgrade-to-premium/',
255
  ),
256
 
257
+ array(
258
+ 'title'=>__('Post grid on archive page?', 'post-grid'),
259
+ 'url'=>'https://www.pickplugins.com/documentation/post-grid/faq/post-grid-for-archive-page/',
260
+ ),
261
+
262
+
263
+ array(
264
+ 'title'=>__('How to display HTML/Shortcode via layout editor ?', 'post-grid'),
265
+ 'url'=>'https://www.pickplugins.com/documentation/post-grid/faq/layout-editor-how-at-add-htmlshortcode/',
266
+ ),
267
 
268
  );
269
 
277
 
278
  public function faq(){
279
  $faq = array(
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
280
 
 
 
 
 
281
  );
282
 
283
 
includes/functions-layout-hook.php CHANGED
@@ -2,8 +2,6 @@
2
  if ( ! defined('ABSPATH')) exit; // if direct access
3
 
4
  add_action('post_grid_layout_element_option_custom_text','post_grid_layout_element_option_custom_text');
5
-
6
-
7
  function post_grid_layout_element_option_custom_text($parameters){
8
 
9
  $settings_tabs_field = new settings_tabs_field();
2
  if ( ! defined('ABSPATH')) exit; // if direct access
3
 
4
  add_action('post_grid_layout_element_option_custom_text','post_grid_layout_element_option_custom_text');
 
 
5
  function post_grid_layout_element_option_custom_text($parameters){
6
 
7
  $settings_tabs_field = new settings_tabs_field();
includes/functions-single.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  if ( ! defined('ABSPATH')) exit; // if direct access
3
 
4
- //add_action('the_content','post_grid_single_post');
5
 
6
  function post_grid_single_post($content){
7
 
1
  <?php
2
  if ( ! defined('ABSPATH')) exit; // if direct access
3
 
4
+ add_action('the_content','post_grid_single_post');
5
 
6
  function post_grid_single_post($content){
7
 
includes/functions/post-grid-layout-elements.php CHANGED
@@ -416,23 +416,28 @@ function post_grid_layout_element_excerpt($args){
416
  if(empty($post_id)) return;
417
 
418
  $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
419
- //$the_post = get_post($post_id);
 
 
 
 
 
 
420
 
421
- //$post_excerpt = $the_post->post_excerpt;
422
- $post_excerpt = get_the_excerpt($post_id);
423
 
424
 
425
  $post_link = get_permalink($post_id);
426
 
427
  $link_target = isset($element['link_target']) ? $element['link_target'] : '';
428
-
429
  $custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
430
- $char_limit = isset($element['char_limit']) ? (int) $element['char_limit'] : 0;
431
- $read_more_text = isset($element['read_more_text']) ? $element['read_more_text'] : __('Read more', 'post-grid');
432
 
433
 
434
  if($char_limit > 0){
435
- $post_excerpt = wp_trim_words($post_excerpt, $char_limit, '');
436
  }
437
 
438
 
@@ -534,7 +539,7 @@ function post_grid_layout_element_excerpt_read_more($args){
534
 
535
  $custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
536
  $char_limit = isset($element['char_limit']) ? (int) $element['char_limit'] : 0;
537
- $read_more_text = isset($element['read_more_text']) ? $element['read_more_text'] : __('Read more','post-grid');
538
  $link_target = isset($element['link_target']) ? $element['link_target'] : '';
539
 
540
 
@@ -791,16 +796,18 @@ function post_grid_layout_element_css_media($args){
791
  $css = isset($element['css']) ? $element['css'] : '';
792
  $css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
793
 
 
 
794
  ?>
795
  <style type="text/css">
796
  .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
797
- overflow: hidden;
798
  <?php if(!empty($margin)): ?>
799
  margin: <?php echo $margin; ?>;
800
  <?php endif; ?>
801
  <?php if(!empty($padding)): ?>
802
  padding: <?php echo $padding; ?>;
803
  <?php endif; ?>
 
804
  <?php if(!empty($css)): ?>
805
  <?php echo $css; ?>
806
  <?php endif; ?>
@@ -1086,7 +1093,7 @@ function post_grid_layout_element_post_date($args){
1086
  $link_to = isset($element['link_to']) ? $element['link_to'] : 'post_link';
1087
  $link_target = isset($element['link_target']) ? $element['link_target'] : '';
1088
  $date_format = isset($element['date_format']) ? $element['date_format'] : 'd-m-Y';
1089
- $wrapper_html = isset($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
1090
 
1091
 
1092
  $post_link = get_permalink($post_id);
416
  if(empty($post_id)) return;
417
 
418
  $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
419
+ $the_post = get_post($post_id);
420
+
421
+
422
+ $post_content = isset($the_post->post_content) ? $the_post->post_content : '';
423
+
424
+ $post_content = strip_shortcodes( $post_content );
425
+ $post_content = excerpt_remove_blocks( $post_content );
426
 
427
+
428
+ //$post_excerpt = get_the_excerpt($post_id);
429
 
430
 
431
  $post_link = get_permalink($post_id);
432
 
433
  $link_target = isset($element['link_target']) ? $element['link_target'] : '';
 
434
  $custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
435
+ $char_limit = !empty($element['char_limit']) ? (int) $element['char_limit'] : 50;
436
+ $read_more_text = isset($element['read_more_text']) ? $element['read_more_text'] : '';
437
 
438
 
439
  if($char_limit > 0){
440
+ $post_excerpt = wp_trim_words($post_content, $char_limit, '');
441
  }
442
 
443
 
539
 
540
  $custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
541
  $char_limit = isset($element['char_limit']) ? (int) $element['char_limit'] : 0;
542
+ $read_more_text = isset($element['read_more_text']) ? $element['read_more_text'] : '';
543
  $link_target = isset($element['link_target']) ? $element['link_target'] : '';
544
 
545
 
796
  $css = isset($element['css']) ? $element['css'] : '';
797
  $css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
798
 
799
+ //var_dump($css);
800
+
801
  ?>
802
  <style type="text/css">
803
  .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
 
804
  <?php if(!empty($margin)): ?>
805
  margin: <?php echo $margin; ?>;
806
  <?php endif; ?>
807
  <?php if(!empty($padding)): ?>
808
  padding: <?php echo $padding; ?>;
809
  <?php endif; ?>
810
+ overflow: hidden;
811
  <?php if(!empty($css)): ?>
812
  <?php echo $css; ?>
813
  <?php endif; ?>
1093
  $link_to = isset($element['link_to']) ? $element['link_to'] : 'post_link';
1094
  $link_target = isset($element['link_target']) ? $element['link_target'] : '';
1095
  $date_format = isset($element['date_format']) ? $element['date_format'] : 'd-m-Y';
1096
+ $wrapper_html = !empty($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
1097
 
1098
 
1099
  $post_link = get_permalink($post_id);
includes/layout-elements/3rd-party.php ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined('ABSPATH')) exit; // if direct access
3
+
4
+ include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
5
+
6
+
7
+ if ( is_plugin_active( 'yet-another-stars-rating/yet-another-stars-rating.php' ) ) {
8
+
9
+ require_once( post_grid_plugin_dir . 'includes/layout-elements/yet-another-stars-rating/layout-elements.php');
10
+ }
11
+
12
+ if ( is_plugin_active( 'rating-widget/rating-widget.php' ) ) {
13
+
14
+ require_once( post_grid_plugin_dir . 'includes/layout-elements/rating-widget/layout-elements.php');
15
+ }
16
+
17
+
18
+ if ( is_plugin_active( 'yith-woocommerce-wishlist/init.php' ) ) {
19
+
20
+ require_once( post_grid_plugin_dir . 'includes/layout-elements/yith-woocommerce-wishlist/layout-elements.php');
21
+ }
22
+
23
+
24
+
25
+ if ( is_plugin_active( 'kk-star-ratings/index.php' ) ) {
26
+
27
+ require_once( post_grid_plugin_dir . 'includes/layout-elements/kk-star-ratings/layout-elements.php');
28
+ }
29
+
30
+
31
+
32
+
33
+
34
+ if ( is_plugin_active( 'wp-postratings/wp-postratings.php' ) ) {
35
+
36
+ require_once( post_grid_plugin_dir . 'includes/layout-elements/wp-postratings/layout-elements.php');
37
+ }
38
+
39
+ if ( is_plugin_active( 'multi-rating/multi-rating.php' ) ) {
40
+
41
+ require_once( post_grid_plugin_dir . 'includes/layout-elements/multi-rating/layout-elements.php');
42
+ }
43
+
44
+
45
+
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+
55
+
56
+
57
+
58
+
59
+
60
+
61
+
62
+
63
+
64
+
65
+
66
+
67
+
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+
includes/layout-elements/kk-star-ratings/layout-elements.php ADDED
@@ -0,0 +1,249 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined('ABSPATH')) exit; // if direct access
3
+
4
+
5
+ add_filter('post_grid_layout_elements','post_grid_pro_kk_star_ratings_layout_elements');
6
+
7
+ function post_grid_pro_kk_star_ratings_layout_elements($elements_group){
8
+
9
+ $elements_group['star_rating']['items']['kk_star_ratings'] = array('name' =>__('kk Star Ratings','post-grid'));
10
+
11
+ return $elements_group;
12
+ }
13
+
14
+
15
+ add_action('post_grid_layout_element_option_kk_star_ratings','post_grid_layout_element_option_kk_star_ratings');
16
+ function post_grid_layout_element_option_kk_star_ratings($parameters){
17
+
18
+ $settings_tabs_field = new settings_tabs_field();
19
+
20
+ $input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
21
+ $element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
22
+ $element_index = isset($parameters['index']) ? $parameters['index'] : '';
23
+
24
+ $size = isset($element_data['size']) ? $element_data['size'] : '';
25
+
26
+ $color = isset($element_data['color']) ? $element_data['color'] : '';
27
+ $font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
28
+ $margin = isset($element_data['margin']) ? $element_data['margin'] : '';
29
+ $text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
30
+
31
+ $css = isset($element_data['css']) ? $element_data['css'] : '';
32
+ $css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
33
+
34
+
35
+
36
+ ?>
37
+ <div class="item">
38
+ <div class="element-title header ">
39
+ <span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
40
+ <span class="sort"><i class="fas fa-sort"></i></span>
41
+
42
+ <span class="expand"><?php echo __('kk Star Ratings','post-grid'); ?></span>
43
+ </div>
44
+ <div class="element-options options">
45
+
46
+ <?php
47
+
48
+ $args = array(
49
+ 'id' => 'size',
50
+ 'css_id' => $element_index.'_kk_star_ratings',
51
+ 'parent' => $input_name.'[kk_star_ratings]',
52
+ 'title' => __('size','post-grid'),
53
+ 'details' => __('Icon size, number only, ex: 20','post-grid'),
54
+ 'type' => 'text',
55
+ 'value' => $size,
56
+ 'default' => '20',
57
+ 'placeholder' => '20',
58
+ );
59
+
60
+ $settings_tabs_field->generate_field($args);
61
+
62
+ $args = array(
63
+ 'id' => 'color',
64
+ 'css_id' => $element_index.'_kk_star_ratings',
65
+ 'parent' => $input_name.'[kk_star_ratings]',
66
+ 'title' => __('Color','post-grid'),
67
+ 'details' => __('Title text color.','post-grid'),
68
+ 'type' => 'colorpicker',
69
+ 'value' => $color,
70
+ 'default' => '',
71
+ );
72
+
73
+ $settings_tabs_field->generate_field($args);
74
+
75
+ $args = array(
76
+ 'id' => 'font_size',
77
+ 'css_id' => $element_index.'_font_size',
78
+ 'parent' => $input_name.'[kk_star_ratings]',
79
+ 'title' => __('Font size','post-grid'),
80
+ 'details' => __('Set font size.','post-grid'),
81
+ 'type' => 'text',
82
+ 'value' => $font_size,
83
+ 'default' => '',
84
+ 'placeholder' => '14px',
85
+ );
86
+
87
+ $settings_tabs_field->generate_field($args);
88
+
89
+
90
+
91
+ $args = array(
92
+ 'id' => 'margin',
93
+ 'css_id' => $element_index.'_margin',
94
+ 'parent' => $input_name.'[kk_star_ratings]',
95
+ 'title' => __('Margin','post-grid'),
96
+ 'details' => __('Set margin.','post-grid'),
97
+ 'type' => 'text',
98
+ 'value' => $margin,
99
+ 'default' => '',
100
+ 'placeholder' => '5px 0',
101
+ );
102
+
103
+ $settings_tabs_field->generate_field($args);
104
+
105
+
106
+ $args = array(
107
+ 'id' => 'text_align',
108
+ 'css_id' => $element_index.'_text_align',
109
+ 'parent' => $input_name.'[kk_star_ratings]',
110
+ 'title' => __('Text align','post-grid'),
111
+ 'details' => __('Choose text align.','post-grid'),
112
+ 'type' => 'select',
113
+ 'value' => $text_align,
114
+ 'default' => 'left',
115
+ 'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
116
+ );
117
+
118
+ $settings_tabs_field->generate_field($args);
119
+
120
+
121
+ $args = array(
122
+ 'id' => 'css',
123
+ 'css_id' => $element_index.'_css',
124
+ 'parent' => $input_name.'[kk_star_ratings]',
125
+ 'title' => __('Custom CSS','post-grid'),
126
+ 'details' => __('Set csutom CSS.','post-grid'),
127
+ 'type' => 'textarea',
128
+ 'value' => $css,
129
+ 'default' => '',
130
+ 'placeholder' => '',
131
+ );
132
+
133
+ $settings_tabs_field->generate_field($args);
134
+
135
+ $args = array(
136
+ 'id' => 'css_hover',
137
+ 'css_id' => $element_index.'_css_hover',
138
+ 'parent' => $input_name.'[kk_star_ratings]',
139
+ 'title' => __('Hover CSS','post-grid'),
140
+ 'details' => __('Set hover custom CSS.','post-grid'),
141
+ 'type' => 'textarea',
142
+ 'value' => $css_hover,
143
+ 'default' => '',
144
+ 'placeholder' => '',
145
+ );
146
+
147
+ $settings_tabs_field->generate_field($args);
148
+
149
+
150
+ ob_start();
151
+ ?>
152
+ <textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}</textarea>
153
+ <?php
154
+
155
+ $html = ob_get_clean();
156
+
157
+ $args = array(
158
+ 'id' => 'use_css',
159
+ 'title' => __('Use of CSS','post-grid'),
160
+ 'details' => __('Use following class selector to add custom CSS for this element.','post-grid'),
161
+ 'type' => 'custom_html',
162
+ 'html' => $html,
163
+
164
+ );
165
+
166
+ $settings_tabs_field->generate_field($args);
167
+
168
+ ?>
169
+
170
+ </div>
171
+ </div>
172
+ <?php
173
+
174
+ }
175
+
176
+
177
+
178
+ add_action('post_grid_layout_element_kk_star_ratings', 'post_grid_layout_element_kk_star_ratings');
179
+ function post_grid_layout_element_kk_star_ratings($args){
180
+
181
+ $element = isset($args['element']) ? $args['element'] : array();
182
+ $elementIndex = isset($args['index']) ? $args['index'] : '';
183
+ $post_id = isset($args['post_id']) ? $args['post_id'] : '';
184
+
185
+ if(empty($post_id)) return;
186
+
187
+ $title = get_the_title($post_id);
188
+
189
+ $custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
190
+ $size = isset($element['size']) ? $element['size'] : '20';
191
+
192
+
193
+ // if(!empty($acf_value)):
194
+
195
+ ?>
196
+ <div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> kk_star_ratings ">
197
+ <?php echo do_shortcode("[kkratings size=$size id=$post_id]"); ?>
198
+ </div>
199
+ <?php
200
+ // endif;
201
+
202
+ }
203
+
204
+
205
+
206
+ add_action('post_grid_layout_element_css_kk_star_ratings', 'post_grid_layout_element_css_kk_star_ratings', 10);
207
+ function post_grid_layout_element_css_kk_star_ratings($args){
208
+
209
+
210
+ $index = isset($args['index']) ? $args['index'] : '';
211
+ $element = isset($args['element']) ? $args['element'] : array();
212
+ $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
213
+
214
+ $color = isset($element['color']) ? $element['color'] : '';
215
+ $font_size = isset($element['font_size']) ? $element['font_size'] : '';
216
+ $margin = isset($element['margin']) ? $element['margin'] : '';
217
+ $text_align = isset($element['text_align']) ? $element['text_align'] : 'left';
218
+
219
+ $css = isset($element['css']) ? $element['css'] : '';
220
+ $css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
221
+
222
+ ?>
223
+ <style type="text/css">
224
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
225
+ <?php if(!empty($color)): ?>
226
+ color: <?php echo $color; ?>;
227
+ <?php endif; ?>
228
+ <?php if(!empty($font_size)): ?>
229
+ font-size: <?php echo $font_size; ?>;
230
+ <?php endif; ?>
231
+
232
+ <?php if(!empty($margin)): ?>
233
+ margin: <?php echo $margin; ?>;
234
+ <?php endif; ?>
235
+ <?php if(!empty($text_align)): ?>
236
+ text-align: <?php echo $text_align; ?>;
237
+ <?php endif; ?>
238
+ <?php if(!empty($css)): ?>
239
+ <?php echo $css; ?>
240
+ <?php endif; ?>
241
+ }
242
+ <?php if(!empty($css_hover)): ?>
243
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
244
+ <?php echo $css_hover; ?>
245
+ }
246
+ <?php endif; ?>
247
+ </style>
248
+ <?php
249
+ }
includes/layout-elements/multi-rating/layout-elements.php ADDED
@@ -0,0 +1,277 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined('ABSPATH')) exit; // if direct access
3
+
4
+
5
+ add_filter('post_grid_layout_elements','post_grid_pro_multi_rating_layout_elements');
6
+
7
+ function post_grid_pro_multi_rating_layout_elements($elements_group){
8
+
9
+ $elements_group['star_rating']['items']['multi_rating'] = array('name' =>__('Multi Rating','post-grid'));
10
+
11
+ return $elements_group;
12
+ }
13
+
14
+
15
+ add_action('post_grid_layout_element_option_multi_rating','post_grid_layout_element_option_multi_rating');
16
+ function post_grid_layout_element_option_multi_rating($parameters){
17
+
18
+ $settings_tabs_field = new settings_tabs_field();
19
+
20
+ $input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
21
+ $element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
22
+ $element_index = isset($parameters['index']) ? $parameters['index'] : '';
23
+
24
+ $display_item = isset($element_data['display_item']) ? $element_data['display_item'] : '';
25
+ $no_rating_results_text = isset($element_data['no_rating_results_text']) ? $element_data['no_rating_results_text'] : '';
26
+
27
+ $color = isset($element_data['color']) ? $element_data['color'] : '';
28
+ $font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
29
+ $margin = isset($element_data['margin']) ? $element_data['margin'] : '';
30
+ $text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
31
+
32
+ $css = isset($element_data['css']) ? $element_data['css'] : '';
33
+ $css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
34
+
35
+
36
+
37
+ ?>
38
+ <div class="item">
39
+ <div class="element-title header ">
40
+ <span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
41
+ <span class="sort"><i class="fas fa-sort"></i></span>
42
+
43
+ <span class="expand"><?php echo __('Multi Rating','post-grid'); ?></span>
44
+ </div>
45
+ <div class="element-options options">
46
+
47
+ <?php
48
+
49
+ $args = array(
50
+ 'id' => 'display_item',
51
+ 'css_id' => $element_index.'_text_align',
52
+ 'parent' => $input_name.'[multi_rating]',
53
+ 'title' => __('Display item','post-grid'),
54
+ 'details' => __('Choose display items.','post-grid'),
55
+ 'type' => 'select',
56
+ 'value' => $display_item,
57
+ 'default' => 'result',
58
+ 'args' => array('result'=> __('Result', 'post-grid'),'rating_button'=> __('Rating button', 'post-grid'),'both'=> __('Both', 'post-grid') ),
59
+ );
60
+
61
+ $settings_tabs_field->generate_field($args);
62
+
63
+ $args = array(
64
+ 'id' => 'no_rating_results_text',
65
+ 'css_id' => $element_index.'_multi_rating',
66
+ 'parent' => $input_name.'[multi_rating]',
67
+ 'title' => __('No rating text','post-grid'),
68
+ 'details' => __('Custom text.','post-grid'),
69
+ 'type' => 'text',
70
+ 'value' => $no_rating_results_text,
71
+ 'default' => '',
72
+ );
73
+
74
+ $settings_tabs_field->generate_field($args);
75
+
76
+ $args = array(
77
+ 'id' => 'color',
78
+ 'css_id' => $element_index.'_multi_rating',
79
+ 'parent' => $input_name.'[multi_rating]',
80
+ 'title' => __('Color','post-grid'),
81
+ 'details' => __('Title text color.','post-grid'),
82
+ 'type' => 'colorpicker',
83
+ 'value' => $color,
84
+ 'default' => '',
85
+ );
86
+
87
+ $settings_tabs_field->generate_field($args);
88
+
89
+ $args = array(
90
+ 'id' => 'font_size',
91
+ 'css_id' => $element_index.'_font_size',
92
+ 'parent' => $input_name.'[multi_rating]',
93
+ 'title' => __('Font size','post-grid'),
94
+ 'details' => __('Set font size.','post-grid'),
95
+ 'type' => 'text',
96
+ 'value' => $font_size,
97
+ 'default' => '',
98
+ 'placeholder' => '14px',
99
+ );
100
+
101
+ $settings_tabs_field->generate_field($args);
102
+
103
+
104
+
105
+ $args = array(
106
+ 'id' => 'margin',
107
+ 'css_id' => $element_index.'_margin',
108
+ 'parent' => $input_name.'[multi_rating]',
109
+ 'title' => __('Margin','post-grid'),
110
+ 'details' => __('Set margin.','post-grid'),
111
+ 'type' => 'text',
112
+ 'value' => $margin,
113
+ 'default' => '',
114
+ 'placeholder' => '5px 0',
115
+ );
116
+
117
+ $settings_tabs_field->generate_field($args);
118
+
119
+
120
+ $args = array(
121
+ 'id' => 'text_align',
122
+ 'css_id' => $element_index.'_text_align',
123
+ 'parent' => $input_name.'[multi_rating]',
124
+ 'title' => __('Text align','post-grid'),
125
+ 'details' => __('Choose text align.','post-grid'),
126
+ 'type' => 'select',
127
+ 'value' => $text_align,
128
+ 'default' => 'left',
129
+ 'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
130
+ );
131
+
132
+ $settings_tabs_field->generate_field($args);
133
+
134
+
135
+ $args = array(
136
+ 'id' => 'css',
137
+ 'css_id' => $element_index.'_css',
138
+ 'parent' => $input_name.'[multi_rating]',
139
+ 'title' => __('Custom CSS','post-grid'),
140
+ 'details' => __('Set csutom CSS.','post-grid'),
141
+ 'type' => 'textarea',
142
+ 'value' => $css,
143
+ 'default' => '',
144
+ 'placeholder' => '',
145
+ );
146
+
147
+ $settings_tabs_field->generate_field($args);
148
+
149
+ $args = array(
150
+ 'id' => 'css_hover',
151
+ 'css_id' => $element_index.'_css_hover',
152
+ 'parent' => $input_name.'[multi_rating]',
153
+ 'title' => __('Hover CSS','post-grid'),
154
+ 'details' => __('Set hover custom CSS.','post-grid'),
155
+ 'type' => 'textarea',
156
+ 'value' => $css_hover,
157
+ 'default' => '',
158
+ 'placeholder' => '',
159
+ );
160
+
161
+ $settings_tabs_field->generate_field($args);
162
+
163
+
164
+ ob_start();
165
+ ?>
166
+ <textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}</textarea>
167
+ <?php
168
+
169
+ $html = ob_get_clean();
170
+
171
+ $args = array(
172
+ 'id' => 'use_css',
173
+ 'title' => __('Use of CSS','post-grid'),
174
+ 'details' => __('Use following class selector to add custom CSS for this element.','post-grid'),
175
+ 'type' => 'custom_html',
176
+ 'html' => $html,
177
+
178
+ );
179
+
180
+ $settings_tabs_field->generate_field($args);
181
+
182
+ ?>
183
+
184
+ </div>
185
+ </div>
186
+ <?php
187
+
188
+ }
189
+
190
+
191
+
192
+ add_action('post_grid_layout_element_multi_rating', 'post_grid_layout_element_multi_rating');
193
+ function post_grid_layout_element_multi_rating($args){
194
+
195
+ $element = isset($args['element']) ? $args['element'] : array();
196
+ $elementIndex = isset($args['index']) ? $args['index'] : '';
197
+ $post_id = isset($args['post_id']) ? $args['post_id'] : '';
198
+
199
+ if(empty($post_id)) return;
200
+
201
+ $title = get_the_title($post_id);
202
+
203
+ $custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
204
+ $display_item = isset($element['display_item']) ? $element['display_item'] : 'result';
205
+ $no_rating_results_text = isset($element['no_rating_results_text']) ? $element['no_rating_results_text'] : '';
206
+
207
+
208
+ // if(!empty($acf_value)):
209
+
210
+ ?>
211
+ <div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> multi_rating ">
212
+ <?php
213
+ if($display_item =='result'){
214
+ echo do_shortcode("[mr_rating_result post_id='".$post_id."' no_rating_results_text='".$no_rating_results_text."']");
215
+
216
+ }elseif ($display_item =='rating_button'){
217
+ echo do_shortcode("[mr_rating_form post_id=$post_id]");
218
+
219
+ }elseif ($display_item =='both'){
220
+ echo do_shortcode("[mr_rating_result post_id='".$post_id."' no_rating_results_text='".$no_rating_results_text."']");
221
+ echo do_shortcode("[mr_rating_form post_id=$post_id]");
222
+ }
223
+
224
+ ?>
225
+
226
+ </div>
227
+ <?php
228
+ // endif;
229
+
230
+ }
231
+
232
+
233
+
234
+ add_action('post_grid_layout_element_css_multi_rating', 'post_grid_layout_element_css_multi_rating', 10);
235
+ function post_grid_layout_element_css_multi_rating($args){
236
+
237
+
238
+ $index = isset($args['index']) ? $args['index'] : '';
239
+ $element = isset($args['element']) ? $args['element'] : array();
240
+ $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
241
+
242
+ $color = isset($element['color']) ? $element['color'] : '';
243
+ $font_size = isset($element['font_size']) ? $element['font_size'] : '';
244
+ $margin = isset($element['margin']) ? $element['margin'] : '';
245
+ $text_align = isset($element['text_align']) ? $element['text_align'] : 'left';
246
+
247
+ $css = isset($element['css']) ? $element['css'] : '';
248
+ $css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
249
+
250
+ ?>
251
+ <style type="text/css">
252
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
253
+ <?php if(!empty($color)): ?>
254
+ color: <?php echo $color; ?>;
255
+ <?php endif; ?>
256
+ <?php if(!empty($font_size)): ?>
257
+ font-size: <?php echo $font_size; ?>;
258
+ <?php endif; ?>
259
+
260
+ <?php if(!empty($margin)): ?>
261
+ margin: <?php echo $margin; ?>;
262
+ <?php endif; ?>
263
+ <?php if(!empty($text_align)): ?>
264
+ text-align: <?php echo $text_align; ?>;
265
+ <?php endif; ?>
266
+ <?php if(!empty($css)): ?>
267
+ <?php echo $css; ?>
268
+ <?php endif; ?>
269
+ }
270
+ <?php if(!empty($css_hover)): ?>
271
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
272
+ <?php echo $css_hover; ?>
273
+ }
274
+ <?php endif; ?>
275
+ </style>
276
+ <?php
277
+ }
includes/layout-elements/rate-my-post/layout-elements.php ADDED
@@ -0,0 +1,264 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined('ABSPATH')) exit; // if direct access
3
+
4
+
5
+ add_filter('post_grid_layout_elements','post_grid_pro_rate_my_post_layout_elements');
6
+
7
+ function post_grid_pro_rate_my_post_layout_elements($elements_group){
8
+
9
+ $elements_group['star_rating']['items']['rate_my_post'] = array('name' =>__('Rate my Post','post-grid'));
10
+
11
+ return $elements_group;
12
+ }
13
+
14
+
15
+ add_action('post_grid_layout_element_option_rate_my_post','post_grid_layout_element_option_rate_my_post');
16
+ function post_grid_layout_element_option_rate_my_post($parameters){
17
+
18
+ $settings_tabs_field = new settings_tabs_field();
19
+
20
+ $input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
21
+ $element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
22
+ $element_index = isset($parameters['index']) ? $parameters['index'] : '';
23
+
24
+ $display_item = isset($element_data['display_item']) ? $element_data['display_item'] : '';
25
+
26
+ $color = isset($element_data['color']) ? $element_data['color'] : '';
27
+ $font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
28
+ $margin = isset($element_data['margin']) ? $element_data['margin'] : '';
29
+ $text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
30
+
31
+ $css = isset($element_data['css']) ? $element_data['css'] : '';
32
+ $css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
33
+
34
+
35
+
36
+ ?>
37
+ <div class="item">
38
+ <div class="element-title header ">
39
+ <span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
40
+ <span class="sort"><i class="fas fa-sort"></i></span>
41
+
42
+ <span class="expand"><?php echo __('Rate my Post','post-grid'); ?></span>
43
+ </div>
44
+ <div class="element-options options">
45
+
46
+ <?php
47
+
48
+ $args = array(
49
+ 'id' => 'display_item',
50
+ 'css_id' => $element_index.'_text_align',
51
+ 'parent' => $input_name.'[rate_my_post]',
52
+ 'title' => __('Display','post-grid'),
53
+ 'details' => __('Choose display.','post-grid'),
54
+ 'type' => 'select',
55
+ 'value' => $display_item,
56
+ 'default' => 'result',
57
+ 'args' => array('result'=> __('Result', 'post-grid'), 'rating_widget'=> __('Rating widget', 'post-grid'), 'both'=> __('Both', 'post-grid') ),
58
+ );
59
+
60
+ $settings_tabs_field->generate_field($args);
61
+
62
+
63
+
64
+ $args = array(
65
+ 'id' => 'color',
66
+ 'css_id' => $element_index.'_rate_my_post',
67
+ 'parent' => $input_name.'[rate_my_post]',
68
+ 'title' => __('Color','post-grid'),
69
+ 'details' => __('Title text color.','post-grid'),
70
+ 'type' => 'colorpicker',
71
+ 'value' => $color,
72
+ 'default' => '',
73
+ );
74
+
75
+ $settings_tabs_field->generate_field($args);
76
+
77
+ $args = array(
78
+ 'id' => 'font_size',
79
+ 'css_id' => $element_index.'_font_size',
80
+ 'parent' => $input_name.'[rate_my_post]',
81
+ 'title' => __('Font size','post-grid'),
82
+ 'details' => __('Set font size.','post-grid'),
83
+ 'type' => 'text',
84
+ 'value' => $font_size,
85
+ 'default' => '',
86
+ 'placeholder' => '14px',
87
+ );
88
+
89
+ $settings_tabs_field->generate_field($args);
90
+
91
+
92
+
93
+ $args = array(
94
+ 'id' => 'margin',
95
+ 'css_id' => $element_index.'_margin',
96
+ 'parent' => $input_name.'[rate_my_post]',
97
+ 'title' => __('Margin','post-grid'),
98
+ 'details' => __('Set margin.','post-grid'),
99
+ 'type' => 'text',
100
+ 'value' => $margin,
101
+ 'default' => '',
102
+ 'placeholder' => '5px 0',
103
+ );
104
+
105
+ $settings_tabs_field->generate_field($args);
106
+
107
+
108
+ $args = array(
109
+ 'id' => 'text_align',
110
+ 'css_id' => $element_index.'_text_align',
111
+ 'parent' => $input_name.'[rate_my_post]',
112
+ 'title' => __('Text align','post-grid'),
113
+ 'details' => __('Choose text align.','post-grid'),
114
+ 'type' => 'select',
115
+ 'value' => $text_align,
116
+ 'default' => 'left',
117
+ 'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
118
+ );
119
+
120
+ $settings_tabs_field->generate_field($args);
121
+
122
+
123
+ $args = array(
124
+ 'id' => 'css',
125
+ 'css_id' => $element_index.'_css',
126
+ 'parent' => $input_name.'[rate_my_post]',
127
+ 'title' => __('Custom CSS','post-grid'),
128
+ 'details' => __('Set csutom CSS.','post-grid'),
129
+ 'type' => 'textarea',
130
+ 'value' => $css,
131
+ 'default' => '',
132
+ 'placeholder' => '',
133
+ );
134
+
135
+ $settings_tabs_field->generate_field($args);
136
+
137
+ $args = array(
138
+ 'id' => 'css_hover',
139
+ 'css_id' => $element_index.'_css_hover',
140
+ 'parent' => $input_name.'[rate_my_post]',
141
+ 'title' => __('Hover CSS','post-grid'),
142
+ 'details' => __('Set hover custom CSS.','post-grid'),
143
+ 'type' => 'textarea',
144
+ 'value' => $css_hover,
145
+ 'default' => '',
146
+ 'placeholder' => '',
147
+ );
148
+
149
+ $settings_tabs_field->generate_field($args);
150
+
151
+
152
+ ob_start();
153
+ ?>
154
+ <textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}</textarea>
155
+ <?php
156
+
157
+ $html = ob_get_clean();
158
+
159
+ $args = array(
160
+ 'id' => 'use_css',
161
+ 'title' => __('Use of CSS','post-grid'),
162
+ 'details' => __('Use following class selector to add custom CSS for this element.','post-grid'),
163
+ 'type' => 'custom_html',
164
+ 'html' => $html,
165
+
166
+ );
167
+
168
+ $settings_tabs_field->generate_field($args);
169
+
170
+ ?>
171
+
172
+ </div>
173
+ </div>
174
+ <?php
175
+
176
+ }
177
+
178
+
179
+
180
+ add_action('post_grid_layout_element_rate_my_post', 'post_grid_layout_element_rate_my_post');
181
+ function post_grid_layout_element_rate_my_post($args){
182
+
183
+ $element = isset($args['element']) ? $args['element'] : array();
184
+ $elementIndex = isset($args['index']) ? $args['index'] : '';
185
+ $post_id = isset($args['post_id']) ? $args['post_id'] : '';
186
+
187
+ if(empty($post_id)) return;
188
+
189
+ $title = get_the_title($post_id);
190
+
191
+ $custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
192
+ $display_item = isset($element['display_item']) ? $element['display_item'] : 'result';
193
+
194
+
195
+ // if(!empty($acf_value)):
196
+
197
+ ?>
198
+ <div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> rate_my_post ">
199
+ <?php
200
+ if($display_item == 'result'){
201
+ echo do_shortcode("[ratemypost-result id=$post_id]");
202
+
203
+ }elseif ($display_item =='rating_widget'){
204
+ echo do_shortcode("[ratemypost id=$post_id]");
205
+
206
+ }elseif ($display_item =='both'){
207
+ echo do_shortcode("[ratemypost-result id=$post_id]");
208
+ echo do_shortcode("[ratemypost id=$post_id]");
209
+ }
210
+
211
+
212
+ ?>
213
+ </div>
214
+ <?php
215
+ // endif;
216
+
217
+ }
218
+
219
+
220
+
221
+ add_action('post_grid_layout_element_css_rate_my_post', 'post_grid_layout_element_css_rate_my_post', 10);
222
+ function post_grid_layout_element_css_rate_my_post($args){
223
+
224
+
225
+ $index = isset($args['index']) ? $args['index'] : '';
226
+ $element = isset($args['element']) ? $args['element'] : array();
227
+ $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
228
+
229
+ $color = isset($element['color']) ? $element['color'] : '';
230
+ $font_size = isset($element['font_size']) ? $element['font_size'] : '';
231
+ $margin = isset($element['margin']) ? $element['margin'] : '';
232
+ $text_align = isset($element['text_align']) ? $element['text_align'] : 'left';
233
+
234
+ $css = isset($element['css']) ? $element['css'] : '';
235
+ $css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
236
+
237
+ ?>
238
+ <style type="text/css">
239
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
240
+ <?php if(!empty($color)): ?>
241
+ color: <?php echo $color; ?>;
242
+ <?php endif; ?>
243
+ <?php if(!empty($font_size)): ?>
244
+ font-size: <?php echo $font_size; ?>;
245
+ <?php endif; ?>
246
+
247
+ <?php if(!empty($margin)): ?>
248
+ margin: <?php echo $margin; ?>;
249
+ <?php endif; ?>
250
+ <?php if(!empty($text_align)): ?>
251
+ text-align: <?php echo $text_align; ?>;
252
+ <?php endif; ?>
253
+ <?php if(!empty($css)): ?>
254
+ <?php echo $css; ?>
255
+ <?php endif; ?>
256
+ }
257
+ <?php if(!empty($css_hover)): ?>
258
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
259
+ <?php echo $css_hover; ?>
260
+ }
261
+ <?php endif; ?>
262
+ </style>
263
+ <?php
264
+ }
includes/layout-elements/rating-widget/layout-elements.php ADDED
@@ -0,0 +1,235 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined('ABSPATH')) exit; // if direct access
3
+
4
+
5
+ add_filter('post_grid_layout_elements','post_grid_pro_rating_widget_layout_elements');
6
+
7
+ function post_grid_pro_rating_widget_layout_elements($elements_group){
8
+
9
+ $elements_group['star_rating']['items']['rating_widget'] = array('name' =>__('Rating-Widget','post-grid'));
10
+
11
+ return $elements_group;
12
+ }
13
+
14
+
15
+ add_action('post_grid_layout_element_option_rating_widget','post_grid_layout_element_option_rating_widget');
16
+ function post_grid_layout_element_option_rating_widget($parameters){
17
+
18
+ $settings_tabs_field = new settings_tabs_field();
19
+
20
+ $input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
21
+ $element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
22
+ $element_index = isset($parameters['index']) ? $parameters['index'] : '';
23
+
24
+
25
+ $color = isset($element_data['color']) ? $element_data['color'] : '';
26
+ $font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
27
+ $margin = isset($element_data['margin']) ? $element_data['margin'] : '';
28
+ $text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
29
+
30
+ $css = isset($element_data['css']) ? $element_data['css'] : '';
31
+ $css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
32
+
33
+
34
+
35
+ ?>
36
+ <div class="item">
37
+ <div class="element-title header ">
38
+ <span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
39
+ <span class="sort"><i class="fas fa-sort"></i></span>
40
+
41
+ <span class="expand"><?php echo __('Rating-Widget','post-grid'); ?></span>
42
+ </div>
43
+ <div class="element-options options">
44
+
45
+ <?php
46
+
47
+
48
+ $args = array(
49
+ 'id' => 'color',
50
+ 'css_id' => $element_index.'_rating_widget',
51
+ 'parent' => $input_name.'[rating_widget]',
52
+ 'title' => __('Color','post-grid'),
53
+ 'details' => __('Title text color.','post-grid'),
54
+ 'type' => 'colorpicker',
55
+ 'value' => $color,
56
+ 'default' => '',
57
+ );
58
+
59
+ $settings_tabs_field->generate_field($args);
60
+
61
+ $args = array(
62
+ 'id' => 'font_size',
63
+ 'css_id' => $element_index.'_font_size',
64
+ 'parent' => $input_name.'[rating_widget]',
65
+ 'title' => __('Font size','post-grid'),
66
+ 'details' => __('Set font size.','post-grid'),
67
+ 'type' => 'text',
68
+ 'value' => $font_size,
69
+ 'default' => '',
70
+ 'placeholder' => '14px',
71
+ );
72
+
73
+ $settings_tabs_field->generate_field($args);
74
+
75
+
76
+
77
+ $args = array(
78
+ 'id' => 'margin',
79
+ 'css_id' => $element_index.'_margin',
80
+ 'parent' => $input_name.'[rating_widget]',
81
+ 'title' => __('Margin','post-grid'),
82
+ 'details' => __('Set margin.','post-grid'),
83
+ 'type' => 'text',
84
+ 'value' => $margin,
85
+ 'default' => '',
86
+ 'placeholder' => '5px 0',
87
+ );
88
+
89
+ $settings_tabs_field->generate_field($args);
90
+
91
+
92
+ $args = array(
93
+ 'id' => 'text_align',
94
+ 'css_id' => $element_index.'_text_align',
95
+ 'parent' => $input_name.'[rating_widget]',
96
+ 'title' => __('Text align','post-grid'),
97
+ 'details' => __('Choose text align.','post-grid'),
98
+ 'type' => 'select',
99
+ 'value' => $text_align,
100
+ 'default' => 'left',
101
+ 'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
102
+ );
103
+
104
+ $settings_tabs_field->generate_field($args);
105
+
106
+
107
+ $args = array(
108
+ 'id' => 'css',
109
+ 'css_id' => $element_index.'_css',
110
+ 'parent' => $input_name.'[rating_widget]',
111
+ 'title' => __('Custom CSS','post-grid'),
112
+ 'details' => __('Set csutom CSS.','post-grid'),
113
+ 'type' => 'textarea',
114
+ 'value' => $css,
115
+ 'default' => '',
116
+ 'placeholder' => '',
117
+ );
118
+
119
+ $settings_tabs_field->generate_field($args);
120
+
121
+ $args = array(
122
+ 'id' => 'css_hover',
123
+ 'css_id' => $element_index.'_css_hover',
124
+ 'parent' => $input_name.'[rating_widget]',
125
+ 'title' => __('Hover CSS','post-grid'),
126
+ 'details' => __('Set hover custom CSS.','post-grid'),
127
+ 'type' => 'textarea',
128
+ 'value' => $css_hover,
129
+ 'default' => '',
130
+ 'placeholder' => '',
131
+ );
132
+
133
+ $settings_tabs_field->generate_field($args);
134
+
135
+
136
+ ob_start();
137
+ ?>
138
+ <textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}</textarea>
139
+ <?php
140
+
141
+ $html = ob_get_clean();
142
+
143
+ $args = array(
144
+ 'id' => 'use_css',
145
+ 'title' => __('Use of CSS','post-grid'),
146
+ 'details' => __('Use following class selector to add custom CSS for this element.','post-grid'),
147
+ 'type' => 'custom_html',
148
+ 'html' => $html,
149
+
150
+ );
151
+
152
+ $settings_tabs_field->generate_field($args);
153
+
154
+ ?>
155
+
156
+ </div>
157
+ </div>
158
+ <?php
159
+
160
+ }
161
+
162
+
163
+
164
+ add_action('post_grid_layout_element_rating_widget', 'post_grid_layout_element_rating_widget');
165
+ function post_grid_layout_element_rating_widget($args){
166
+
167
+ $element = isset($args['element']) ? $args['element'] : array();
168
+ $elementIndex = isset($args['index']) ? $args['index'] : '';
169
+ $post_id = isset($args['post_id']) ? $args['post_id'] : '';
170
+
171
+ if(empty($post_id)) return;
172
+
173
+ $title = get_the_title($post_id);
174
+
175
+ $custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
176
+ $size = isset($element['size']) ? $element['size'] : 'small';
177
+
178
+
179
+ // if(!empty($acf_value)):
180
+
181
+ ?>
182
+ <div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> rating_widget ">
183
+ <?php echo do_shortcode("[ratingwidget post_id=$post_id]"); ?>
184
+ </div>
185
+ <?php
186
+ // endif;
187
+
188
+ }
189
+
190
+
191
+
192
+ add_action('post_grid_layout_element_css_rating_widget', 'post_grid_layout_element_css_rating_widget', 10);
193
+ function post_grid_layout_element_css_rating_widget($args){
194
+
195
+
196
+ $index = isset($args['index']) ? $args['index'] : '';
197
+ $element = isset($args['element']) ? $args['element'] : array();
198
+ $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
199
+
200
+ $color = isset($element['color']) ? $element['color'] : '';
201
+ $font_size = isset($element['font_size']) ? $element['font_size'] : '';
202
+ $margin = isset($element['margin']) ? $element['margin'] : '';
203
+ $text_align = isset($element['text_align']) ? $element['text_align'] : 'left';
204
+
205
+ $css = isset($element['css']) ? $element['css'] : '';
206
+ $css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
207
+
208
+ ?>
209
+ <style type="text/css">
210
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
211
+ <?php if(!empty($color)): ?>
212
+ color: <?php echo $color; ?>;
213
+ <?php endif; ?>
214
+ <?php if(!empty($font_size)): ?>
215
+ font-size: <?php echo $font_size; ?>;
216
+ <?php endif; ?>
217
+
218
+ <?php if(!empty($margin)): ?>
219
+ margin: <?php echo $margin; ?>;
220
+ <?php endif; ?>
221
+ <?php if(!empty($text_align)): ?>
222
+ text-align: <?php echo $text_align; ?>;
223
+ <?php endif; ?>
224
+ <?php if(!empty($css)): ?>
225
+ <?php echo $css; ?>
226
+ <?php endif; ?>
227
+ }
228
+ <?php if(!empty($css_hover)): ?>
229
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
230
+ <?php echo $css_hover; ?>
231
+ }
232
+ <?php endif; ?>
233
+ </style>
234
+ <?php
235
+ }
includes/layout-elements/wp-postratings/layout-elements.php ADDED
@@ -0,0 +1,250 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined('ABSPATH')) exit; // if direct access
3
+
4
+
5
+ add_filter('post_grid_layout_elements','post_grid_pro_wp_postratings_layout_elements');
6
+
7
+ function post_grid_pro_wp_postratings_layout_elements($elements_group){
8
+
9
+ $elements_group['star_rating']['items']['wp_postratings'] = array('name' =>__('WP-PostRatings','post-grid'));
10
+
11
+ return $elements_group;
12
+ }
13
+
14
+
15
+ add_action('post_grid_layout_element_option_wp_postratings','post_grid_layout_element_option_wp_postratings');
16
+ function post_grid_layout_element_option_wp_postratings($parameters){
17
+
18
+ $settings_tabs_field = new settings_tabs_field();
19
+
20
+ $input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
21
+ $element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
22
+ $element_index = isset($parameters['index']) ? $parameters['index'] : '';
23
+
24
+ $size = isset($element_data['size']) ? $element_data['size'] : '';
25
+
26
+ $color = isset($element_data['color']) ? $element_data['color'] : '';
27
+ $font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
28
+ $margin = isset($element_data['margin']) ? $element_data['margin'] : '';
29
+ $text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
30
+
31
+ $css = isset($element_data['css']) ? $element_data['css'] : '';
32
+ $css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
33
+
34
+
35
+
36
+ ?>
37
+ <div class="item">
38
+ <div class="element-title header ">
39
+ <span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
40
+ <span class="sort"><i class="fas fa-sort"></i></span>
41
+
42
+ <span class="expand"><?php echo __('WP-PostRatings','post-grid'); ?></span>
43
+ </div>
44
+ <div class="element-options options">
45
+
46
+ <?php
47
+
48
+ $args = array(
49
+ 'id' => 'size',
50
+ 'css_id' => $element_index.'_wp_postratings',
51
+ 'parent' => $input_name.'[wp_postratings]',
52
+ 'title' => __('size','post-grid'),
53
+ 'details' => __('Icon size, number only, ex: 20','post-grid'),
54
+ 'type' => 'text',
55
+ 'value' => $size,
56
+ 'default' => '20',
57
+ 'placeholder' => '20',
58
+ );
59
+
60
+ $settings_tabs_field->generate_field($args);
61
+
62
+ $args = array(
63
+ 'id' => 'color',
64
+ 'css_id' => $element_index.'_wp_postratings',
65
+ 'parent' => $input_name.'[wp_postratings]',
66
+ 'title' => __('Color','post-grid'),
67
+ 'details' => __('Title text color.','post-grid'),
68
+ 'type' => 'colorpicker',
69
+ 'value' => $color,
70
+ 'default' => '',
71
+ );
72
+
73
+ $settings_tabs_field->generate_field($args);
74
+
75
+ $args = array(
76
+ 'id' => 'font_size',
77
+ 'css_id' => $element_index.'_font_size',
78
+ 'parent' => $input_name.'[wp_postratings]',
79
+ 'title' => __('Font size','post-grid'),
80
+ 'details' => __('Set font size.','post-grid'),
81
+ 'type' => 'text',
82
+ 'value' => $font_size,
83
+ 'default' => '',
84
+ 'placeholder' => '14px',
85
+ );
86
+
87
+ $settings_tabs_field->generate_field($args);
88
+
89
+
90
+
91
+ $args = array(
92
+ 'id' => 'margin',
93
+ 'css_id' => $element_index.'_margin',
94
+ 'parent' => $input_name.'[wp_postratings]',
95
+ 'title' => __('Margin','post-grid'),
96
+ 'details' => __('Set margin.','post-grid'),
97
+ 'type' => 'text',
98
+ 'value' => $margin,
99
+ 'default' => '',
100
+ 'placeholder' => '5px 0',
101
+ );
102
+
103
+ $settings_tabs_field->generate_field($args);
104
+
105
+
106
+ $args = array(
107
+ 'id' => 'text_align',
108
+ 'css_id' => $element_index.'_text_align',
109
+ 'parent' => $input_name.'[wp_postratings]',
110
+ 'title' => __('Text align','post-grid'),
111
+ 'details' => __('Choose text align.','post-grid'),
112
+ 'type' => 'select',
113
+ 'value' => $text_align,
114
+ 'default' => 'left',
115
+ 'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
116
+ );
117
+
118
+ $settings_tabs_field->generate_field($args);
119
+
120
+
121
+ $args = array(
122
+ 'id' => 'css',
123
+ 'css_id' => $element_index.'_css',
124
+ 'parent' => $input_name.'[wp_postratings]',
125
+ 'title' => __('Custom CSS','post-grid'),
126
+ 'details' => __('Set csutom CSS.','post-grid'),
127
+ 'type' => 'textarea',
128
+ 'value' => $css,
129
+ 'default' => '',
130
+ 'placeholder' => '',
131
+ );
132
+
133
+ $settings_tabs_field->generate_field($args);
134
+
135
+ $args = array(
136
+ 'id' => 'css_hover',
137
+ 'css_id' => $element_index.'_css_hover',
138
+ 'parent' => $input_name.'[wp_postratings]',
139
+ 'title' => __('Hover CSS','post-grid'),
140
+ 'details' => __('Set hover custom CSS.','post-grid'),
141
+ 'type' => 'textarea',
142
+ 'value' => $css_hover,
143
+ 'default' => '',
144
+ 'placeholder' => '',
145
+ );
146
+
147
+ $settings_tabs_field->generate_field($args);
148
+
149
+
150
+ ob_start();
151
+ ?>
152
+ <textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}</textarea>
153
+ <?php
154
+
155
+ $html = ob_get_clean();
156
+
157
+ $args = array(
158
+ 'id' => 'use_css',
159
+ 'title' => __('Use of CSS','post-grid'),
160
+ 'details' => __('Use following class selector to add custom CSS for this element.','post-grid'),
161
+ 'type' => 'custom_html',
162
+ 'html' => $html,
163
+
164
+ );
165
+
166
+ $settings_tabs_field->generate_field($args);
167
+
168
+ ?>
169
+
170
+ </div>
171
+ </div>
172
+ <?php
173
+
174
+ }
175
+
176
+
177
+
178
+ add_action('post_grid_layout_element_wp_postratings', 'post_grid_layout_element_wp_postratings');
179
+ function post_grid_layout_element_wp_postratings($args){
180
+
181
+ $element = isset($args['element']) ? $args['element'] : array();
182
+ $elementIndex = isset($args['index']) ? $args['index'] : '';
183
+ $post_id = isset($args['post_id']) ? $args['post_id'] : '';
184
+
185
+ if(empty($post_id)) return;
186
+
187
+ $title = get_the_title($post_id);
188
+
189
+ $custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
190
+ $size = isset($element['size']) ? $element['size'] : '20';
191
+
192
+
193
+
194
+ if(function_exists('the_ratings')) {
195
+ ?>
196
+ <div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> wp_postratings ">
197
+ <?php the_ratings(); ?>
198
+ </div>
199
+ <?php
200
+ }
201
+
202
+
203
+ }
204
+
205
+
206
+
207
+ add_action('post_grid_layout_element_css_wp_postratings', 'post_grid_layout_element_css_wp_postratings', 10);
208
+ function post_grid_layout_element_css_wp_postratings($args){
209
+
210
+
211
+ $index = isset($args['index']) ? $args['index'] : '';
212
+ $element = isset($args['element']) ? $args['element'] : array();
213
+ $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
214
+
215
+ $color = isset($element['color']) ? $element['color'] : '';
216
+ $font_size = isset($element['font_size']) ? $element['font_size'] : '';
217
+ $margin = isset($element['margin']) ? $element['margin'] : '';
218
+ $text_align = isset($element['text_align']) ? $element['text_align'] : 'left';
219
+
220
+ $css = isset($element['css']) ? $element['css'] : '';
221
+ $css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
222
+
223
+ ?>
224
+ <style type="text/css">
225
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
226
+ <?php if(!empty($color)): ?>
227
+ color: <?php echo $color; ?>;
228
+ <?php endif; ?>
229
+ <?php if(!empty($font_size)): ?>
230
+ font-size: <?php echo $font_size; ?>;
231
+ <?php endif; ?>
232
+
233
+ <?php if(!empty($margin)): ?>
234
+ margin: <?php echo $margin; ?>;
235
+ <?php endif; ?>
236
+ <?php if(!empty($text_align)): ?>
237
+ text-align: <?php echo $text_align; ?>;
238
+ <?php endif; ?>
239
+ <?php if(!empty($css)): ?>
240
+ <?php echo $css; ?>
241
+ <?php endif; ?>
242
+ }
243
+ <?php if(!empty($css_hover)): ?>
244
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
245
+ <?php echo $css_hover; ?>
246
+ }
247
+ <?php endif; ?>
248
+ </style>
249
+ <?php
250
+ }
includes/layout-elements/yet-another-stars-rating/layout-elements.php ADDED
@@ -0,0 +1,537 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined('ABSPATH')) exit; // if direct access
3
+
4
+
5
+ //add_filter('post_grid_layout_elements','post_grid_layout_elements_star_rating');
6
+ //
7
+ //function post_grid_layout_elements_star_rating($elements_group){
8
+ //
9
+ // $elements_group['star_rating'] = array(
10
+ // 'group_title'=>'Star Rating',
11
+ // );
12
+ //
13
+ // return $elements_group;
14
+ //}
15
+ //
16
+ //
17
+ //add_filter('post_grid_layout_group_star_rating','post_grid_layout_group_star_rating');
18
+ //
19
+ //function post_grid_layout_group_star_rating($group_items){
20
+ //
21
+ //
22
+ // $group_items['yasr_visitor_votes'] = array('name' =>__('YASR - visitor votes','post-grid'));
23
+ // $group_items['yasr_overall_rating'] = array('name' =>__('YASR- overall rating','post-grid'));
24
+ //
25
+ // return $group_items;
26
+ //}
27
+
28
+
29
+ add_filter('post_grid_layout_elements','post_grid_pro_yasr_layout_elements');
30
+
31
+ function post_grid_pro_yasr_layout_elements($elements_group){
32
+
33
+
34
+ $elements_group['star_rating']['items']['yasr_visitor_votes'] = array('name' =>__('YASR - visitor votes','post-grid'));
35
+ $elements_group['star_rating']['items']['yasr_overall_rating'] = array('name' =>__('YASR- overall rating','post-grid'));
36
+
37
+
38
+ // $elements_group['star_rating'] = array(
39
+ // 'group_title'=>'Star Rating',
40
+ // 'items'=>array(
41
+ // 'yasr_visitor_votes'=>array('name' =>__('YASR - visitor votes','post-grid')),
42
+ // 'yasr_overall_rating'=>array('name' =>__('YASR- overall rating','post-grid')),
43
+ //
44
+ // ),
45
+ // );
46
+
47
+ return $elements_group;
48
+ }
49
+
50
+
51
+
52
+ add_action('post_grid_layout_element_option_yasr_visitor_votes','post_grid_layout_element_option_yasr_visitor_votes');
53
+ function post_grid_layout_element_option_yasr_visitor_votes($parameters){
54
+
55
+ $settings_tabs_field = new settings_tabs_field();
56
+
57
+ $input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
58
+ $element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
59
+ $element_index = isset($parameters['index']) ? $parameters['index'] : '';
60
+
61
+ $size = isset($element_data['size']) ? $element_data['size'] : 'small';
62
+ $readonly = isset($element_data['readonly']) ? $element_data['readonly'] : 'no';
63
+ $show_average = isset($element_data['show_average']) ? $element_data['show_average'] : 'small';
64
+
65
+ $color = isset($element_data['color']) ? $element_data['color'] : '';
66
+ $font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
67
+ $margin = isset($element_data['margin']) ? $element_data['margin'] : '';
68
+ $text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
69
+
70
+ $css = isset($element_data['css']) ? $element_data['css'] : '';
71
+ $css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
72
+
73
+
74
+
75
+ ?>
76
+ <div class="item">
77
+ <div class="element-title header ">
78
+ <span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
79
+ <span class="sort"><i class="fas fa-sort"></i></span>
80
+
81
+ <span class="expand"><?php echo __('YASR - Visitor votes','post-grid'); ?></span>
82
+ </div>
83
+ <div class="element-options options">
84
+
85
+ <?php
86
+
87
+
88
+ $args = array(
89
+ 'id' => 'size',
90
+ 'css_id' => $element_index.'_text',
91
+ 'parent' => $input_name.'[yasr_visitor_votes]',
92
+ 'title' => __('Icon size','post-grid'),
93
+ 'details' => __('Choose icon size.','post-grid'),
94
+ 'type' => 'select',
95
+ 'value' => $text_align,
96
+ 'default' => 'small',
97
+ 'args' => array('small'=> __('Small', 'post-grid'),'medium'=> __('Medium', 'post-grid'),'large'=> __('Large', 'post-grid') ),
98
+ );
99
+
100
+ $settings_tabs_field->generate_field($args);
101
+
102
+
103
+
104
+
105
+ $args = array(
106
+ 'id' => 'color',
107
+ 'css_id' => $element_index.'_yasr_visitor_votes',
108
+ 'parent' => $input_name.'[yasr_visitor_votes]',
109
+ 'title' => __('Color','post-grid'),
110
+ 'details' => __('Title text color.','post-grid'),
111
+ 'type' => 'colorpicker',
112
+ 'value' => $color,
113
+ 'default' => '',
114
+ );
115
+
116
+ $settings_tabs_field->generate_field($args);
117
+
118
+ $args = array(
119
+ 'id' => 'font_size',
120
+ 'css_id' => $element_index.'_font_size',
121
+ 'parent' => $input_name.'[yasr_visitor_votes]',
122
+ 'title' => __('Font size','post-grid'),
123
+ 'details' => __('Set font size.','post-grid'),
124
+ 'type' => 'text',
125
+ 'value' => $font_size,
126
+ 'default' => '',
127
+ 'placeholder' => '14px',
128
+ );
129
+
130
+ $settings_tabs_field->generate_field($args);
131
+
132
+
133
+
134
+ $args = array(
135
+ 'id' => 'margin',
136
+ 'css_id' => $element_index.'_margin',
137
+ 'parent' => $input_name.'[yasr_visitor_votes]',
138
+ 'title' => __('Margin','post-grid'),
139
+ 'details' => __('Set margin.','post-grid'),
140
+ 'type' => 'text',
141
+ 'value' => $margin,
142
+ 'default' => '',
143
+ 'placeholder' => '5px 0',
144
+ );
145
+
146
+ $settings_tabs_field->generate_field($args);
147
+
148
+
149
+ $args = array(
150
+ 'id' => 'text_align',
151
+ 'css_id' => $element_index.'_text_align',
152
+ 'parent' => $input_name.'[yasr_visitor_votes]',
153
+ 'title' => __('Text align','post-grid'),
154
+ 'details' => __('Choose text align.','post-grid'),
155
+ 'type' => 'select',
156
+ 'value' => $text_align,
157
+ 'default' => 'left',
158
+ 'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
159
+ );
160
+
161
+ $settings_tabs_field->generate_field($args);
162
+
163
+
164
+ $args = array(
165
+ 'id' => 'css',
166
+ 'css_id' => $element_index.'_css',
167
+ 'parent' => $input_name.'[yasr_visitor_votes]',
168
+ 'title' => __('Custom CSS','post-grid'),
169
+ 'details' => __('Set csutom CSS.','post-grid'),
170
+ 'type' => 'textarea',
171
+ 'value' => $css,
172
+ 'default' => '',
173
+ 'placeholder' => '',
174
+ );
175
+
176
+ $settings_tabs_field->generate_field($args);
177
+
178
+ $args = array(
179
+ 'id' => 'css_hover',
180
+ 'css_id' => $element_index.'_css_hover',
181
+ 'parent' => $input_name.'[yasr_visitor_votes]',
182
+ 'title' => __('Hover CSS','post-grid'),
183
+ 'details' => __('Set hover custom CSS.','post-grid'),
184
+ 'type' => 'textarea',
185
+ 'value' => $css_hover,
186
+ 'default' => '',
187
+ 'placeholder' => '',
188
+ );
189
+
190
+ $settings_tabs_field->generate_field($args);
191
+
192
+
193
+ ob_start();
194
+ ?>
195
+ <textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}</textarea>
196
+ <?php
197
+
198
+ $html = ob_get_clean();
199
+
200
+ $args = array(
201
+ 'id' => 'use_css',
202
+ 'title' => __('Use of CSS','post-grid'),
203
+ 'details' => __('Use following class selector to add custom CSS for this element.','post-grid'),
204
+ 'type' => 'custom_html',
205
+ 'html' => $html,
206
+
207
+ );
208
+
209
+ $settings_tabs_field->generate_field($args);
210
+
211
+ ?>
212
+
213
+ </div>
214
+ </div>
215
+ <?php
216
+
217
+ }
218
+
219
+
220
+
221
+ add_action('post_grid_layout_element_yasr_visitor_votes', 'post_grid_layout_element_yasr_visitor_votes');
222
+ function post_grid_layout_element_yasr_visitor_votes($args){
223
+
224
+ $element = isset($args['element']) ? $args['element'] : array();
225
+ $elementIndex = isset($args['index']) ? $args['index'] : '';
226
+ $post_id = isset($args['post_id']) ? $args['post_id'] : '';
227
+
228
+ if(empty($post_id)) return;
229
+
230
+ $title = get_the_title($post_id);
231
+
232
+ $custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
233
+ $size = isset($element['size']) ? $element['size'] : 'small';
234
+
235
+
236
+ // if(!empty($acf_value)):
237
+
238
+ ?>
239
+ <div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> yasr_visitor_votes ">
240
+ <?php echo do_shortcode("[yasr_visitor_votes size=$size postid=$post_id]"); ?>
241
+ </div>
242
+ <?php
243
+ // endif;
244
+
245
+ }
246
+
247
+
248
+
249
+ add_action('post_grid_layout_element_css_yasr_visitor_votes', 'post_grid_layout_element_css_yasr_visitor_votes', 10);
250
+ function post_grid_layout_element_css_yasr_visitor_votes($args){
251
+
252
+
253
+ $index = isset($args['index']) ? $args['index'] : '';
254
+ $element = isset($args['element']) ? $args['element'] : array();
255
+ $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
256
+
257
+ $color = isset($element['color']) ? $element['color'] : '';
258
+ $font_size = isset($element['font_size']) ? $element['font_size'] : '';
259
+ $margin = isset($element['margin']) ? $element['margin'] : '';
260
+ $text_align = isset($element['text_align']) ? $element['text_align'] : 'left';
261
+
262
+ $css = isset($element['css']) ? $element['css'] : '';
263
+ $css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
264
+
265
+ ?>
266
+ <style type="text/css">
267
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
268
+ <?php if(!empty($color)): ?>
269
+ color: <?php echo $color; ?>;
270
+ <?php endif; ?>
271
+ <?php if(!empty($font_size)): ?>
272
+ font-size: <?php echo $font_size; ?>;
273
+ <?php endif; ?>
274
+
275
+ <?php if(!empty($margin)): ?>
276
+ margin: <?php echo $margin; ?>;
277
+ <?php endif; ?>
278
+ <?php if(!empty($text_align)): ?>
279
+ text-align: <?php echo $text_align; ?>;
280
+ <?php endif; ?>
281
+ <?php if(!empty($css)): ?>
282
+ <?php echo $css; ?>
283
+ <?php endif; ?>
284
+ }
285
+ <?php if(!empty($css_hover)): ?>
286
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
287
+ <?php echo $css_hover; ?>
288
+ }
289
+ <?php endif; ?>
290
+ </style>
291
+ <?php
292
+ }
293
+
294
+
295
+
296
+ add_action('post_grid_layout_element_option_yasr_overall_rating','post_grid_layout_element_option_yasr_overall_rating');
297
+ function post_grid_layout_element_option_yasr_overall_rating($parameters){
298
+
299
+ $settings_tabs_field = new settings_tabs_field();
300
+
301
+ $input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
302
+ $element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
303
+ $element_index = isset($parameters['index']) ? $parameters['index'] : '';
304
+
305
+ $size = isset($element_data['size']) ? $element_data['size'] : 'small';
306
+ $readonly = isset($element_data['readonly']) ? $element_data['readonly'] : 'no';
307
+ $show_average = isset($element_data['show_average']) ? $element_data['show_average'] : 'small';
308
+
309
+ $color = isset($element_data['color']) ? $element_data['color'] : '';
310
+ $font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
311
+ $margin = isset($element_data['margin']) ? $element_data['margin'] : '';
312
+ $text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
313
+
314
+ $css = isset($element_data['css']) ? $element_data['css'] : '';
315
+ $css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
316
+
317
+
318
+
319
+ ?>
320
+ <div class="item">
321
+ <div class="element-title header ">
322
+ <span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
323
+ <span class="sort"><i class="fas fa-sort"></i></span>
324
+
325
+ <span class="expand"><?php echo __('YASR - Visitor votes','post-grid'); ?></span>
326
+ </div>
327
+ <div class="element-options options">
328
+
329
+ <?php
330
+
331
+
332
+ $args = array(
333
+ 'id' => 'size',
334
+ 'css_id' => $element_index.'_text',
335
+ 'parent' => $input_name.'[yasr_overall_rating]',
336
+ 'title' => __('Icon size','post-grid'),
337
+ 'details' => __('Choose icon size.','post-grid'),
338
+ 'type' => 'select',
339
+ 'value' => $text_align,
340
+ 'default' => 'small',
341
+ 'args' => array('small'=> __('Small', 'post-grid'),'medium'=> __('Medium', 'post-grid'),'large'=> __('Large', 'post-grid') ),
342
+ );
343
+
344
+ $settings_tabs_field->generate_field($args);
345
+
346
+
347
+
348
+
349
+ $args = array(
350
+ 'id' => 'color',
351
+ 'css_id' => $element_index.'_yasr_overall_rating',
352
+ 'parent' => $input_name.'[yasr_overall_rating]',
353
+ 'title' => __('Color','post-grid'),
354
+ 'details' => __('Title text color.','post-grid'),
355
+ 'type' => 'colorpicker',
356
+ 'value' => $color,
357
+ 'default' => '',
358
+ );
359
+
360
+ $settings_tabs_field->generate_field($args);
361
+
362
+ $args = array(
363
+ 'id' => 'font_size',
364
+ 'css_id' => $element_index.'_font_size',
365
+ 'parent' => $input_name.'[yasr_overall_rating]',
366
+ 'title' => __('Font size','post-grid'),
367
+ 'details' => __('Set font size.','post-grid'),
368
+ 'type' => 'text',
369
+ 'value' => $font_size,
370
+ 'default' => '',
371
+ 'placeholder' => '14px',
372
+ );
373
+
374
+ $settings_tabs_field->generate_field($args);
375
+
376
+
377
+
378
+ $args = array(
379
+ 'id' => 'margin',
380
+ 'css_id' => $element_index.'_margin',
381
+ 'parent' => $input_name.'[yasr_overall_rating]',
382
+ 'title' => __('Margin','post-grid'),
383
+ 'details' => __('Set margin.','post-grid'),
384
+ 'type' => 'text',
385
+ 'value' => $margin,
386
+ 'default' => '',
387
+ 'placeholder' => '5px 0',
388
+ );
389
+
390
+ $settings_tabs_field->generate_field($args);
391
+
392
+
393
+ $args = array(
394
+ 'id' => 'text_align',
395
+ 'css_id' => $element_index.'_text_align',
396
+ 'parent' => $input_name.'[yasr_overall_rating]',
397
+ 'title' => __('Text align','post-grid'),
398
+ 'details' => __('Choose text align.','post-grid'),
399
+ 'type' => 'select',
400
+ 'value' => $text_align,
401
+ 'default' => 'left',
402
+ 'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
403
+ );
404
+
405
+ $settings_tabs_field->generate_field($args);
406
+
407
+
408
+ $args = array(
409
+ 'id' => 'css',
410
+ 'css_id' => $element_index.'_css',
411
+ 'parent' => $input_name.'[yasr_overall_rating]',
412
+ 'title' => __('Custom CSS','post-grid'),
413
+ 'details' => __('Set csutom CSS.','post-grid'),
414
+ 'type' => 'textarea',
415
+ 'value' => $css,
416
+ 'default' => '',
417
+ 'placeholder' => '',
418
+ );
419
+
420
+ $settings_tabs_field->generate_field($args);
421
+
422
+ $args = array(
423
+ 'id' => 'css_hover',
424
+ 'css_id' => $element_index.'_css_hover',
425
+ 'parent' => $input_name.'[yasr_overall_rating]',
426
+ 'title' => __('Hover CSS','post-grid'),
427
+ 'details' => __('Set hover custom CSS.','post-grid'),
428
+ 'type' => 'textarea',
429
+ 'value' => $css_hover,
430
+ 'default' => '',
431
+ 'placeholder' => '',
432
+ );
433
+
434
+ $settings_tabs_field->generate_field($args);
435
+
436
+
437
+ ob_start();
438
+ ?>
439
+ <textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}</textarea>
440
+ <?php
441
+
442
+ $html = ob_get_clean();
443
+
444
+ $args = array(
445
+ 'id' => 'use_css',
446
+ 'title' => __('Use of CSS','post-grid'),
447
+ 'details' => __('Use following class selector to add custom CSS for this element.','post-grid'),
448
+ 'type' => 'custom_html',
449
+ 'html' => $html,
450
+
451
+ );
452
+
453
+ $settings_tabs_field->generate_field($args);
454
+
455
+ ?>
456
+
457
+ </div>
458
+ </div>
459
+ <?php
460
+
461
+ }
462
+
463
+
464
+
465
+ add_action('post_grid_layout_element_yasr_overall_rating', 'post_grid_layout_element_yasr_overall_rating');
466
+ function post_grid_layout_element_yasr_overall_rating($args){
467
+
468
+ $element = isset($args['element']) ? $args['element'] : array();
469
+ $elementIndex = isset($args['index']) ? $args['index'] : '';
470
+ $post_id = isset($args['post_id']) ? $args['post_id'] : '';
471
+
472
+ if(empty($post_id)) return;
473
+
474
+ $title = get_the_title($post_id);
475
+
476
+ $custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
477
+ $size = isset($element['size']) ? $element['size'] : 'small';
478
+
479
+
480
+ // if(!empty($acf_value)):
481
+
482
+ ?>
483
+ <div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> yasr_overall_rating ">
484
+ <?php echo do_shortcode("[yasr_overall_rating size=$size postid=$post_id]"); ?>
485
+ </div>
486
+ <?php
487
+ // endif;
488
+
489
+ }
490
+
491
+
492
+
493
+ add_action('post_grid_layout_element_css_yasr_overall_rating', 'post_grid_layout_element_css_yasr_overall_rating', 10);
494
+ function post_grid_layout_element_css_yasr_overall_rating($args){
495
+
496
+
497
+ $index = isset($args['index']) ? $args['index'] : '';
498
+ $element = isset($args['element']) ? $args['element'] : array();
499
+ $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
500
+
501
+ $color = isset($element['color']) ? $element['color'] : '';
502
+ $font_size = isset($element['font_size']) ? $element['font_size'] : '';
503
+ $margin = isset($element['margin']) ? $element['margin'] : '';
504
+ $text_align = isset($element['text_align']) ? $element['text_align'] : 'left';
505
+
506
+ $css = isset($element['css']) ? $element['css'] : '';
507
+ $css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
508
+
509
+ ?>
510
+ <style type="text/css">
511
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
512
+ <?php if(!empty($color)): ?>
513
+ color: <?php echo $color; ?>;
514
+ <?php endif; ?>
515
+ <?php if(!empty($font_size)): ?>
516
+ font-size: <?php echo $font_size; ?>;
517
+ <?php endif; ?>
518
+
519
+ <?php if(!empty($margin)): ?>
520
+ margin: <?php echo $margin; ?>;
521
+ <?php endif; ?>
522
+ <?php if(!empty($text_align)): ?>
523
+ text-align: <?php echo $text_align; ?>;
524
+ <?php endif; ?>
525
+ <?php if(!empty($css)): ?>
526
+ <?php echo $css; ?>
527
+ <?php endif; ?>
528
+ }
529
+ <?php if(!empty($css_hover)): ?>
530
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
531
+ <?php echo $css_hover; ?>
532
+ }
533
+ <?php endif; ?>
534
+ </style>
535
+ <?php
536
+ }
537
+
includes/layout-elements/yith-woocommerce-wishlist/layout-elements.php ADDED
@@ -0,0 +1,252 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined('ABSPATH')) exit; // if direct access
3
+
4
+
5
+
6
+
7
+ add_filter('post_grid_layout_elements','post_grid_pro_yith_layout_elements');
8
+
9
+ function post_grid_pro_yith_layout_elements($elements_group){
10
+
11
+
12
+ $elements_group['wishlist']['items']['yith_add_to_wishlist'] = array('name' =>__('YITH - Add to Wishlist','post-grid'));
13
+
14
+
15
+ return $elements_group;
16
+ }
17
+
18
+
19
+
20
+ add_action('post_grid_layout_element_option_yith_add_to_wishlist','post_grid_layout_element_option_yith_add_to_wishlist');
21
+ function post_grid_layout_element_option_yith_add_to_wishlist($parameters){
22
+
23
+ $settings_tabs_field = new settings_tabs_field();
24
+
25
+ $input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
26
+ $element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
27
+ $element_index = isset($parameters['index']) ? $parameters['index'] : '';
28
+
29
+ $size = isset($element_data['size']) ? $element_data['size'] : 'small';
30
+ $readonly = isset($element_data['readonly']) ? $element_data['readonly'] : 'no';
31
+ $show_average = isset($element_data['show_average']) ? $element_data['show_average'] : 'small';
32
+
33
+ $color = isset($element_data['color']) ? $element_data['color'] : '';
34
+ $font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
35
+ $margin = isset($element_data['margin']) ? $element_data['margin'] : '';
36
+ $text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
37
+
38
+ $css = isset($element_data['css']) ? $element_data['css'] : '';
39
+ $css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
40
+
41
+
42
+
43
+ ?>
44
+ <div class="item">
45
+ <div class="element-title header ">
46
+ <span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
47
+ <span class="sort"><i class="fas fa-sort"></i></span>
48
+
49
+ <span class="expand"><?php echo __('YITH - Wishlist','post-grid'); ?></span>
50
+ </div>
51
+ <div class="element-options options">
52
+
53
+ <?php
54
+
55
+
56
+ $args = array(
57
+ 'id' => 'color',
58
+ 'css_id' => $element_index.'_yith_add_to_wishlist',
59
+ 'parent' => $input_name.'[yith_add_to_wishlist]',
60
+ 'title' => __('Color','post-grid'),
61
+ 'details' => __('Title text color.','post-grid'),
62
+ 'type' => 'colorpicker',
63
+ 'value' => $color,
64
+ 'default' => '',
65
+ );
66
+
67
+ $settings_tabs_field->generate_field($args);
68
+
69
+ $args = array(
70
+ 'id' => 'font_size',
71
+ 'css_id' => $element_index.'_font_size',
72
+ 'parent' => $input_name.'[yith_add_to_wishlist]',
73
+ 'title' => __('Font size','post-grid'),
74
+ 'details' => __('Set font size.','post-grid'),
75
+ 'type' => 'text',
76
+ 'value' => $font_size,
77
+ 'default' => '',
78
+ 'placeholder' => '14px',
79
+ );
80
+
81
+ $settings_tabs_field->generate_field($args);
82
+
83
+
84
+
85
+ $args = array(
86
+ 'id' => 'margin',
87
+ 'css_id' => $element_index.'_margin',
88
+ 'parent' => $input_name.'[yith_add_to_wishlist]',
89
+ 'title' => __('Margin','post-grid'),
90
+ 'details' => __('Set margin.','post-grid'),
91
+ 'type' => 'text',
92
+ 'value' => $margin,
93
+ 'default' => '',
94
+ 'placeholder' => '5px 0',
95
+ );
96
+
97
+ $settings_tabs_field->generate_field($args);
98
+
99
+
100
+ $args = array(
101
+ 'id' => 'text_align',
102
+ 'css_id' => $element_index.'_text_align',
103
+ 'parent' => $input_name.'[yith_add_to_wishlist]',
104
+ 'title' => __('Text align','post-grid'),
105
+ 'details' => __('Choose text align.','post-grid'),
106
+ 'type' => 'select',
107
+ 'value' => $text_align,
108
+ 'default' => 'left',
109
+ 'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
110
+ );
111
+
112
+ $settings_tabs_field->generate_field($args);
113
+
114
+
115
+ $args = array(
116
+ 'id' => 'css',
117
+ 'css_id' => $element_index.'_css',
118
+ 'parent' => $input_name.'[yith_add_to_wishlist]',
119
+ 'title' => __('Custom CSS','post-grid'),
120
+ 'details' => __('Set csutom CSS.','post-grid'),
121
+ 'type' => 'textarea',
122
+ 'value' => $css,
123
+ 'default' => '',
124
+ 'placeholder' => '',
125
+ );
126
+
127
+ $settings_tabs_field->generate_field($args);
128
+
129
+ $args = array(
130
+ 'id' => 'css_hover',
131
+ 'css_id' => $element_index.'_css_hover',
132
+ 'parent' => $input_name.'[yith_add_to_wishlist]',
133
+ 'title' => __('Hover CSS','post-grid'),
134
+ 'details' => __('Set hover custom CSS.','post-grid'),
135
+ 'type' => 'textarea',
136
+ 'value' => $css_hover,
137
+ 'default' => '',
138
+ 'placeholder' => '',
139
+ );
140
+
141
+ $settings_tabs_field->generate_field($args);
142
+
143
+
144
+ ob_start();
145
+ ?>
146
+ <textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}</textarea>
147
+ <?php
148
+
149
+ $html = ob_get_clean();
150
+
151
+ $args = array(
152
+ 'id' => 'use_css',
153
+ 'title' => __('Use of CSS','post-grid'),
154
+ 'details' => __('Use following class selector to add custom CSS for this element.','post-grid'),
155
+ 'type' => 'custom_html',
156
+ 'html' => $html,
157
+
158
+ );
159
+
160
+ $settings_tabs_field->generate_field($args);
161
+
162
+ ?>
163
+
164
+ </div>
165
+ </div>
166
+ <?php
167
+
168
+ }
169
+
170
+
171
+
172
+ add_action('post_grid_layout_element_yith_add_to_wishlist', 'post_grid_layout_element_yith_add_to_wishlist');
173
+ function post_grid_layout_element_yith_add_to_wishlist($args){
174
+
175
+ $element = isset($args['element']) ? $args['element'] : array();
176
+ $elementIndex = isset($args['index']) ? $args['index'] : '';
177
+ $post_id = isset($args['post_id']) ? $args['post_id'] : '';
178
+
179
+ if(empty($post_id)) return;
180
+
181
+ $title = get_the_title($post_id);
182
+
183
+ $custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
184
+
185
+
186
+ // if(!empty($acf_value)):
187
+
188
+ ?>
189
+ <div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> yith_add_to_wishlist ">
190
+ <?php echo do_shortcode("[yith_wcwl_add_to_wishlist product_id=$post_id ]"); ?>
191
+ </div>
192
+ <?php
193
+ // endif;
194
+
195
+ }
196
+
197
+
198
+
199
+ add_action('post_grid_layout_element_css_yith_add_to_wishlist', 'post_grid_layout_element_css_yith_add_to_wishlist', 10);
200
+ function post_grid_layout_element_css_yith_add_to_wishlist($args){
201
+
202
+
203
+ $index = isset($args['index']) ? $args['index'] : '';
204
+ $element = isset($args['element']) ? $args['element'] : array();
205
+ $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
206
+
207
+ $color = isset($element['color']) ? $element['color'] : '';
208
+ $font_size = isset($element['font_size']) ? $element['font_size'] : '';
209
+ $margin = isset($element['margin']) ? $element['margin'] : '';
210
+ $text_align = isset($element['text_align']) ? $element['text_align'] : 'left';
211
+
212
+ $css = isset($element['css']) ? $element['css'] : '';
213
+ $css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
214
+
215
+ ?>
216
+ <style type="text/css">
217
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
218
+ <?php if(!empty($color)): ?>
219
+ color: <?php echo $color; ?>;
220
+ <?php endif; ?>
221
+ <?php if(!empty($font_size)): ?>
222
+ font-size: <?php echo $font_size; ?>;
223
+ <?php endif; ?>
224
+
225
+ <?php if(!empty($margin)): ?>
226
+ margin: <?php echo $margin; ?>;
227
+ <?php endif; ?>
228
+ <?php if(!empty($text_align)): ?>
229
+ text-align: <?php echo $text_align; ?>;
230
+ <?php endif; ?>
231
+ <?php if(!empty($css)): ?>
232
+ <?php echo $css; ?>
233
+ <?php endif; ?>
234
+ }
235
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?> a{
236
+ <?php if(!empty($color)): ?>
237
+ color: <?php echo $color; ?>;
238
+ <?php endif; ?>
239
+ <?php if(!empty($font_size)): ?>
240
+ font-size: <?php echo $font_size; ?>;
241
+ <?php endif; ?>
242
+ }
243
+ <?php if(!empty($css_hover)): ?>
244
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
245
+ <?php echo $css_hover; ?>
246
+ }
247
+ <?php endif; ?>
248
+ </style>
249
+ <?php
250
+ }
251
+
252
+
includes/post-grid-meta-box.php CHANGED
@@ -255,8 +255,78 @@ function meta_boxes_post_grid_input( $post ) {
255
  function meta_boxes_post_grid_side( $post ) {
256
 
257
  ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
258
  <div class="post-grid-meta-box">
259
 
 
 
 
 
 
260
  <ul>
261
  <li>Post Grid Version: <?php echo post_grid_version; ?></li>
262
  <li>Tested WP: 5.4</li>
@@ -276,27 +346,6 @@ function meta_boxes_post_grid_side( $post ) {
276
 
277
  <a class="button" href="https://wordpress.org/support/plugin/post-grid/reviews/#new-post" target="_blank">Submit Reviews</a> <a class="button" href="https://wordpress.org/support/plugin/post-grid/#new-topic-0" target="_blank">Ask wordpress.org</a><p>We spent thousand+ hours to development on this plugin, please submit your reviews wisely.</p><p>If you have any issue with this plugin please submit our forums or contact our support first.</p><p class="description">Your feedback and reviews are most important things to keep our development on track. If you have time please submit us five star <a href="https://wordpress.org/support/plugin/post-grid/reviews/"><span style="color: orange"><i class="fas fa-star"></i><i class="fas fa-star"></i><i class="fas fa-star"></i><i class="fas fa-star"></i><i class="fas fa-star"></i></span></a> reviews.</p>
278
 
279
- <h3>FAQ</h3>
280
- <div class="faq">
281
- <?php
282
- $class_post_grid_support = new class_post_grid_support();
283
- $faqs = $class_post_grid_support->faq();
284
-
285
- echo '<ul>';
286
-
287
- foreach($faqs as $item){
288
-
289
- echo '<li class="item">';
290
- echo '<a target="_blank" href="'.$item['answer_url'].'"><i class="far fa-dot-circle"></i> '.$item['question'].'</a>';
291
-
292
-
293
- echo '</li>';
294
- }
295
-
296
- echo '</ul>';
297
- ?>
298
-
299
- </div>
300
 
301
 
302
 
@@ -305,19 +354,6 @@ function meta_boxes_post_grid_side( $post ) {
305
  <div class="faq">
306
  <?php
307
 
308
- $video_tutorials = $class_post_grid_support->video_tutorials();
309
-
310
- echo '<ul>';
311
- foreach($video_tutorials as $item){
312
-
313
- echo '<li class="item">';
314
- echo '<a target="_blank" href="'.$item['answer_url'].'"><i class="far fa-dot-circle"></i> '.$item['question'].'</a>';
315
-
316
-
317
- echo '</li>';
318
-
319
- }
320
- echo '</ul>';
321
 
322
  ?>
323
 
255
  function meta_boxes_post_grid_side( $post ) {
256
 
257
  ?>
258
+ <div class="plugin-help-search">
259
+ <input type="search" value="" placeholder="Start typing">
260
+
261
+ <ul>
262
+
263
+ <?php
264
+ $class_post_grid_support = new class_post_grid_support();
265
+
266
+ $video_tutorials = $class_post_grid_support->video_tutorials();
267
+
268
+ foreach($video_tutorials as $item){
269
+ $url = isset($item['url']) ?$item['url'] : '';
270
+ $title = isset($item['title']) ?$item['title'] : '';
271
+ $keywords = isset($item['keywords']) ? $item['keywords'] : '';
272
+
273
+ ?>
274
+ <li keywords="<?php echo $keywords; ?>" class="item">
275
+ <a target="_blank" href="<?php echo $url; ?>"><i class="far fa-dot-circle"></i> <?php echo $title; ?></a>
276
+
277
+ </li>
278
+ <?php
279
+
280
+ }
281
+
282
+ ?>
283
+
284
+
285
+ </ul>
286
+ </div>
287
+
288
+
289
+
290
+ <style type="text/css">
291
+ .plugin-help-search{}
292
+ .plugin-help-search input[type=search]{
293
+ width: 100%;
294
+ }
295
+ </style>
296
+
297
+ <script>
298
+ jQuery(document).ready(function($){
299
+ jQuery(document).on('keyup', '.plugin-help-search input', function(){
300
+ keyword = jQuery(this).val().toLowerCase();
301
+ content_body = [];
302
+
303
+ console.log(keyword);
304
+
305
+ $('.plugin-help-search li').each(function( index ) {
306
+ $( this ).hide();
307
+ content = $( this ).text().toLowerCase();
308
+ content_body[index] = content;
309
+ n = content_body[index].indexOf(keyword);
310
+ if(n<0){
311
+ $( this ).hide();
312
+ }else{
313
+ $( this ).show();
314
+ }
315
+ });
316
+ })
317
+ })
318
+ </script>
319
+
320
+
321
+
322
+
323
  <div class="post-grid-meta-box">
324
 
325
+
326
+
327
+
328
+
329
+
330
  <ul>
331
  <li>Post Grid Version: <?php echo post_grid_version; ?></li>
332
  <li>Tested WP: 5.4</li>
346
 
347
  <a class="button" href="https://wordpress.org/support/plugin/post-grid/reviews/#new-post" target="_blank">Submit Reviews</a> <a class="button" href="https://wordpress.org/support/plugin/post-grid/#new-topic-0" target="_blank">Ask wordpress.org</a><p>We spent thousand+ hours to development on this plugin, please submit your reviews wisely.</p><p>If you have any issue with this plugin please submit our forums or contact our support first.</p><p class="description">Your feedback and reviews are most important things to keep our development on track. If you have time please submit us five star <a href="https://wordpress.org/support/plugin/post-grid/reviews/"><span style="color: orange"><i class="fas fa-star"></i><i class="fas fa-star"></i><i class="fas fa-star"></i><i class="fas fa-star"></i><i class="fas fa-star"></i></span></a> reviews.</p>
348
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
349
 
350
 
351
 
354
  <div class="faq">
355
  <?php
356
 
 
 
 
 
 
 
 
 
 
 
 
 
 
357
 
358
  ?>
359
 
post-grid.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Post Grid by PickPlugins
4
  Plugin URI: https://www.pickplugins.com/item/post-grid-create-awesome-grid-from-any-post-type-for-wordpress/
5
  Description: Awesome post grid for query post from any post type and display on grid.
6
- Version: 2.0.54
7
  Author: PickPlugins
8
  Author URI: https://www.pickplugins.com/
9
  License: GPLv2 or later
@@ -21,13 +21,14 @@ if( !class_exists( 'PostGrid' )){
21
  define('post_grid_plugin_dir', plugin_dir_path(__FILE__));
22
  define('post_grid_plugin_basename', plugin_basename(__FILE__));
23
  define('post_grid_plugin_name', 'Post Grid');
24
- define('post_grid_version', '2.0.54');
25
 
26
  include('includes/classes/class-post-types.php');
27
  include('includes/functions/functions-settings-hook.php');
28
  include('templates/post-grid-hook.php');
29
  include('includes/functions/post-grid-layout-elements.php');
30
  include('includes/functions/media-source-options.php');
 
31
 
32
 
33
  include('includes/class-metabox-post-grid-layout.php');
3
  Plugin Name: Post Grid by PickPlugins
4
  Plugin URI: https://www.pickplugins.com/item/post-grid-create-awesome-grid-from-any-post-type-for-wordpress/
5
  Description: Awesome post grid for query post from any post type and display on grid.
6
+ Version: 2.0.55
7
  Author: PickPlugins
8
  Author URI: https://www.pickplugins.com/
9
  License: GPLv2 or later
21
  define('post_grid_plugin_dir', plugin_dir_path(__FILE__));
22
  define('post_grid_plugin_basename', plugin_basename(__FILE__));
23
  define('post_grid_plugin_name', 'Post Grid');
24
+ define('post_grid_version', '2.0.55');
25
 
26
  include('includes/classes/class-post-types.php');
27
  include('includes/functions/functions-settings-hook.php');
28
  include('templates/post-grid-hook.php');
29
  include('includes/functions/post-grid-layout-elements.php');
30
  include('includes/functions/media-source-options.php');
31
+ include('includes/layout-elements/3rd-party.php');
32
 
33
 
34
  include('includes/class-metabox-post-grid-layout.php');
readme.txt CHANGED
@@ -4,7 +4,7 @@
4
  Tags: post grid, grid, custom post grid, post type grid, grid display, category filter, custom post, filter, filtering, grid, layout, list, masonry, post, post filter, post layout, taxonomy, taxonomy filter,
5
  Requires at least: 3.8
6
  Tested up to: 5.4
7
- Stable tag: 2.0.54
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -139,6 +139,19 @@ then paste this shortcode anywhere in your page to display grid<br />
139
 
140
  == Changelog ==
141
 
 
 
 
 
 
 
 
 
 
 
 
 
 
142
  = 2.0.54 =
143
  * 2020-05-4 optimize - optimize layout element CSS generate
144
  * 2020-05-4 fix - grid item text align issue fixed.
4
  Tags: post grid, grid, custom post grid, post type grid, grid display, category filter, custom post, filter, filtering, grid, layout, list, masonry, post, post filter, post layout, taxonomy, taxonomy filter,
5
  Requires at least: 3.8
6
  Tested up to: 5.4
7
+ Stable tag: 2.0.55
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
139
 
140
  == Changelog ==
141
 
142
+
143
+
144
+ = 2.0.55 =
145
+ * 2020-05-4 fix - remove empty read more text to avoid conflict old layout.
146
+ * 2020-05-15 add - Element added for "kk Star Ratings" plugin
147
+ * 2020-05-15 add - Element added for "Multi Rating" plugin
148
+ * 2020-05-15 add - Element added for "Rate my Post" plugin
149
+ * 2020-05-15 add - Element added for "Rating-Widget" plugin
150
+ * 2020-05-15 add - Element added for "WP-PostRatings" plugin
151
+ * 2020-05-15 add - Elements visitor votes, overall rating added for "Yasr – Yet Another Stars Rating" plugin
152
+ * 2020-05-15 add - Element added for "YITH - Add to Wishlist" plugin
153
+
154
+
155
  = 2.0.54 =
156
  * 2020-05-4 optimize - optimize layout element CSS generate
157
  * 2020-05-4 fix - grid item text align issue fixed.
templates/post-grid-hook.php CHANGED
@@ -16,9 +16,11 @@ function post_grid_main_lazy($atts){
16
  $lazy_load_image_src = isset($post_grid_options['lazy_load_image_src']) ? $post_grid_options['lazy_load_image_src'] : '';
17
 
18
 
 
19
  ?>
20
  <div id="post-grid-lazy-<?php echo $grid_id; ?>" class="post-grid-lazy"><img src="<?php echo $lazy_load_image_src; ?>"/></div>
21
  <script>
 
22
  jQuery('#post-grid-lazy-<?php echo $grid_id; ?>').ready(function($){
23
  jQuery('#post-grid-lazy-<?php echo $grid_id; ?>').fadeOut();
24
  jQuery('#post-grid-<?php echo $grid_id; ?>').fadeIn();
@@ -54,9 +56,22 @@ function post_grid_main_container($atts){
54
 
55
  wp_enqueue_style( 'post-grid-style' );
56
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
 
58
  ?>
59
- <div id="post-grid-<?php echo $grid_id; ?>" class="post-grid <?php echo $grid_type; ?>">
60
  <?php
61
  do_action('post_grid_container', $args);
62
  ?>
@@ -831,7 +846,6 @@ function post_grid_view_type_css_grid($args){
831
  <?php endif; ?>
832
  }
833
  #post-grid-<?php echo $grid_id; ?> .item .layer-media{
834
- overflow: hidden;
835
  <?php
836
  if($items_media_height_style == 'fixed_height' || $items_media_height_style == 'auto_height'){
837
  echo 'height:'.$items_media_height.';';
16
  $lazy_load_image_src = isset($post_grid_options['lazy_load_image_src']) ? $post_grid_options['lazy_load_image_src'] : '';
17
 
18
 
19
+
20
  ?>
21
  <div id="post-grid-lazy-<?php echo $grid_id; ?>" class="post-grid-lazy"><img src="<?php echo $lazy_load_image_src; ?>"/></div>
22
  <script>
23
+
24
  jQuery('#post-grid-lazy-<?php echo $grid_id; ?>').ready(function($){
25
  jQuery('#post-grid-lazy-<?php echo $grid_id; ?>').fadeOut();
26
  jQuery('#post-grid-<?php echo $grid_id; ?>').fadeIn();
56
 
57
  wp_enqueue_style( 'post-grid-style' );
58
 
59
+ $lazy_load_enable = isset($post_grid_options['lazy_load_enable']) ? $post_grid_options['lazy_load_enable'] : 'grid';
60
+ $masonry_enable = !empty($post_grid_options['masonry_enable']) ? $post_grid_options['masonry_enable'] : 'no';
61
+ $grid_type = isset($post_grid_options['grid_type']) ? $post_grid_options['grid_type'] : 'grid';
62
+
63
+ $post_grid_js_args = array(
64
+ 'id' => $grid_id,
65
+ 'lazy_load' => $lazy_load_enable,
66
+ 'masonry_enable' => $masonry_enable,
67
+ 'view_type' => $grid_type,
68
+ );
69
+
70
+ $post_grid_js_args = apply_filters('post_grid_js_args', $post_grid_js_args, $args);
71
+
72
 
73
  ?>
74
+ <div data-options='<?php echo json_encode($post_grid_js_args); ?>' id="post-grid-<?php echo $grid_id; ?>" class="post-grid <?php echo $grid_type; ?>">
75
  <?php
76
  do_action('post_grid_container', $args);
77
  ?>
846
  <?php endif; ?>
847
  }
848
  #post-grid-<?php echo $grid_id; ?> .item .layer-media{
 
849
  <?php
850
  if($items_media_height_style == 'fixed_height' || $items_media_height_style == 'auto_height'){
851
  echo 'height:'.$items_media_height.';';