Post Grid - Version 2.0.58

Version Description

  • 2020-05-19 add - Element added for "Like Button Rating" plugin
    • 2020-05-19 add - Element added for "WP-PostViews" plugin
    • 2020-05-19 add - Element added for "Post Views Counter" plugin
    • 2020-05-19 add - Element added for "Page Views Count" plugin
    • 2020-05-19 add - Element added for "Page Visit Counter" plugin
Download this release

Release Info

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

Code changes from version 2.0.57 to 2.0.58

Files changed (59) hide show
  1. assets/{frontend → admin}/css/images/ui-icons_444444_256x240.png +0 -0
  2. assets/{frontend → admin}/css/images/ui-icons_555555_256x240.png +0 -0
  3. assets/{frontend → admin}/css/images/ui-icons_777620_256x240.png +0 -0
  4. assets/{frontend → admin}/css/images/ui-icons_777777_256x240.png +0 -0
  5. assets/{frontend → admin}/css/images/ui-icons_cc0000_256x240.png +0 -0
  6. assets/{frontend → admin}/css/images/ui-icons_ffffff_256x240.png +0 -0
  7. assets/{frontend → admin}/css/jquery-ui.css +0 -0
  8. assets/admin/js/scripts.js +3 -3
  9. assets/frontend/css/icons/facebook.png +0 -0
  10. assets/frontend/css/icons/gplus.png +0 -0
  11. assets/frontend/css/icons/twitter.png +0 -0
  12. assets/frontend/css/search.png +0 -0
  13. assets/frontend/css/style.css +3 -36
  14. assets/frontend/{css/images → images}/placeholder.png +0 -0
  15. assets/global/js/flip.js +0 -273
  16. includes/class-functions.php +0 -4838
  17. includes/class-metabox-post-grid-layout.php +0 -186
  18. includes/class-post-grid-meta-box.php +0 -60
  19. includes/class-shortcodes.php +0 -90
  20. includes/classes/class-functions.php +314 -0
  21. includes/{class-license.php → classes/class-license.php} +0 -0
  22. includes/classes/class-meta-boxes.php +699 -0
  23. includes/{class-settings-tabs.php → classes/class-settings-tabs.php} +0 -0
  24. includes/{class-settings.php → classes/class-settings.php} +4 -4
  25. includes/classes/class-shortcodes.php +55 -0
  26. includes/functions-post-grid.php +70 -0
  27. includes/functions-single.php +55 -0
  28. includes/functions.php +5 -136
  29. includes/functions/functions-post-grid.php +0 -218
  30. includes/functions/post-grid-layout-elements.php +0 -2031
  31. includes/layout-elements/3rd-party.php +15 -7
  32. includes/layout-elements/likebtn-like-button/layout-elements.php +236 -0
  33. includes/layout-elements/page-views-count/layout-elements.php +252 -0
  34. includes/layout-elements/page-visit-counter/layout-elements.php +252 -0
  35. includes/layout-elements/post-views-counter/layout-elements.php +252 -0
  36. includes/layout-elements/wp-postviews/layout-elements.php +252 -0
  37. includes/{functions/media-source-options.php → media-source-options.php} +0 -0
  38. includes/menu/settings.php +16 -8
  39. includes/{functions/functions-post-grid-meta-box.php → metabox-post-grid-hook.php} +96 -94
  40. includes/{class-metabox-post-grid-layout-hook.php → metabox-post-grid-layout-hook.php} +0 -0
  41. includes/metabox-post-options-hook.php +242 -0
  42. includes/{functions-layout-hook.php → post-grid-layout-elements.php} +3289 -1351
  43. includes/post-grid-meta-box.php +0 -431
  44. includes/{functions/functions-settings-hook.php → settings-hook.php} +115 -0
  45. post-grid.php +20 -17
  46. readme.txt +34 -4
  47. templates/custom-css.php +0 -361
  48. templates/custom-js.php +0 -15
  49. templates/layer-content.php +0 -397
  50. templates/layer-media.php +0 -45
  51. templates/lazy.php +0 -26
  52. templates/nav-bottom.php +0 -226
  53. templates/nav-top.php +0 -310
  54. templates/post-grid-hook.php +11 -3
  55. templates/post-grid.php +0 -155
  56. templates/query.php +0 -113
  57. templates/scripts.php +0 -32
  58. templates/single/single-template-hook.php +85 -0
  59. templates/variables.php +0 -575
assets/{frontend → admin}/css/images/ui-icons_444444_256x240.png RENAMED
File without changes
assets/{frontend → admin}/css/images/ui-icons_555555_256x240.png RENAMED
File without changes
assets/{frontend → admin}/css/images/ui-icons_777620_256x240.png RENAMED
File without changes
assets/{frontend → admin}/css/images/ui-icons_777777_256x240.png RENAMED
File without changes
assets/{frontend → admin}/css/images/ui-icons_cc0000_256x240.png RENAMED
File without changes
assets/{frontend → admin}/css/images/ui-icons_ffffff_256x240.png RENAMED
File without changes
assets/{frontend → admin}/css/jquery-ui.css RENAMED
File without changes
assets/admin/js/scripts.js CHANGED
@@ -3,7 +3,7 @@ jQuery(document).ready(function($){
3
  width: '360px',
4
  allowClear: true
5
  });
6
- $(document).on('change', '#post_grid_metabox .select-layout-content', function(){
7
  var layout = $(this).val();
8
  jQuery.ajax({
9
  type: 'POST',
@@ -11,7 +11,7 @@ jQuery(document).ready(function($){
11
  data: {"action": "post_grid_layout_content_ajax","layout":layout},
12
  success: function(data){
13
  //jQuery(".layout-content").html(data);
14
- jQuery("#post_grid_metabox .layer-content").html(data);
15
 
16
  }
17
 
@@ -19,7 +19,7 @@ jQuery(document).ready(function($){
19
  })
20
 
21
 
22
- $(document).on('change', '#post_grid_metabox #post_types', function(){
23
  post_types = $(this).val();
24
  grid_id = $(this).attr('grid_id');
25
  html = '<i class="fas fa-spin fa-spinner"></i>';
3
  width: '360px',
4
  allowClear: true
5
  });
6
+ $(document).on('change', '#post-grid .select-layout-content', function(){
7
  var layout = $(this).val();
8
  jQuery.ajax({
9
  type: 'POST',
11
  data: {"action": "post_grid_layout_content_ajax","layout":layout},
12
  success: function(data){
13
  //jQuery(".layout-content").html(data);
14
+ jQuery("#post-grid .layer-content").html(data);
15
 
16
  }
17
 
19
  })
20
 
21
 
22
+ $(document).on('change', '#post-grid #post_types', function(){
23
  post_types = $(this).val();
24
  grid_id = $(this).attr('grid_id');
25
  html = '<i class="fas fa-spin fa-spinner"></i>';
assets/frontend/css/icons/facebook.png DELETED
Binary file
assets/frontend/css/icons/gplus.png DELETED
Binary file
assets/frontend/css/icons/twitter.png DELETED
Binary file
assets/frontend/css/search.png DELETED
Binary file
assets/frontend/css/style.css CHANGED
@@ -3,15 +3,11 @@
3
 
4
  .post-grid{
5
  overflow:hidden;
6
-
7
- }
8
-
9
-
10
  .post-grid .grid-items {
11
  margin: 0 auto;
12
  overflow: hidden;
13
  }
14
-
15
  .post-grid .item {
16
  background: rgb(255, 255, 255) none repeat scroll 0 0;
17
  display: inline-block;
@@ -20,37 +16,25 @@
20
  word-break: break-word;
21
  margin: 0 auto;
22
  }
23
-
24
  .post-grid .no-post-found {
25
- background: #fff none repeat scroll 0 0;
26
- color: #666;
27
  text-align: center;
 
28
  }
29
-
30
-
31
  .post-grid .item .layer-media {
32
  line-height: 0;
33
  }
34
-
35
  .post-grid .item .layer-media img {
36
  border-radius: 0;
37
  box-shadow: none;
38
  width: 100%;
39
  }
40
-
41
-
42
  .post-grid .item .layer-media iframe {
43
  width: 100% !important;
44
  height: auto;
45
  }
46
 
47
 
48
- .post-grid .owl-theme .owl-controls .owl-buttons div {
49
- background: rgb(28, 155, 236) none repeat scroll 0 0;
50
- }
51
-
52
-
53
-
54
  /*navigation top*/
55
 
56
  .post-grid .grid-nav-top {
@@ -58,23 +42,6 @@
58
  margin-bottom: 30px;
59
  }
60
 
61
- .post-grid .grid-nav-top .nav-filter {
62
- text-align: center;
63
- padding: 20px 0;
64
- }
65
- .post-grid .grid-nav-top .nav-filter .filter {
66
- background: rgba(220, 220, 220, 0.3) none repeat scroll 0 0;
67
- color: rgb(255, 255, 255);
68
- cursor: pointer;
69
- display: inline-block;
70
- font-size: 14px;
71
- margin: 5px 5px;
72
- padding: 3px 15px;
73
- }
74
-
75
- .post-grid .grid-nav-top .nav-filter .filter.active {
76
-
77
- }
78
 
79
  /*nav-search*/
80
  .post-grid .grid-nav-top .nav-search {
3
 
4
  .post-grid{
5
  overflow:hidden;
6
+ }
 
 
 
7
  .post-grid .grid-items {
8
  margin: 0 auto;
9
  overflow: hidden;
10
  }
 
11
  .post-grid .item {
12
  background: rgb(255, 255, 255) none repeat scroll 0 0;
13
  display: inline-block;
16
  word-break: break-word;
17
  margin: 0 auto;
18
  }
 
19
  .post-grid .no-post-found {
20
+ color: #999;
 
21
  text-align: center;
22
+ font-size: 18px;
23
  }
 
 
24
  .post-grid .item .layer-media {
25
  line-height: 0;
26
  }
 
27
  .post-grid .item .layer-media img {
28
  border-radius: 0;
29
  box-shadow: none;
30
  width: 100%;
31
  }
 
 
32
  .post-grid .item .layer-media iframe {
33
  width: 100% !important;
34
  height: auto;
35
  }
36
 
37
 
 
 
 
 
 
 
38
  /*navigation top*/
39
 
40
  .post-grid .grid-nav-top {
42
  margin-bottom: 30px;
43
  }
44
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
 
46
  /*nav-search*/
47
  .post-grid .grid-nav-top .nav-search {
assets/frontend/{css/images → images}/placeholder.png RENAMED
File without changes
assets/global/js/flip.js DELETED
@@ -1,273 +0,0 @@
1
- (function( $ ) {
2
- var flip = function($dom, callback) {
3
- $dom.data("flipped", true);
4
-
5
- var rotateAxis = "rotate" + $dom.data("axis");
6
- $dom.find($dom.data("front")).css({
7
- transform: rotateAxis + ($dom.data("reverse") ? "(-180deg)" : "(180deg)"),
8
- "z-index": "0"
9
- });
10
-
11
- $dom.find($dom.data("back")).css({
12
- transform: rotateAxis + "(0deg)",
13
- "z-index": "1"
14
- });
15
-
16
- //Providing a nicely wrapped up callback because transform is essentially async
17
- $dom.one(whichTransitionEvent(), function(){
18
- $(this).trigger('flip:done');
19
- if (callback !== undefined){
20
- callback.call(this);
21
- }
22
- });
23
- };
24
-
25
- var unflip = function($dom, callback) {
26
- $dom.data("flipped", false);
27
-
28
- var rotateAxis = "rotate" + $dom.data("axis");
29
- $dom.find($dom.data("front")).css({
30
- transform: rotateAxis + "(0deg)",
31
- "z-index": "1"
32
- });
33
-
34
- $dom.find($dom.data("back")).css({
35
- transform: rotateAxis + ($dom.data("reverse") ? "(180deg)" : "(-180deg)"),
36
- "z-index": "0"
37
- });
38
-
39
- //Providing a nicely wrapped up callback because transform is essentially async
40
- $dom.one(whichTransitionEvent(), function(){
41
- $(this).trigger('flip:done');
42
- if (callback !== undefined){
43
- callback.call(this);
44
- }
45
- });
46
- };
47
- // Function from David Walsh: http://davidwalsh.name/css-animation-callback licensed with http://opensource.org/licenses/MIT
48
- var whichTransitionEvent = function(){
49
- var t,
50
- el = document.createElement("fakeelement"),
51
- transitions = {
52
- "transition" : "transitionend",
53
- "OTransition" : "oTransitionEnd",
54
- "MozTransition" : "transitionend",
55
- "WebkitTransition": "webkitTransitionEnd"
56
- };
57
-
58
- for (t in transitions){
59
- if (el.style[t] !== undefined){
60
- return transitions[t];
61
- }
62
- }
63
- };
64
- $.fn.flip = function(options, callback) {
65
- if (typeof options == 'function'){
66
- //This allows flip to be called for setup with only a callback (default settings)
67
- callback = options;
68
- }
69
- this.each(function(){
70
- var $dom = $(this);
71
-
72
- if (options !== undefined && (typeof(options) == "boolean" || typeof(options) == "string")) { // Force flip the DOM
73
- if (options == "toggle"){
74
- options = !$dom.data("flipped");
75
- }
76
- if (options) {
77
- flip($dom,callback);
78
- } else {
79
- unflip($dom,callback);
80
- }
81
- // //Providing a nicely wrapped up callback because transform is essentially async
82
- // $(this).one(whichTransitionEvent(), function(){
83
- // $(this).trigger('flip:done');
84
- // if (callback !== undefined){
85
- // callback.call(this);
86
- // }
87
- // });
88
- } else if (!$dom.data("initiated")){ //Init flipable DOM
89
- $dom.data("initiated", true);
90
-
91
- var settings = $.extend({
92
- axis: "y",
93
- reverse: false,
94
- trigger: "click",
95
- speed: 500,
96
- forceHeight: false,
97
- forceWidth: false,
98
- autoSize: true,
99
- front: 'auto',
100
- back: 'auto'
101
- }, options );
102
-
103
- //By defualt we first check for the old front and back selectors for backward compatibility
104
- //if they arent there we fall back to auto selecting the first and second div
105
- if (settings.front == "auto"){
106
- settings.front = ($dom.find('.front').length > 0)? '.front' : 'div:first-child';
107
- }else if (settings.front == "autostrict"){
108
- settings.front = 'div:first-child';
109
- }
110
- if (settings.back == "auto"){
111
- //Note, we must use the old 'div:first-child + div' for IE compatibility
112
- settings.back = ($dom.find('.back').length > 0)? '.back' : 'div:first-child + div';
113
- }else if (settings.back == "autostrict"){
114
- settings.back = 'div:first-child + div';
115
- }
116
- // save reverse and axis css to DOM for performing flip
117
- $dom.data("reverse", settings.reverse);
118
- $dom.data("axis", settings.axis);
119
- $dom.data("front", settings.front);
120
- $dom.data("back", settings.back);
121
-
122
- var rotateAxis = "rotate" + (settings.axis.toLowerCase() == "x" ? "x" : "y"),
123
- perspective = $dom["outer" + (rotateAxis == "rotatex" ? "Height" : "Width")]() * 2;
124
-
125
- $dom.find($dom.data("back")).css({
126
- transform: rotateAxis + "(" + (settings.reverse? "180deg" : "-180deg") + ")"
127
- });
128
-
129
- $dom.css({
130
- perspective: perspective,
131
- position: "relative"
132
- });
133
-
134
- var speedInSec = settings.speed / 1000 || 0.5;
135
- var faces = $dom.find(settings.front).add(settings.back, $dom);
136
- if (settings.forceHeight) {faces.outerHeight($dom.height());} else if (settings.autoSize) {faces.css({'height': '100%'});}
137
- if (settings.forceWidth) {faces.outerWidth($dom.width());} else if (settings.autoSize) {faces.css({'width': '100%'});}
138
- faces.css({
139
- "backface-visibility": "hidden",
140
- "transform-style": "preserve-3d",
141
- position: "absolute",
142
- "z-index": "1"
143
- });
144
- faces.find('*').css({
145
- "backface-visibility": "hidden"
146
- });
147
- $dom.find($dom.data("back")).css({
148
- transform: rotateAxis + "(" + (settings.reverse? "180deg" : "-180deg") + ")",
149
- "z-index": "0"
150
- });
151
-
152
- // Back face always visible on Chrome #39
153
- if ((window.chrome || (window.Intl && Intl.v8BreakIterator)) && 'CSS' in window){
154
- //Blink Engine, add preserve-3d to $dom
155
- $dom.css({"-webkit-transform-style": "preserve-3d"});
156
- }
157
- // /#39
158
-
159
- // not forcing width/height may cause an initial flip to show up on
160
- // page load when we apply the style to reverse the backface...
161
- // To prevent this we first apply the basic styles and then give the
162
- // browser a moment to apply them. Only afterwards do we add the transition.
163
- setTimeout(function(){
164
- // By now the browser should have applied the styles, so the transition
165
- // will only affect subsequent flips.
166
- faces.css({
167
- transition: "all " + speedInSec + "s ease-out"
168
- });
169
- if (callback !== undefined){
170
- callback.call(this);
171
- }
172
- //While this used to work with a setTimeout of zero, at some point that became
173
- //unstable and the initial flip returned. The reason for this is unknown but we
174
- //will temporarily use a short delay of 20 to mitigate this issue.
175
- }, 20);
176
-
177
- if (settings.trigger.toLowerCase() == "click") {
178
- $dom.on($.fn.tap ? "tap" : "click", function(event) {
179
- if (!event) {event = window.event;}
180
- if ($dom.find($(event.target).closest('button, a, input[type="submit"]')).length) {
181
- return;
182
- }
183
-
184
- if ($dom.data("flipped")) {
185
- unflip($dom);
186
- } else {
187
- flip($dom);
188
- }
189
- });
190
- }
191
- else if (settings.trigger.toLowerCase() == "hover") {
192
- var performFlip = function() {
193
- $dom.unbind('mouseleave', performUnflip);
194
-
195
- flip($dom);
196
-
197
- setTimeout(function() {
198
- $dom.bind('mouseleave', performUnflip);
199
- if (!$dom.is(":hover")) {
200
- unflip($dom);
201
- }
202
- }, (settings.speed + 150));
203
- };
204
-
205
- var performUnflip = function() {
206
- unflip($dom);
207
- };
208
-
209
- $dom.mouseenter(performFlip);
210
- $dom.mouseleave(performUnflip);
211
- }
212
- }else{
213
- //The element has been initiated, all we have to do is change applicable settings
214
- if (options && (options.axis !== undefined || options.reverse !== undefined)){
215
- changeSettings.call(this,options,function(){
216
- $dom.trigger('flip:change');
217
- if (callback !== undefined){
218
- callback.call(this);
219
- }
220
- });
221
- }
222
- }
223
- });
224
-
225
- return this;
226
- };
227
- var changeSettings = function(options,callback){
228
- var changeNeeded = false;
229
- if (options.axis !== undefined && $(this).data("axis") != options.axis.toLowerCase()){
230
- $(this).data("axis", options.axis.toLowerCase());
231
- changeNeeded = true;
232
- }
233
- if (options.reverse !== undefined && $(this).data("reverse") != options.reverse){
234
- $(this).data("reverse", options.reverse);
235
- changeNeeded = true;
236
- }
237
- if (changeNeeded){
238
- var faces = $(this).find($(this).data("front")).add($(this).data("back"), $(this));
239
- var savedTrans = faces.css("transition");
240
- faces.css({
241
- transition: "none"
242
- });
243
- //Only setting the axis if it needs to be
244
-
245
- //options.axis = options.axis.toLowerCase();
246
- //$(this).data("axis", options.axis);
247
-
248
- //This sets up the first flip in the new direction automatically
249
- var rotateAxis = "rotate" + $(this).data("axis");
250
- if ($(this).data("flipped")){
251
- $(this).find($(this).data("front")).css({
252
- transform: rotateAxis + ($(this).data("reverse") ? "(-180deg)" : "(180deg)"),
253
- "z-index": "0"
254
- });
255
- }else{
256
- $(this).find($(this).data("back")).css({
257
- transform: rotateAxis + "(" + ($(this).data("reverse")? "180deg" : "-180deg") + ")",
258
- "z-index": "0"
259
- });
260
- }
261
- //Providing a nicely wrapped up callback because transform is essentially async
262
- setTimeout(function(){
263
- faces.css({
264
- transition: savedTrans
265
- });
266
- callback.call(this);
267
- }.bind(this),0);
268
- }else{
269
- //If we didnt have to set the axis we can just call back.
270
- setTimeout(callback.bind(this), 0);
271
- }
272
- };
273
- }( jQuery ));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/class-functions.php DELETED
@@ -1,4838 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * @Author pickplugins
5
- * Copyright: 2015 pickplugins.com
6
- */
7
-
8
- if ( ! defined('ABSPATH')) exit; // if direct access
9
-
10
- class class_post_grid_functions{
11
-
12
- public function __construct(){
13
-
14
-
15
- }
16
-
17
-
18
-
19
- public function load_more_text(){
20
-
21
- $load_more_text = apply_filters('post_grid_filter_load_more_text', __('Load more', 'post-grid'));
22
-
23
- return $load_more_text;
24
-
25
- }
26
-
27
-
28
-
29
-
30
-
31
-
32
-
33
- public function items_bg_color_values(){
34
-
35
- $color_values = array( '#ff398a',
36
- '#f992fb',
37
- '#eaca93',
38
- '#8ed379',
39
- '#8b67a5',
40
- '#f6b8ad',
41
- '#73d4b4',
42
- '#00c5cd',
43
- '#ff8247',
44
- '#ff6a6a',
45
- '#00ced1',
46
- '#ff7256',
47
- '#777777',
48
- '#067668',
49
- );
50
-
51
- $color_values = apply_filters('post_grid_filter_items_bg_color_values', $color_values);
52
-
53
- return $color_values;
54
-
55
-
56
- }
57
-
58
-
59
-
60
-
61
-
62
- public function media_source(){
63
-
64
- $media_source = array(
65
-
66
- 'featured_image' =>array('id'=>'featured_image','title'=>__('Featured Image', 'post-grid'),'checked'=>'yes'),
67
- 'first_image'=>array('id'=>'first_image','title'=>__('First images from content', 'post-grid'),'checked'=>'yes'),
68
- 'empty_thumb'=>array('id'=>'empty_thumb','title'=>__('Empty thumbnail', 'post-grid'),'checked'=>'yes'),
69
-
70
-
71
- );
72
-
73
- $media_source = apply_filters('post_grid_filter_media_source', $media_source);
74
-
75
- return $media_source;
76
-
77
-
78
- }
79
-
80
-
81
- public function layout_items(){
82
-
83
-
84
-
85
- $layout_items['general'] = array(
86
-
87
- 'name'=>'General',
88
- 'description'=>'Default WordPress items for post.',
89
- 'items'=>array(
90
-
91
- 'title'=>array(
92
- 'name'=>'Title',
93
- 'dummy_html'=>'Lorem Ipsum is simply.',
94
- 'css'=>'display: block;font-size: 21px;line-height: normal;padding: 5px 10px;text-align: left;',
95
- ),
96
-
97
- 'title_link'=>array(
98
- 'name'=>'Title with Link',
99
- 'dummy_html'=>'<a href="#">Lorem Ipsum is simply</a>',
100
- 'css'=>'display: block;font-size: 21px;line-height: normal;padding: 5px 10px;text-align: left;',
101
- ),
102
- 'content'=>array(
103
- 'name'=>'Content',
104
- 'dummy_html'=>'Lorem',
105
- 'css'=>'display: block;font-size: 13px;line-height: normal;padding: 5px 10px;text-align: left;',
106
- ),
107
- 'read_more'=>array(
108
- 'name'=>'Read more',
109
- 'dummy_html'=>'<a href="#">Read more</a>',
110
- 'css'=>'display: block;font-size: 13px;line-height: normal;padding: 5px 10px;text-align: left;',
111
- ),
112
- 'thumb'=>array(
113
- 'name'=>'Thumbnail',
114
- 'dummy_html'=>'<img style="width:100%;" src="'.post_grid_plugin_url.'assets/admin/images/thumb.png" />',
115
- 'css'=>'display: block;font-size: 13px;line-height: normal;padding: 5px 10px;text-align: left;',
116
- ),
117
- 'thumb_link'=>array(
118
- 'name'=>'Thumbnail with Link',
119
- 'dummy_html'=>'<a href="#"><img style="width:100%;" src="'.post_grid_plugin_url.'assets/admin/images/thumb.png" /></a>',
120
- 'css'=>'display: block;font-size: 13px;line-height: normal;padding: 5px 10px;text-align: left;',
121
- ),
122
- 'excerpt'=>array(
123
- 'name'=>'Excerpt',
124
- 'dummy_html'=>'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text',
125
- 'css'=>'display: block;font-size: 13px;line-height: normal;padding: 5px 10px;text-align: left;',
126
- ),
127
- 'excerpt_read_more'=>array(
128
- 'name'=>'Excerpt with Read more',
129
- 'dummy_html'=>'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text <a href="#">Read more</a>',
130
- 'css'=>'display: block;font-size: 13px;line-height: normal;padding: 5px 10px;text-align: left;',
131
- ),
132
- 'post_date'=>array(
133
- 'name'=>'Post date',
134
- 'dummy_html'=>'18/06/2015',
135
- 'css'=>'display: block;font-size: 13px;line-height: normal;padding: 5px 10px;text-align: left;',
136
- ),
137
- 'author'=>array(
138
- 'name'=>'Author',
139
- 'dummy_html'=>'PickPlugins',
140
- 'css'=>'display: block;font-size: 13px;line-height: normal;padding: 5px 10px;text-align: left;',
141
- ),
142
- 'author_link'=>array(
143
- 'name'=>'Author with Link',
144
- 'dummy_html'=>'Lorem',
145
- 'css'=>'display: block;font-size: 13px;line-height: normal;padding: 5px 10px;text-align: left;',
146
- ),
147
- 'categories'=>array(
148
- 'name'=>'Categories',
149
- 'dummy_html'=>'<a hidden="#">Category 1</a> <a hidden="#">Category 2</a>',
150
- 'css'=>'display: block;font-size: 13px;line-height: normal;padding: 5px 10px;text-align: left;',
151
- ),
152
- 'tags'=>array(
153
- 'name'=>'Tags',
154
- 'dummy_html'=>'<a hidden="#">Tags 1</a> <a hidden="#">Tags 2</a>',
155
- 'css'=>'display: block;font-size: 13px;line-height: normal;padding: 5px 10px;text-align: left;',
156
- ),
157
- 'comments_count'=>array(
158
- 'name'=>'Comments Count',
159
- 'dummy_html'=>'3 Comments',
160
- 'css'=>'display: block;font-size: 13px;line-height: normal;padding: 5px 10px;text-align: left;',
161
- ),
162
- 'comments'=>array(
163
- 'name'=>'Comments',
164
- 'dummy_html'=>'Lorem',
165
- 'css'=>'display: block;font-size: 13px;line-height: normal;padding: 5px 10px;text-align: left;',
166
- ),
167
- 'rating_widget'=>array(
168
- 'name'=>'Rating-Widget: Star Review System',
169
- 'dummy_html'=>'Lorem',
170
- 'css'=>'display: block;font-size: 13px;line-height: normal;padding: 5px 10px;text-align: left;',
171
- ),
172
- 'share_button'=>array(
173
- 'name'=>'Share button',
174
- 'dummy_html'=>'<i class="fa fa-facebook-square"></i> <i class="fa fa-twitter-square"></i> <i class="fa fa-google-plus-square"></i>',
175
- 'css'=>'display: block;font-size: 13px;line-height: normal;padding: 5px 10px;text-align: left;',
176
- ),
177
-
178
- 'hr'=>array(
179
- 'name'=>'Horizontal line',
180
- 'dummy_html'=>'<hr />',
181
- 'css'=>'display: block;font-size: 13px;line-height: normal;padding: 5px 10px;text-align: left;',
182
- ),
183
-
184
- 'five_star'=>array(
185
- 'name'=>'Five star',
186
- 'dummy_html'=>'Star',
187
- 'css'=>'display: block;font-size: 13px;line-height: normal;padding: 5px 10px;text-align: left;',
188
- ),
189
-
190
-
191
- ),
192
-
193
- );
194
-
195
-
196
- $layout_items = apply_filters('post_grid_filter_layout_items', $layout_items);
197
-
198
- return $layout_items;
199
- }
200
-
201
-
202
- public function layout_content_list(){
203
-
204
- $layout_content_list = array(
205
-
206
- 'flat'=>array(
207
- '0'=>array('key'=>'title_link', 'char_limit'=>'20', 'name'=>'Title with linked', 'css'=>'display: block;font-size: 21px;line-height: normal;padding: 5px 10px;text-align: left; text-decoration: none;', 'css_hover'=>'', ),
208
- '1'=>array('key'=>'excerpt', 'char_limit'=>'20', 'name'=>'Excerpt', 'css'=>'display: block;font-size: 14px;padding: 5px 10px;text-align: left;', 'css_hover'=>''),
209
- '2'=>array('key'=>'read_more', 'name'=>'Read more', 'css'=>'display: block;font-size: 12px;font-weight: bold;padding: 0 10px;text-align: left;text-decoration: none;', 'css_hover'=>''),
210
-
211
- ),
212
-
213
- 'flat-center'=>array(
214
- '0'=>array('key'=>'title_link', 'char_limit'=>'20', 'name'=>'Title with linked', 'css'=>'display: block;font-size: 21px;line-height: normal;padding: 5px 10px;text-align: center;text-decoration: none;', 'css_hover'=>''),
215
- '1'=>array('key'=>'excerpt', 'char_limit'=>'20', 'name'=>'Excerpt', 'css'=>'display: block;font-size: 14px;padding: 5px 10px;text-align: center;', 'css_hover'=>''),
216
- '2'=>array('key'=>'read_more', 'name'=>'Read more', 'css'=>'display: block;font-size: 12px;font-weight: bold;padding: 0 10px;text-align: center;', 'css_hover'=>''),
217
-
218
- ),
219
-
220
- 'flat-right'=>array(
221
- '0'=>array('key'=>'title_link', 'char_limit'=>'20', 'name'=>'Title with linked', 'css'=>'display: block;font-size: 21px;line-height: normal;padding: 5px 10px;text-align: right;text-decoration: none;', 'css_hover'=>''),
222
- '1'=>array('key'=>'excerpt', 'char_limit'=>'20', 'name'=>'Excerpt', 'css'=>'display: block;font-size: 14px;padding: 5px 10px;text-align: right;', 'css_hover'=>''),
223
- '2'=>array('key'=>'read_more', 'name'=>'Read more', 'css'=>'display: block;font-size: 12px;font-weight: bold;padding: 0 10px;text-align: right;', 'css_hover'=>''),
224
- ),
225
-
226
- 'flat-left'=>array(
227
- '0'=>array('key'=>'title_link', 'char_limit'=>'20', 'name'=>'Title with linked', 'css'=>'display: block;font-size: 21px;line-height: normal;padding: 5px 10px;text-align: left;text-decoration: none;', 'css_hover'=>''),
228
-
229
- '1'=>array('key'=>'excerpt', 'char_limit'=>'20', 'name'=>'Excerpt', 'css'=>'display: block;font-size: 14px;padding: 5px 10px;text-align: left;', 'css_hover'=>''),
230
- '2'=>array('key'=>'read_more', 'name'=>'Read more', 'css'=>'display: block;font-size: 12px;font-weight: bold;padding: 0 10px;text-align: left;', 'css_hover'=>'')
231
- ),
232
-
233
- 'wc-center-price'=>array(
234
- '0'=>array('key'=>'title_link', 'char_limit'=>'20', 'name'=>'Title with linked', 'css'=>'display: block;font-size: 21px;line-height: normal;padding: 5px 10px;text-align: center;text-decoration: none;', 'css_hover'=>''),
235
- '1'=>array('key'=>'wc_full_price', 'name'=>'Price', 'css'=>'background:#f9b013;color:#fff;display: inline-block;font-size: 20px;line-height:normal;padding: 0 17px;text-align: center;', 'css_hover'=>''),
236
- '2'=>array('key'=>'excerpt', 'char_limit'=>'20', 'name'=>'Excerpt', 'css'=>'display: block;font-size: 14px;padding: 5px 10px;text-align: center;', 'css_hover'=>''),
237
- ),
238
-
239
- 'wc-center-cart'=>array(
240
- '0'=>array('key'=>'title_link', 'char_limit'=>'20', 'name'=>'Title with linked', 'css'=>'display: block;font-size: 21px;line-height: normal;padding: 5px 10px;text-align: center;text-decoration: none;', 'css_hover'=>''),
241
- '1'=>array('key'=>'wc_gallery', 'name'=>'Add to Cart', 'css'=>'color:#555;display: inline-block;font-size: 13px;line-height:normal;padding: 0 17px;text-align: center;', 'css_hover'=>''),
242
-
243
- '2'=>array('key'=>'excerpt', 'char_limit'=>'20', 'name'=>'Excerpt', 'css'=>'display: block;font-size: 14px;padding: 5px 10px;text-align: center;', 'css_hover'=>''),
244
- ),
245
-
246
- );
247
-
248
- $layout_content_list = apply_filters('post_grid_filter_layout_content_list', $layout_content_list);
249
-
250
-
251
- return $layout_content_list;
252
- }
253
-
254
-
255
-
256
- public function layout_content($layout){
257
-
258
- $layout_content = $this->layout_content_list();
259
-
260
- return $layout_content[$layout];
261
- }
262
-
263
-
264
-
265
- public function layout_hover_list(){
266
-
267
- $layout_hover_list = array(
268
-
269
-
270
- 'flat'=>array(
271
-
272
- 'read_more'=>array('name'=>'Read more', 'css'=>'display: block;font-size: 12px;font-weight: bold;padding: 0 10px;text-align: center;')
273
- ),
274
- 'flat-center'=>array(
275
-
276
- 'read_more'=>array('name'=>'Read more', 'css'=>'display: block;font-size: 12px;font-weight: bold;padding: 0 10px;text-align: center;')
277
- ),
278
-
279
-
280
- );
281
-
282
- $layout_hover_list = apply_filters('post_grid_filter_layout_hover_list', $layout_hover_list);
283
-
284
-
285
- return $layout_hover_list;
286
- }
287
-
288
-
289
-
290
- public function layout_hover($layout){
291
-
292
- $layout_hover = $this->layout_hover_list();
293
-
294
- return $layout_hover[$layout];
295
- }
296
-
297
-
298
-
299
-
300
- public function skins(){
301
-
302
- $skins = array(
303
-
304
-
305
-
306
- 'flat'=> array(
307
- 'slug'=>'flat',
308
- 'name'=>'Flat',
309
- 'thumb_url'=>'',
310
- ),
311
- 'flip-x'=> array(
312
- 'slug'=>'flip-x',
313
- 'name'=>'Flip-x',
314
- 'thumb_url'=>'',
315
- ),
316
- 'spinright'=>array(
317
- 'slug'=>'spinright',
318
- 'name'=>'SpinRight',
319
- 'thumb_url'=>'',
320
- ),
321
- 'thumbgoleft'=>array(
322
- 'slug'=>'thumbgoleft',
323
- 'name'=>'ThumbGoLeft',
324
- 'thumb_url'=>'',
325
- ),
326
- 'thumbrounded'=>array(
327
- 'slug'=>'thumbrounded',
328
- 'name'=>'ThumbRounded',
329
- 'thumb_url'=>'',
330
- ),
331
- 'contentbottom'=>array(
332
- 'slug'=>'contentbottom',
333
- 'name'=>'ContentBottom',
334
- 'thumb_url'=>'',
335
- ),
336
-
337
-
338
-
339
-
340
-
341
- );
342
-
343
- $skins = apply_filters('post_grid_filter_skins', $skins);
344
-
345
- return $skins;
346
-
347
- }
348
-
349
-
350
-
351
-
352
-
353
- public function skin_elements(){
354
-
355
-
356
- $layout_items['general'] = array(
357
-
358
- 'name'=>'General',
359
- 'description'=>'Default WordPress items for post.',
360
- 'items'=>array(
361
-
362
- 'post_title' => array(
363
- 'name' => 'Post title',
364
- 'dummy_html'=>'Post title goes here.',
365
- ),
366
-
367
- 'post_excerpt' => array(
368
- 'name' => 'Post excerpt',
369
- 'dummy_html'=>'Dummy post excerpt goes here.',
370
- ),
371
-
372
- 'post_content' => array(
373
- 'name' => 'Post content',
374
- 'dummy_html'=>'Dummy post content goes here. this text will take extra length.',
375
- ),
376
-
377
- 'read_more'=>array(
378
- 'name'=>'Read more',
379
- 'dummy_html'=>'<a href="">Read more</a>',
380
- ),
381
-
382
- 'featured_image'=>array(
383
- 'name'=>'Featured image',
384
- 'dummy_html'=>'<img style="width:100%" src="'.post_grid_plugin_url.'assets/admin/images/thumb.png" />',
385
- ),
386
-
387
- 'media'=>array(
388
- 'name'=>'Media',
389
- 'dummy_html'=>'<img style="width:100%" src="'.post_grid_plugin_url.'assets/admin/images/thumb.png" />',
390
- ),
391
-
392
-
393
- 'post_date'=>array(
394
- 'name'=>'Post date',
395
- 'dummy_html'=>'18/06/2015',
396
-
397
- ),
398
- 'post_author'=>array(
399
- 'name'=>'Author',
400
- 'dummy_html'=>'Author name',
401
- ),
402
-
403
- 'post_author_avatar'=>array(
404
- 'name'=>'Author avatar',
405
- 'dummy_html'=>'Author avatar',
406
- ),
407
-
408
- 'category'=>array(
409
- 'name'=>'Post categories',
410
- 'dummy_html'=>'<a href="#">Category 1</a> <a href="#">Category 2</a>',
411
- ),
412
- 'post_tag'=>array(
413
- 'name'=>'Post tags',
414
- 'dummy_html'=>'<a href="#">Tag 1</a> <a href="#">tag 2</a>',
415
- ),
416
- 'comments_count'=>array(
417
- 'name'=>'Comments count',
418
- 'dummy_html'=>'2 Comments',
419
- ),
420
- 'comments'=>array(
421
- 'name'=>'Post comments',
422
- 'dummy_html'=>'List of comments',
423
- ),
424
-
425
- 'meta_key'=>array(
426
- 'name'=>'Meta Key',
427
- 'dummy_html'=>'Meta value goes here',
428
-
429
- ),
430
-
431
- 'custom_taxonomy'=>array(
432
- 'name'=>'Custom taxonomy',
433
- 'dummy_html'=>'<a href="#">Terms 1</a> <a href="#">Terms 2</a>',
434
-
435
- ),
436
-
437
- 'hr'=>array(
438
- 'name'=>'Horizontal line',
439
- 'dummy_html'=>'<hr/>',
440
-
441
- ),
442
- 'html'=>array(
443
- 'name'=>'HTML',
444
- 'dummy_html'=>'Custom HTML goes here',
445
- ),
446
-
447
- ),
448
-
449
- );
450
-
451
-
452
-
453
-
454
-
455
-
456
-
457
-
458
-
459
-
460
-
461
- $layout_items['woocommerce'] = array(
462
-
463
- 'name'=>'WooCommerce (In Pro)',
464
- 'description'=>'WooCommerce items.',
465
- 'items'=>array(
466
-
467
- 'wc_full_price'=>array(
468
- 'name'=>'Product full price',
469
- 'dummy_html'=>'$45 <del>$50</del>',
470
- ),
471
-
472
- 'wc_regular_price'=>array(
473
- 'name'=>'Product regular price',
474
- 'dummy_html'=>'$45',
475
- ),
476
-
477
- 'wc_sale_price'=>array(
478
- 'name'=>'Product sale price',
479
- 'dummy_html'=>'$45',
480
- ),
481
-
482
- 'wc_gallery'=>array(
483
- 'name'=>'Product gallery',
484
- 'dummy_html'=>'',
485
- ),
486
-
487
-
488
- 'wc_add_to_cart'=>array(
489
- 'name'=>'Add to cart',
490
- 'dummy_html'=>'Add to cart',
491
- ),
492
- 'wc_rating_star'=>array(
493
- 'name'=>'Product star rating',
494
- 'dummy_html'=>'<i class="fa fa-star" aria-hidden="true"></i> <i class="fa fa-star" aria-hidden="true"></i> <i class="fa fa-star" aria-hidden="true"></i> <i class="fa fa-star" aria-hidden="true"></i> <i class="fa fa-star" aria-hidden="true"></i>',
495
- ),
496
- 'wc_rating_text'=>array(
497
- 'name'=>'Product text rating',
498
- 'dummy_html'=>'4.5 out of 5',
499
- ),
500
- 'wc_categories'=>array(
501
- 'name'=>'Product categories',
502
- 'dummy_html'=>'<a href="#">Category 1</a> <a href="#">Category 2</a>',
503
- ),
504
- 'wc_tags'=>array(
505
- 'name'=>'Product tags',
506
- 'dummy_html'=>'<a href="#">Tag 1</a> <a href="#">Tag 2</a>',
507
- ),
508
- 'wc_sku'=>array(
509
- 'name'=>'Product SKU',
510
- 'dummy_html'=>'product_sku',
511
- ),
512
-
513
- 'wc_cat_thumbnail'=>array(
514
- 'name'=>'Category thumbnail',
515
- 'dummy_html'=>'<img style="width:50px; height:50px" src="'.post_grid_plugin_url.'assets/admin/images/thumb.png" />',
516
- ),
517
- 'wc_cat_description'=>array(
518
- 'name'=>'Category description',
519
- 'dummy_html'=>'This is simple dummy text for category description.',
520
- ),
521
-
522
- ),
523
-
524
- );
525
-
526
- $layout_items['edd'] = array(
527
-
528
- 'name'=>'Easy Digital Downloads (in Pro)',
529
- 'description'=>'Easy Digital Downloads items.',
530
- 'items'=>array(
531
-
532
- 'edd_price'=>array(
533
- 'name'=>'Download Price',
534
- 'dummy_html'=>'$45 <del>$50</del>',
535
- ),
536
- 'edd_variable_prices'=>array(
537
- 'name'=>'Download variable prices',
538
- 'dummy_html'=>'$45 <del>$50</del>',
539
- ),
540
- 'edd_sales_stats'=>array(
541
- 'name'=>'Download sales stats',
542
- 'dummy_html'=>'Sale stats',
543
-
544
- ),
545
- 'edd_earnings_stats'=>array(
546
- 'name'=>'Download earnings stats',
547
- 'dummy_html'=>'earnings stats',
548
- ),
549
- 'edd_add_to_cart'=>array(
550
- 'name'=>'EDD Add to Cart',
551
- 'dummy_html'=>'Add to Cart',
552
- ),
553
- 'edd_rating_star'=>array(
554
- 'name'=>'Download star rating',
555
- 'dummy_html'=>'<i class="fa fa-star" aria-hidden="true"></i> <i class="fa fa-star" aria-hidden="true"></i> <i class="fa fa-star" aria-hidden="true"></i> <i class="fa fa-star" aria-hidden="true"></i> <i class="fa fa-star" aria-hidden="true"></i>',
556
- ),
557
- 'edd_rating_text'=>array(
558
- 'name'=>'Download text rating',
559
- 'dummy_html'=>'3.5 out of 5',
560
- ),
561
- 'edd_categories'=>array(
562
- 'name'=>'Download Categories',
563
- 'dummy_html'=>'<a href="#">Category 1</a> <a href="#">Category 2</a>',
564
- ),
565
- 'edd_tags'=>array(
566
- 'name'=>'Download tags',
567
- 'dummy_html'=>'<a href="#">Tag 1</a> <a href="#">Tag 2</a>',
568
- ),
569
-
570
- )
571
-
572
- );
573
-
574
-
575
-
576
-
577
-
578
-
579
- $layout_items['WPeC'] = array(
580
-
581
- 'name'=>'WP eCommerce',
582
- 'description'=>'WP eCommerce items.',
583
- 'items'=>array(
584
-
585
- 'WPeC_old_price'=>array(
586
- 'name'=>'WPeC Old Price',
587
- 'dummy_html'=>'<del>$50</del>',
588
-
589
- ),
590
- 'WPeC_sale_price'=>array(
591
- 'name'=>'WPeC Sale Price',
592
- 'dummy_html'=>'$45',
593
- ),
594
- 'WPeC_add_to_cart'=>array(
595
- 'name'=>'WPeC Add to Cart',
596
- 'dummy_html'=>'Add to Cart',
597
- ),
598
- 'WPeC_rating_star'=>array(
599
- 'name'=>'WPeC Star Rating',
600
- 'dummy_html'=>'<i class="fa fa-star" aria-hidden="true"></i> <i class="fa fa-star" aria-hidden="true"></i> <i class="fa fa-star" aria-hidden="true"></i> <i class="fa fa-star" aria-hidden="true"></i> <i class="fa fa-star" aria-hidden="true"></i>',
601
- ),
602
- )
603
-
604
- );
605
-
606
-
607
-
608
-
609
-
610
- $layout_items['the_events_calendar'] = array(
611
-
612
- 'name'=>'The Events Calendar',
613
- 'description'=>'The Events Calendar items.',
614
- 'items'=>array(
615
-
616
- 'tec_event_cat'=>array(
617
- 'name'=>'Event categories',
618
- 'dummy_html'=>'',
619
- ),
620
-
621
- 'tec_event_tag'=>array(
622
- 'name'=>'Event tags',
623
- 'dummy_html'=>'',
624
- ),
625
-
626
- 'tec_EventStartDate'=>array(
627
- 'name'=>'Event start date',
628
- 'dummy_html'=>'',
629
- ),
630
-
631
- 'tec_EventEndDate'=>array(
632
- 'name'=>'Event end date',
633
- 'dummy_html'=>'',
634
- ),
635
-
636
- 'tec_EventURL'=>array(
637
- 'name'=>'Event URL',
638
- 'dummy_html'=>'',
639
- ),
640
-
641
-
642
- 'tec_EventCost'=>array(
643
- 'name'=>'Event cost',
644
- 'dummy_html'=>'',
645
- ),
646
-
647
- 'tec_venue_address'=>array(
648
- 'name'=>'Venue address',
649
- 'dummy_html'=>'',
650
- ),
651
-
652
- 'tec_venue_city'=>array(
653
- 'name'=>'Venue city',
654
- 'dummy_html'=>'',
655
- ),
656
-
657
- 'tec_venue_country'=>array(
658
- 'name'=>'Venue country',
659
- 'dummy_html'=>'',
660
- ),
661
- 'tec_venue_province'=>array(
662
- 'name'=>'Venue province',
663
- 'dummy_html'=>'',
664
- ),
665
- 'tec_venue_zip'=>array(
666
- 'name'=>'Venue zip',
667
- 'dummy_html'=>'',
668
- ),
669
-
670
- 'tec_venue_phone'=>array(
671
- 'name'=>'Venue phone',
672
- 'dummy_html'=>'',
673
- ),
674
- 'tec_venue_url'=>array(
675
- 'name'=>'Venue URL',
676
- 'dummy_html'=>'',
677
- ),
678
-
679
-
680
- 'tec_venue_map'=>array(
681
- 'name'=>'Venue Map',
682
- 'dummy_html'=>'',
683
- ),
684
-
685
- 'tec_organizer_phone'=>array(
686
- 'name'=>'Organizer Phone',
687
- 'dummy_html'=>'',
688
- ),
689
- 'tec_organizer_website'=>array(
690
- 'name'=>'Organizer Website',
691
- 'dummy_html'=>'',
692
- ),
693
-
694
- 'tec_organizer_email'=>array(
695
- 'name'=>'Organizer Email',
696
- 'dummy_html'=>'',
697
- ),
698
-
699
-
700
-
701
-
702
-
703
-
704
-
705
- )
706
- );
707
-
708
-
709
-
710
-
711
-
712
- $layout_items['events_manager'] = array(
713
-
714
- 'name'=>'Events Manager',
715
- 'description'=>'Events Manager items.',
716
- 'items'=>array(
717
-
718
- 'em_event_cat'=>array(
719
- 'name'=>'Event categories',
720
- 'dummy_html'=>'',
721
- ),
722
-
723
- 'em_event_tag'=>array(
724
- 'name'=>'Event tags',
725
- 'dummy_html'=>'',
726
- ),
727
-
728
-
729
- 'em_event_start_date'=>array(
730
- 'name'=>'Event start date',
731
- 'dummy_html'=>'2018-01-24',
732
- ),
733
- 'em_event_end_date'=>array(
734
- 'name'=>'Event end date',
735
- 'dummy_html'=>'2018-01-24',
736
- ),
737
-
738
- 'em_event_start_time'=>array(
739
- 'name'=>'Event start time',
740
- 'dummy_html'=>'01:45:00',
741
- ),
742
-
743
- 'em_event_end_time'=>array(
744
- 'name'=>'Event end time',
745
- 'dummy_html'=>'01:45:00',
746
- ),
747
-
748
-
749
-
750
-
751
- 'em_event_spaces'=>array(
752
- 'name'=>'Event spaces',
753
- 'dummy_html'=>'',
754
- ),
755
-
756
-
757
- /*
758
- * 'em_event_rsvp'=>array(
759
- 'name'=>'Max spaces per booking',
760
- 'dummy_html'=>'',
761
- ),
762
- * */
763
-
764
- 'em_event_rsvp_spaces'=>array(
765
- 'name'=>'Max Spaces',
766
- 'dummy_html'=>'',
767
- ),
768
-
769
-
770
- 'em_event_rsvp_date'=>array(
771
- 'name'=>'Cut-Off Date',
772
- 'dummy_html'=>'',
773
- ),
774
-
775
- 'em_event_rsvp_time'=>array(
776
- 'name'=>'Cut-Off Time',
777
- 'dummy_html'=>'',
778
- ),
779
- /*
780
- *
781
- *
782
- 'em_location_name'=>array(
783
- 'name'=>'Location name',
784
- 'dummy_html'=>'',
785
- ),
786
-
787
- 'em_location_address'=>array(
788
- 'name'=>'Location address',
789
- 'dummy_html'=>'',
790
- ),
791
-
792
- 'location_town'=>array(
793
- 'name'=>'Location town',
794
- 'dummy_html'=>'',
795
- ),
796
-
797
- 'location_state'=>array(
798
- 'name'=>'Location state',
799
- 'dummy_html'=>'',
800
- ),
801
-
802
- 'location_postcode'=>array(
803
- 'name'=>'Location postcode',
804
- 'dummy_html'=>'',
805
- ),
806
-
807
- 'location_region'=>array(
808
- 'name'=>'Location region',
809
- 'dummy_html'=>'',
810
- ),
811
-
812
- 'location_country'=>array(
813
- 'name'=>'Location country',
814
- 'dummy_html'=>'',
815
- ),
816
- *
817
- * */
818
-
819
-
820
-
821
-
822
- )
823
-
824
- );
825
-
826
-
827
-
828
-
829
- $layout_items['acf'] = array(
830
-
831
- 'name'=>'Advanced Custom Fields',
832
- 'description'=>'Advanced Custom Fields items.',
833
- 'items'=>array(
834
-
835
- //'zoom'=>'Zoom button',
836
- 'acf_text'=>array(
837
- 'name'=>'ACF - Text',
838
- 'dummy_html'=>'',
839
- ),
840
-
841
- 'acf_textarea'=>array(
842
- 'name'=>'ACF - Textarea',
843
- 'dummy_html'=>'',
844
- ),
845
-
846
- 'acf_number'=>array(
847
- 'name'=>'ACF - Number',
848
- 'dummy_html'=>'',
849
- ),
850
-
851
- 'acf_email'=>array(
852
- 'name'=>'ACF - Email',
853
- 'dummy_html'=>'',
854
- ),
855
-
856
-
857
- 'acf_wysiwyg'=>array(
858
- 'name'=>'Acf - Wysiwyg',
859
- 'dummy_html'=>'',
860
- ),
861
-
862
- 'acf_image'=>array(
863
- 'name'=>'Acf - Image',
864
- 'dummy_html'=>'',
865
- ),
866
-
867
- 'acf_file'=>array(
868
- 'name'=>'Acf - File',
869
- 'dummy_html'=>'',
870
- ),
871
-
872
- 'acf_select'=>array(
873
- 'name'=>'Acf - Select',
874
- 'dummy_html'=>'',
875
- ),
876
- 'acf_checkbox'=>array(
877
- 'name'=>'Acf - Checkbox',
878
- 'dummy_html'=>'',
879
- ),
880
-
881
-
882
-
883
- 'acf_page_link'=>array(
884
- 'name'=>'Acf - Page link',
885
- 'dummy_html'=>'',
886
- ),
887
-
888
- /*
889
- *
890
- * 'acf_post_object'=>array(
891
- 'name'=>'Acf - Post object',
892
- 'dummy_html'=>'',
893
- ),
894
- *
895
- * */
896
-
897
- 'acf_taxonomy'=>array(
898
- 'name'=>'Acf - Taxonomy',
899
- 'dummy_html'=>'',
900
- ),
901
-
902
-
903
- 'acf_user'=>array(
904
- 'name'=>'Acf - User',
905
- 'dummy_html'=>'',
906
- ),
907
-
908
- /*
909
- *
910
- * 'acf_google_map'=>array(
911
- 'name'=>'Acf - Google map',
912
- 'dummy_html'=>'',
913
- ),
914
- * */
915
-
916
-
917
- 'acf_date_picker'=>array(
918
- 'name'=>'Acf - Date Picker',
919
- 'dummy_html'=>'',
920
- ),
921
-
922
-
923
-
924
-
925
-
926
-
927
-
928
-
929
-
930
-
931
- )
932
-
933
- );
934
-
935
-
936
-
937
-
938
-
939
- $layout_items['others'] = array(
940
-
941
- 'name'=>'Others',
942
- 'description'=>'Others items.',
943
- 'items'=>array(
944
-
945
- //'zoom'=>'Zoom button',
946
- 'share_button'=>array(
947
- 'name'=>'Share button',
948
- 'dummy_html'=>'<a href="#"><i class="fa fa-facebook-square" aria-hidden="true"></i></a> <a href="#"><i class="fa fa-twitter-square" aria-hidden="true"></i></a> <a href="#"><i class="fa fa-google-plus-square" aria-hidden="true"></i></a>',
949
- ),
950
-
951
-
952
-
953
-
954
-
955
- 'five_star'=>array(
956
- 'name'=>'Five Star',
957
- 'dummy_html'=>'<i class="fa fa-star" aria-hidden="true"></i> <i class="fa fa-star" aria-hidden="true"></i> <i class="fa fa-star" aria-hidden="true"></i> <i class="fa fa-star" aria-hidden="true"></i> <i class="fa fa-star" aria-hidden="true"></i>',
958
- ),
959
-
960
- 'yith_add_to_wishlist'=>array(
961
- 'name'=>'YITH - Add to Wishlist',
962
- 'dummy_html'=>'Add to Wishlist',
963
- ),
964
-
965
- )
966
-
967
- );
968
-
969
-
970
-
971
- return $layout_items;
972
- }
973
-
974
-
975
- public function media_source2(){
976
-
977
- $media_source = array(
978
-
979
- 'featured_image' =>array(
980
- 'title'=>__('Featured Image', 'post-grid'),
981
- 'options'=>array(
982
- 'size'=> array('title'=>'Featured image size', 'type'=>'select', 'args'=>post_grid_intermediate_image_sizes(), 'value'=>'medium'),
983
- 'link_to'=> array('title'=>'Link to', 'type'=>'select', 'args'=>array('none'=>'None','post_link'=>'Post link','post_meta'=>'Post meta'), 'value'=>'post_link'),
984
- 'meta_key'=>array('title'=>'Meta key','placeholder'=>'my_meta_key', 'type'=>'text','value'=>''),
985
- ),
986
- ),
987
- 'first_image'=>array(
988
- 'title'=>__('First images from content', 'post-grid'),
989
- 'options'=>array(
990
- 'link_to'=> array('title'=>'Link to', 'type'=>'select', 'args'=>array('none'=>'None','post_link'=>'Post link','post_meta'=>'Post meta'), 'value'=>'post_link'),
991
- 'meta_key'=>array('title'=>'Meta key', 'placeholder'=>'my_meta_key', 'type'=>'text','value'=>''),
992
- ),
993
- ),
994
- 'first_gallery'=>array(
995
- 'title'=>__('First gallery from content', 'post-grid'),
996
- 'options'=>array(
997
-
998
- ),
999
- ),
1000
- 'first_youtube'=>array(
1001
- 'title'=>__('First youtube video from content', 'post-grid'),
1002
- 'options'=>array(
1003
-
1004
- ),
1005
- ),
1006
- 'custom_youtube'=>array(
1007
- 'title'=>__('Custom youtube video', 'post-grid'),
1008
- 'options'=>array(
1009
-
1010
- ),
1011
- ),
1012
- 'first_vimeo'=>array(
1013
- 'title'=>__('First vimeo video from content', 'post-grid'),
1014
- 'options'=>array(
1015
-
1016
- ),
1017
- ),
1018
- 'custom_vimeo'=>array(
1019
- 'title'=>__('Custom vimeo video', 'post-grid'),
1020
- 'options'=>array(
1021
-
1022
- ),
1023
- ),
1024
- 'first_dailymotion'=>array(
1025
- 'title'=>__('First dailymotion video from content', 'post-grid'),
1026
- 'options'=>array(
1027
-
1028
- ),
1029
- ),
1030
- 'custom_dailymotion'=>array(
1031
- 'title'=>__('Custom dailymotion video', 'post-grid'),
1032
- 'options'=>array(
1033
-
1034
- ),
1035
- ),
1036
- 'first_mp3'=>array(
1037
- 'title'=>__('First MP3 from content', 'post-grid'),
1038
- 'options'=>array(
1039
-
1040
- ),
1041
- ),
1042
- 'custom_mp3'=>array(
1043
- 'title'=>__('Custom MP3', 'post-grid'),
1044
- 'options'=>array(
1045
-
1046
- ),
1047
- ),
1048
- 'first_soundcloud'=>array(
1049
- 'title'=>__('First SoundCloud from content', 'post-grid'),
1050
- 'options'=>array(
1051
-
1052
- ),
1053
- ),
1054
- 'custom_soundcloud'=>array(
1055
- 'title'=>__('Custom SoundCloud', 'post-grid'),
1056
- 'options'=>array(
1057
-
1058
- ),
1059
- ),
1060
- 'empty_thumb'=>array(
1061
- 'title'=>__('Empty thumbnail', 'post-grid'),
1062
- 'options'=>array(
1063
- 'thumb_src'=>array('title'=>'Thumbnail src', 'placeholder'=>'Thumbnail source url', 'type'=>'text','value'=>''),
1064
- 'link_to'=> array('title'=>'Link to', 'type'=>'select', 'args'=>array('none'=>'None','post_link'=>'Post link','post_meta'=>'Post meta'), 'value'=>'post_link'),
1065
- 'meta_key'=>array('title'=>'Meta key', 'placeholder'=>'my_meta_key', 'type'=>'text','value'=>''),
1066
-
1067
- ),
1068
-
1069
- ),
1070
- 'custom_thumb'=>array(
1071
- 'title'=>__('Custom Thumbnail', 'post-grid'),
1072
- 'options'=>array(
1073
- 'link_to'=> array('title'=>'Link to', 'type'=>'select', 'args'=>array('none'=>'None','post_link'=>'Post link','post_meta'=>'Post meta'), 'value'=>'post_link'),
1074
- 'meta_key'=>array('title'=>'Meta key', 'placeholder'=>'my_meta_key', 'type'=>'text','value'=>''),
1075
-
1076
- ),
1077
-
1078
- ),
1079
- 'font_awesome'=>array(
1080
- 'title'=>__('Font Awesome', 'post-grid'),
1081
- 'options'=>array(
1082
-
1083
- 'font_size'=>array( 'placeholder'=>'15px', 'type'=>'text','value'=>'40px'),
1084
- 'color'=>array('title'=>'Color', 'placeholder'=>'#ffffff', 'type'=>'color','value'=>'#dddddd'),
1085
- 'link_to'=> array('title'=>'Link to', 'type'=>'select', 'args'=>array('none'=>'None','post_link'=>'Post link','post_meta'=>'Post meta'), 'value'=>'post_link'),
1086
- 'meta_key'=>array('title'=>'Meta key', 'placeholder'=>'my_meta_key', 'type'=>'text','value'=>''),
1087
- ),
1088
-
1089
- ),
1090
-
1091
-
1092
- );
1093
-
1094
- $media_source = apply_filters('post_grid_filter_media_source', $media_source);
1095
-
1096
- return $media_source;
1097
-
1098
-
1099
- }
1100
-
1101
-
1102
-
1103
-
1104
- public function skin_elements_data(){
1105
-
1106
-
1107
-
1108
- $elements_data['post_title'] = array(
1109
- 'key' => 'post_title',
1110
-
1111
- 'options'=>array(
1112
- 'wrapper_tag'=>'',
1113
- 'custom_class'=>'',
1114
- 'limit_by'=>'',
1115
- 'limit_count'=>'',
1116
- 'is_linked'=>'',
1117
- 'linked_to'=>'',
1118
- 'linked_to_post_meta'=>'',
1119
- 'linked_to_taxonomy'=>'',
1120
- ),
1121
-
1122
- 'style_idle'=>array(
1123
- 'fontSize'=>'13px',
1124
- 'lineHeight'=>'',
1125
- 'color'=>array('hex8'=>'#000000'),
1126
- 'backgroundColor'=>array('hex8'=>'#ffffff'),
1127
- 'fontFamily'=> '',
1128
- 'fontWeight'=> '',
1129
- 'textDecoration'=> '',
1130
- 'fontStyle'=> '',
1131
- 'textTransform'=> '',
1132
- 'position'=>'',
1133
- 'display'=> '',
1134
- 'float'=> '',
1135
- 'clear'=> '',
1136
- 'margin'=>'',
1137
- 'padding'=>'',
1138
- 'cursor'=> '',
1139
- 'textAlign'=> '',
1140
- 'top'=>'',
1141
- 'bottom'=>'',
1142
- 'left'=>'',
1143
- 'right'=>'',
1144
- 'height'=>'',
1145
- 'width'=>'',
1146
- 'zIndex'=>'',
1147
- 'transform'=>'',
1148
- 'transition'=>'',
1149
- 'opacity'=>'',
1150
- 'custom_css'=>'',
1151
- ),
1152
- 'style_hover'=>array(
1153
- 'fontSize'=>'',
1154
- 'lineHeight'=>'',
1155
- 'color'=>array('hex8'=>'#000000'),
1156
- 'backgroundColor'=>array('hex8'=>'#000000'),
1157
- 'fontFamily'=> '',
1158
- 'fontWeight'=> '',
1159
- 'textDecoration'=> '',
1160
- 'fontStyle'=> '',
1161
- 'textTransform'=> '',
1162
- 'position'=>'',
1163
- 'display'=> '',
1164
- 'float'=> '',
1165
- 'clear'=> '',
1166
- 'margin'=>'',
1167
- 'padding'=>'',
1168
- 'textAlign'=> '',
1169
- 'top'=>'',
1170
- 'bottom'=>'',
1171
- 'left'=>'',
1172
- 'right'=>'',
1173
- 'height'=>'',
1174
- 'width'=>'',
1175
- 'zIndex'=>'',
1176
- 'transform'=>'',
1177
- 'transition'=>'',
1178
- 'opacity'=>'',
1179
- 'custom_css'=>'',
1180
- ),
1181
-
1182
-
1183
-
1184
- );
1185
-
1186
-
1187
- $elements_data['post_excerpt'] = array(
1188
-
1189
- 'key' => 'post_excerpt',
1190
- 'options'=>array(
1191
- 'wrapper_tag'=>'',
1192
- 'custom_class'=>'',
1193
- 'limit_by'=>'',
1194
- 'limit_count'=>'',
1195
- 'end_text_display'=>'',
1196
- 'end_text'=>'',
1197
- 'keep_html'=>'',
1198
- 'shortcode_enable'=>'',
1199
- ),
1200
- 'style_idle'=>array(
1201
-
1202
- 'fontSize'=>'',
1203
- 'lineHeight'=>'',
1204
- 'color'=>array('hex8'=>'#000000'),
1205
- 'backgroundColor'=>array('hex8'=>'#000000'),
1206
- 'fontFamily'=> '',
1207
- 'fontWeight'=> '',
1208
- 'textDecoration'=> '',
1209
- 'fontStyle'=> '',
1210
- 'textTransform'=> '',
1211
- 'textAlign'=> '',
1212
- 'position'=>'',
1213
- 'display'=> '',
1214
- 'float'=> '',
1215
- 'clear'=> '',
1216
- 'margin'=>'',
1217
- 'padding'=>'',
1218
- 'top'=>'',
1219
- 'bottom'=>'',
1220
- 'left'=>'',
1221
- 'right'=>'',
1222
- 'height'=>'',
1223
- 'width'=>'',
1224
- 'zIndex'=>'',
1225
- 'transform'=>'',
1226
- 'transition'=>'',
1227
- 'opacity'=>'',
1228
- 'custom_css'=>'',
1229
-
1230
-
1231
-
1232
- ),
1233
- 'style_hover'=>array(
1234
-
1235
- 'enable'=> 'no',
1236
- 'fontSize'=>'',
1237
- 'lineHeight'=>'',
1238
- 'color'=>array('hex8'=>'#000000'),
1239
- 'backgroundColor'=>array('hex8'=>'#000000'),
1240
- 'fontFamily'=> '',
1241
- 'fontWeight'=> '',
1242
- 'textDecoration'=> '',
1243
- 'fontStyle'=> '',
1244
- 'textTransform'=> '',
1245
- 'textAlign'=> '',
1246
- 'position'=>'',
1247
- 'display'=> '',
1248
- 'float'=> '',
1249
- 'clear'=> '',
1250
- 'margin'=>'',
1251
- 'padding'=>'',
1252
- 'top'=>'',
1253
- 'bottom'=>'',
1254
- 'left'=>'',
1255
- 'right'=>'',
1256
- 'height'=>'',
1257
- 'width'=>'',
1258
- 'zIndex'=>'',
1259
- 'transform'=>'',
1260
- 'transition'=>'',
1261
- 'opacity'=>'',
1262
- 'custom_css'=>'',
1263
- ),
1264
-
1265
-
1266
- );
1267
-
1268
-
1269
-
1270
- $elements_data['post_content'] = array(
1271
-
1272
- 'key' => 'post_content',
1273
- 'options'=>array(
1274
- 'wrapper_tag'=>'',
1275
- 'custom_class'=>'',
1276
-
1277
-
1278
- ),
1279
- 'style_idle'=>array(
1280
- 'fontSize'=>'',
1281
- 'lineHeight'=>'',
1282
- 'color'=>array('hex8'=>'#000000'),
1283
- 'backgroundColor'=>array('hex8'=>'#000000'),
1284
- 'fontFamily'=> '',
1285
- 'fontWeight'=> '',
1286
- 'textDecoration'=> '',
1287
- 'fontStyle'=> '',
1288
- 'textTransform'=> '',
1289
- 'textAlign'=> '',
1290
- 'position'=>'',
1291
- 'display'=> '',
1292
- 'float'=> '',
1293
- 'clear'=> '',
1294
- 'margin'=>'',
1295
- 'padding'=>'',
1296
- 'top'=>'',
1297
- 'bottom'=>'',
1298
- 'left'=>'',
1299
- 'right'=>'',
1300
- 'height'=>'',
1301
- 'width'=>'',
1302
- 'zIndex'=>'',
1303
- 'transform'=>'',
1304
- 'transition'=>'',
1305
- 'opacity'=>'',
1306
- 'custom_css'=>'',
1307
- ),
1308
-
1309
- 'style_hover'=>array(
1310
-
1311
- 'enable'=> 'no',
1312
- 'fontSize'=>'',
1313
- 'lineHeight'=>'',
1314
- 'color'=>array('hex8'=>'#000000'),
1315
- 'backgroundColor'=>array('hex8'=>'#000000'),
1316
- 'fontFamily'=> '',
1317
- 'fontWeight'=> '',
1318
- 'textDecoration'=> '',
1319
- 'fontStyle'=> '',
1320
- 'textTransform'=> '',
1321
- 'textAlign'=> '',
1322
- 'position'=>'',
1323
- 'display'=> '',
1324
- 'float'=> '',
1325
- 'clear'=> '',
1326
- 'margin'=>'',
1327
- 'padding'=>'',
1328
- 'top'=>'',
1329
- 'bottom'=>'',
1330
- 'left'=>'',
1331
- 'right'=>'',
1332
- 'height'=>'',
1333
- 'width'=>'',
1334
- 'zIndex'=>'',
1335
- 'transform'=>'',
1336
- 'transition'=>'',
1337
- 'opacity'=>'',
1338
- 'custom_css'=>'',
1339
- ),
1340
-
1341
-
1342
-
1343
- );
1344
-
1345
-
1346
- $elements_data['read_more'] = array(
1347
-
1348
- 'key' => 'read_more',
1349
-
1350
- 'options'=>array(
1351
- 'read_more_text'=>'',
1352
- 'custom_class'=>'',
1353
- 'is_linked'=>'',
1354
- 'linked_to'=>'',
1355
- 'linked_to_post_meta'=>'',
1356
- 'linked_to_taxonomy'=>'',
1357
- ),
1358
-
1359
- 'style_idle'=>array(
1360
- 'fontSize'=>'',
1361
- 'lineHeight'=>'',
1362
- 'color'=>array('hex8'=>'#000000'),
1363
- 'backgroundColor'=>array('hex8'=>'#000000'),
1364
- 'fontFamily'=> '',
1365
- 'fontWeight'=> '',
1366
- 'textDecoration'=> '',
1367
- 'fontStyle'=> '',
1368
- 'textTransform'=> '',
1369
- 'textAlign'=> '',
1370
- 'position'=>'',
1371
- 'display'=> '',
1372
- 'float'=> '',
1373
- 'clear'=> '',
1374
- 'margin'=>'',
1375
- 'padding'=>'',
1376
- 'top'=>'',
1377
- 'bottom'=>'',
1378
- 'left'=>'',
1379
- 'right'=>'',
1380
- 'height'=>'',
1381
- 'width'=>'',
1382
- 'zIndex'=>'',
1383
- 'transform'=>'',
1384
- 'transition'=>'',
1385
- 'opacity'=>'',
1386
- 'custom_css'=>'',
1387
-
1388
-
1389
- ),
1390
-
1391
- 'style_hover'=>array(
1392
- 'enable'=> 'no',
1393
- 'fontSize'=>'',
1394
- 'lineHeight'=>'',
1395
- 'color'=>array('hex8'=>'#000000'),
1396
- 'backgroundColor'=>array('hex8'=>'#000000'),
1397
- 'fontFamily'=> '',
1398
- 'fontWeight'=> '',
1399
- 'textDecoration'=> '',
1400
- 'fontStyle'=> '',
1401
- 'textTransform'=> '',
1402
- 'textAlign'=> '',
1403
- 'position'=>'',
1404
- 'display'=> '',
1405
- 'float'=> '',
1406
- 'clear'=> '',
1407
- 'margin'=>'',
1408
- 'padding'=>'',
1409
- 'top'=>'',
1410
- 'bottom'=>'',
1411
- 'left'=>'',
1412
- 'right'=>'',
1413
- 'height'=>'',
1414
- 'width'=>'',
1415
- 'zIndex'=>'',
1416
- 'transform'=>'',
1417
- 'transition'=>'',
1418
- 'opacity'=>'',
1419
- 'custom_css'=>'',
1420
- ),
1421
-
1422
-
1423
-
1424
- );
1425
-
1426
-
1427
-
1428
- $elements_data['featured_image'] = array(
1429
-
1430
- 'key' => 'featured_image',
1431
- 'options'=>array(
1432
- 'custom_class'=>'',
1433
- 'image_size'=>'',
1434
- 'featured_image_src'=>'',
1435
- 'image_src_meta_key'=>'',
1436
- 'is_linked'=>'',
1437
- 'linked_to'=>'',
1438
- 'linked_to_post_meta'=>'',
1439
- 'linked_to_taxonomy'=>'',
1440
-
1441
- ),
1442
-
1443
- 'style_idle'=>array(
1444
-
1445
- 'filter'=> '',
1446
- 'position'=>'',
1447
- 'display'=> '',
1448
- 'float'=> '',
1449
- 'clear'=> '',
1450
- 'margin'=>'',
1451
- 'padding'=>'',
1452
- 'top'=>'',
1453
- 'bottom'=>'',
1454
- 'left'=>'',
1455
- 'right'=>'',
1456
- 'height'=>'',
1457
- 'width'=>'',
1458
- 'zIndex'=>'',
1459
- 'transform'=>'',
1460
- 'transition'=>'',
1461
- 'opacity'=>'',
1462
- 'custom_css'=>'',
1463
-
1464
- ),
1465
-
1466
- 'style_hover'=>array(
1467
-
1468
- 'enable'=> 'no',
1469
-
1470
- 'position'=>'',
1471
- 'display'=> '',
1472
- 'float'=> '',
1473
- 'clear'=> '',
1474
- 'margin'=>'',
1475
- 'padding'=>'',
1476
- 'top'=>'',
1477
- 'bottom'=>'',
1478
- 'left'=>'',
1479
- 'right'=>'',
1480
- 'height'=>'',
1481
- 'width'=>'',
1482
- 'zIndex'=>'',
1483
- 'transform'=>'',
1484
- 'transition'=>'',
1485
- 'opacity'=>'',
1486
- 'custom_css'=>'',
1487
-
1488
- ),
1489
-
1490
-
1491
-
1492
-
1493
-
1494
- );
1495
-
1496
-
1497
-
1498
- $elements_data['post_author_avatar'] = array(
1499
-
1500
- 'key' => 'post_author_avatar',
1501
- 'options'=>array(
1502
- 'image_size'=>'',
1503
- 'custom_class'=>'',
1504
- 'is_linked'=>'',
1505
- 'linked_to'=>'',
1506
- ),
1507
-
1508
- 'style_idle'=>array(
1509
-
1510
- 'filter'=> '',
1511
- 'position'=>'',
1512
- 'display'=> '',
1513
- 'float'=> '',
1514
- 'clear'=> '',
1515
- 'margin'=>'',
1516
- 'padding'=>'',
1517
- 'top'=>'',
1518
- 'bottom'=>'',
1519
- 'left'=>'',
1520
- 'right'=>'',
1521
- 'height'=>'',
1522
- 'width'=>'',
1523
- 'zIndex'=>'',
1524
- 'transform'=>'',
1525
- 'transition'=>'',
1526
- 'opacity'=>'',
1527
- 'custom_css'=>'',
1528
-
1529
- ),
1530
-
1531
- 'style_hover'=>array(
1532
-
1533
- 'enable'=> 'no',
1534
-
1535
- 'position'=>'',
1536
- 'display'=> '',
1537
- 'float'=> '',
1538
- 'clear'=> '',
1539
- 'margin'=>'',
1540
- 'padding'=>'',
1541
- 'top'=>'',
1542
- 'bottom'=>'',
1543
- 'left'=>'',
1544
- 'right'=>'',
1545
- 'height'=>'',
1546
- 'width'=>'',
1547
- 'zIndex'=>'',
1548
- 'transform'=>'',
1549
- 'transition'=>'',
1550
- 'opacity'=>'',
1551
- 'custom_css'=>'',
1552
-
1553
- ),
1554
-
1555
- );
1556
-
1557
-
1558
- $elements_data['post_date'] = array(
1559
-
1560
- 'key' => 'post_date',
1561
- 'options'=>array(
1562
- 'date_format'=>'',
1563
- 'custom_class'=>'',
1564
- 'is_linked'=>'',
1565
- 'linked_to'=>'',
1566
- 'linked_to_post_meta'=>'',
1567
- 'linked_to_taxonomy'=>'',
1568
-
1569
- ),
1570
-
1571
- 'style_idle'=>array(
1572
-
1573
- 'fontSize'=>'',
1574
- 'lineHeight'=>'',
1575
- 'color'=>array('hex8'=>'#000000'),
1576
- 'backgroundColor'=>array('hex8'=>'#000000'),
1577
- 'fontFamily'=> '',
1578
- 'fontWeight'=> '',
1579
- 'textDecoration'=> '',
1580
- 'fontStyle'=> '',
1581
- 'textTransform'=> '',
1582
- 'textAlign'=> '',
1583
- 'position'=>'',
1584
- 'display'=> '',
1585
- 'float'=> '',
1586
- 'clear'=> '',
1587
- 'margin'=>'',
1588
- 'padding'=>'',
1589
- 'top'=>'',
1590
- 'bottom'=>'',
1591
- 'left'=>'',
1592
- 'right'=>'',
1593
- 'height'=>'',
1594
- 'width'=>'',
1595
- 'zIndex'=>'',
1596
- 'transform'=>'',
1597
- 'transition'=>'',
1598
- 'opacity'=>'',
1599
- 'custom_css'=>'',
1600
-
1601
- ),
1602
-
1603
-
1604
- 'style_hover'=>array(
1605
-
1606
- 'enable'=> 'no',
1607
-
1608
- 'fontSize'=>'',
1609
- 'lineHeight'=>'',
1610
- 'color'=>array('hex8'=>'#000000'),
1611
- 'backgroundColor'=>array('hex8'=>'#000000'),
1612
- 'fontFamily'=> '',
1613
- 'fontWeight'=> '',
1614
- 'textDecoration'=> '',
1615
- 'fontStyle'=> '',
1616
- 'textTransform'=> '',
1617
- 'textAlign'=> '',
1618
- 'position'=>'',
1619
- 'display'=> '',
1620
- 'float'=> '',
1621
- 'clear'=> '',
1622
- 'margin'=>'',
1623
- 'padding'=>'',
1624
- 'top'=>'',
1625
- 'bottom'=>'',
1626
- 'left'=>'',
1627
- 'right'=>'',
1628
- 'height'=>'',
1629
- 'width'=>'',
1630
- 'zIndex'=>'',
1631
- 'transform'=>'',
1632
- 'transition'=>'',
1633
- 'opacity'=>'',
1634
- 'custom_css'=>'',
1635
-
1636
- ),
1637
-
1638
-
1639
- );
1640
-
1641
-
1642
-
1643
- $elements_data['post_author'] = array(
1644
-
1645
- 'key' => 'post_author',
1646
- 'options'=>array(
1647
- 'author_name'=>'',
1648
- 'custom_class'=>'',
1649
- 'is_linked'=>'',
1650
- 'linked_to'=>'',
1651
- 'linked_to_post_meta'=>'',
1652
- 'linked_to_taxonomy'=>'',
1653
-
1654
- ),
1655
-
1656
- 'style_idle'=>array(
1657
-
1658
- 'fontSize'=>'',
1659
- 'lineHeight'=>'',
1660
- 'color'=>array('hex8'=>'#000000'),
1661
- 'backgroundColor'=>array('hex8'=>'#000000'),
1662
- 'fontFamily'=> '',
1663
- 'fontWeight'=> '',
1664
- 'textDecoration'=> '',
1665
- 'fontStyle'=> '',
1666
- 'textTransform'=> '',
1667
- 'textAlign'=> '',
1668
- 'position'=>'',
1669
- 'display'=> '',
1670
- 'float'=> '',
1671
- 'clear'=> '',
1672
- 'margin'=>'',
1673
- 'padding'=>'',
1674
- 'top'=>'',
1675
- 'bottom'=>'',
1676
- 'left'=>'',
1677
- 'right'=>'',
1678
- 'height'=>'',
1679
- 'width'=>'',
1680
- 'zIndex'=>'',
1681
- 'transform'=>'',
1682
- 'transition'=>'',
1683
- 'opacity'=>'',
1684
- 'custom_css'=>'',
1685
-
1686
- ),
1687
-
1688
- 'style_hover'=>array(
1689
-
1690
- 'enable'=> 'no',
1691
-
1692
- 'fontSize'=>'',
1693
- 'lineHeight'=>'',
1694
- 'color'=>array('hex8'=>'#000000'),
1695
- 'backgroundColor'=>array('hex8'=>'#000000'),
1696
- 'fontFamily'=> '',
1697
- 'fontWeight'=> '',
1698
- 'textDecoration'=> '',
1699
- 'fontStyle'=> '',
1700
- 'textTransform'=> '',
1701
- 'textAlign'=> '',
1702
- 'position'=>'',
1703
- 'display'=> '',
1704
- 'float'=> '',
1705
- 'clear'=> '',
1706
- 'margin'=>'',
1707
- 'padding'=>'',
1708
- 'top'=>'',
1709
- 'bottom'=>'',
1710
- 'left'=>'',
1711
- 'right'=>'',
1712
- 'height'=>'',
1713
- 'width'=>'',
1714
- 'zIndex'=>'',
1715
- 'transform'=>'',
1716
- 'transition'=>'',
1717
- 'opacity'=>'',
1718
- 'custom_css'=>'',
1719
-
1720
- ),
1721
-
1722
-
1723
- );
1724
-
1725
-
1726
-
1727
- $elements_data['category'] = array(
1728
-
1729
- 'key' => 'category',
1730
- 'options'=>array(
1731
-
1732
- 'custom_class'=>'',
1733
- 'is_linked'=>'',
1734
- 'max_limit'=>'',
1735
- 'separator'=>'',
1736
- ),
1737
-
1738
-
1739
- 'style_idle'=>array(
1740
-
1741
- 'fontSize'=>'',
1742
- 'lineHeight'=>'',
1743
- 'color'=>array('hex8'=>'#000000'),
1744
- 'backgroundColor'=>array('hex8'=>'#000000'),
1745
- 'fontFamily'=> '',
1746
- 'fontWeight'=> '',
1747
- 'textDecoration'=> '',
1748
- 'fontStyle'=> '',
1749
- 'textTransform'=> '',
1750
- 'textAlign'=> '',
1751
- 'position'=>'',
1752
- 'display'=> '',
1753
- 'float'=> '',
1754
- 'clear'=> '',
1755
- 'margin'=>'',
1756
- 'padding'=>'',
1757
- 'top'=>'',
1758
- 'bottom'=>'',
1759
- 'left'=>'',
1760
- 'right'=>'',
1761
- 'height'=>'',
1762
- 'width'=>'',
1763
- 'zIndex'=>'',
1764
- 'transform'=>'',
1765
- 'transition'=>'',
1766
- 'opacity'=>'',
1767
- 'custom_css'=>'',
1768
-
1769
- ),
1770
- 'style_hover'=>array(
1771
-
1772
- 'enable'=> 'no',
1773
-
1774
- 'fontSize'=>'',
1775
- 'lineHeight'=>'',
1776
- 'color'=>array('hex8'=>'#000000'),
1777
- 'backgroundColor'=>array('hex8'=>'#000000'),
1778
- 'fontFamily'=> '',
1779
- 'fontWeight'=> '',
1780
- 'textDecoration'=> '',
1781
- 'fontStyle'=> '',
1782
- 'textTransform'=> '',
1783
- 'textAlign'=> '',
1784
- 'position'=>'',
1785
- 'display'=> '',
1786
- 'float'=> '',
1787
- 'clear'=> '',
1788
- 'margin'=>'',
1789
- 'padding'=>'',
1790
- 'top'=>'',
1791
- 'bottom'=>'',
1792
- 'left'=>'',
1793
- 'right'=>'',
1794
- 'height'=>'',
1795
- 'width'=>'',
1796
- 'zIndex'=>'',
1797
- 'transform'=>'',
1798
- 'transition'=>'',
1799
- 'opacity'=>'',
1800
- 'custom_css'=>'',
1801
-
1802
- ),
1803
-
1804
-
1805
-
1806
-
1807
-
1808
-
1809
-
1810
- );
1811
-
1812
-
1813
-
1814
- $elements_data['post_tag'] = array(
1815
- 'key' => 'post_tag',
1816
- 'options'=>array(
1817
-
1818
- 'custom_class'=>'',
1819
- 'is_linked'=>'',
1820
- 'max_limit'=>'',
1821
- 'separator'=>'',
1822
- ),
1823
-
1824
- 'style_idle'=>array(
1825
-
1826
- 'fontSize'=>'',
1827
- 'lineHeight'=>'',
1828
- 'color'=>array('hex8'=>'#000000'),
1829
- 'backgroundColor'=>array('hex8'=>'#000000'),
1830
- 'fontFamily'=> '',
1831
- 'fontWeight'=> '',
1832
- 'textDecoration'=> '',
1833
- 'fontStyle'=> '',
1834
- 'textTransform'=> '',
1835
- 'textAlign'=> '',
1836
- 'position'=>'',
1837
- 'display'=> '',
1838
- 'float'=> '',
1839
- 'clear'=> '',
1840
- 'margin'=>'',
1841
- 'padding'=>'',
1842
- 'top'=>'',
1843
- 'bottom'=>'',
1844
- 'left'=>'',
1845
- 'right'=>'',
1846
- 'height'=>'',
1847
- 'width'=>'',
1848
- 'zIndex'=>'',
1849
- 'transform'=>'',
1850
- 'transition'=>'',
1851
- 'opacity'=>'',
1852
- 'custom_css'=>'',
1853
-
1854
-
1855
-
1856
- ),
1857
- 'style_hover'=>array(
1858
-
1859
- 'enable'=> 'no',
1860
-
1861
- 'fontSize'=>'',
1862
- 'lineHeight'=>'',
1863
- 'color'=>array('hex8'=>'#000000'),
1864
- 'backgroundColor'=>array('hex8'=>'#000000'),
1865
- 'fontFamily'=> '',
1866
- 'fontWeight'=> '',
1867
- 'textDecoration'=> '',
1868
- 'fontStyle'=> '',
1869
- 'textTransform'=> '',
1870
- 'textAlign'=> '',
1871
- 'position'=>'',
1872
- 'display'=> '',
1873
- 'float'=> '',
1874
- 'clear'=> '',
1875
- 'margin'=>'',
1876
- 'padding'=>'',
1877
- 'top'=>'',
1878
- 'bottom'=>'',
1879
- 'left'=>'',
1880
- 'right'=>'',
1881
- 'height'=>'',
1882
- 'width'=>'',
1883
- 'zIndex'=>'',
1884
- 'transform'=>'',
1885
- 'transition'=>'',
1886
- 'opacity'=>'',
1887
- 'custom_css'=>'',
1888
-
1889
- ),
1890
-
1891
-
1892
- );
1893
-
1894
-
1895
-
1896
- $elements_data['comments_count'] = array(
1897
- 'key' => 'comments_count',
1898
- 'options'=>array(
1899
-
1900
- 'custom_class'=>'',
1901
- 'no_comment_text'=>'',
1902
- 'singular_text'=>'',
1903
- 'plural_text'=>'',
1904
-
1905
- ),
1906
-
1907
- 'style_idle'=>array(
1908
-
1909
-
1910
- 'fontSize'=>'',
1911
- 'lineHeight'=>'',
1912
- 'color'=>array('hex8'=>'#000000'),
1913
- 'backgroundColor'=>array('hex8'=>'#000000'),
1914
- 'fontFamily'=> '',
1915
- 'fontWeight'=> '',
1916
- 'textDecoration'=> '',
1917
- 'fontStyle'=> '',
1918
- 'textTransform'=> '',
1919
- 'textAlign'=> '',
1920
- 'position'=>'',
1921
- 'display'=> '',
1922
- 'float'=> '',
1923
- 'clear'=> '',
1924
- 'margin'=>'',
1925
- 'padding'=>'',
1926
-
1927
- 'custom_css'=>'',
1928
-
1929
- ),
1930
- 'style_hover'=>array(
1931
-
1932
- 'enable'=> 'no',
1933
-
1934
- 'fontSize'=>'',
1935
- 'lineHeight'=>'',
1936
- 'color'=>array('hex8'=>'#000000'),
1937
- 'backgroundColor'=>array('hex8'=>'#000000'),
1938
- 'fontFamily'=> '',
1939
- 'fontWeight'=> '',
1940
- 'textDecoration'=> '',
1941
- 'fontStyle'=> '',
1942
- 'textTransform'=> '',
1943
- 'textAlign'=> '',
1944
- 'position'=>'',
1945
- 'display'=> '',
1946
- 'float'=> '',
1947
- 'clear'=> '',
1948
- 'margin'=>'',
1949
- 'padding'=>'',
1950
- 'top'=>'',
1951
- 'bottom'=>'',
1952
- 'left'=>'',
1953
- 'right'=>'',
1954
- 'height'=>'',
1955
- 'width'=>'',
1956
- 'zIndex'=>'',
1957
- 'transform'=>'',
1958
- 'transition'=>'',
1959
- 'opacity'=>'',
1960
- 'custom_css'=>'',
1961
-
1962
- ),
1963
-
1964
-
1965
-
1966
-
1967
- );
1968
-
1969
- $elements_data['comments'] = array(
1970
- 'key' => 'comments',
1971
- 'options'=>array(
1972
-
1973
- 'custom_class'=>'',
1974
- 'template'=> '',
1975
- ),
1976
-
1977
- 'style_idle'=>array(
1978
-
1979
-
1980
- 'fontSize'=>'',
1981
- 'lineHeight'=>'',
1982
- 'color'=>array('hex8'=>'#000000'),
1983
- 'backgroundColor'=>array('hex8'=>'#000000'),
1984
- 'fontFamily'=> '',
1985
- 'fontWeight'=> '',
1986
- 'textDecoration'=> '',
1987
- 'fontStyle'=> '',
1988
- 'textTransform'=> '',
1989
- 'textAlign'=> '',
1990
- 'position'=>'',
1991
- 'display'=> '',
1992
- 'float'=> '',
1993
- 'clear'=> '',
1994
- 'margin'=>'',
1995
- 'padding'=>'',
1996
-
1997
- 'custom_css'=>'',
1998
-
1999
-
2000
- ),
2001
- 'style_hover'=>array(
2002
-
2003
- 'enable'=> 'no',
2004
- 'fontSize'=>'',
2005
- 'lineHeight'=>'',
2006
- 'color'=>array('hex8'=>'#000000'),
2007
- 'backgroundColor'=>array('hex8'=>'#000000'),
2008
- 'fontFamily'=> '',
2009
- 'fontWeight'=> '',
2010
- 'textDecoration'=> '',
2011
- 'fontStyle'=> '',
2012
- 'textTransform'=> '',
2013
- 'textAlign'=> '',
2014
- 'position'=>'',
2015
- 'display'=> '',
2016
- 'float'=> '',
2017
- 'clear'=> '',
2018
- 'margin'=>'',
2019
- 'padding'=>'',
2020
- 'top'=>'',
2021
- 'bottom'=>'',
2022
- 'left'=>'',
2023
- 'right'=>'',
2024
- 'height'=>'',
2025
- 'width'=>'',
2026
- 'zIndex'=>'',
2027
- 'transform'=>'',
2028
- 'transition'=>'',
2029
- 'opacity'=>'',
2030
- 'custom_css'=>'',
2031
-
2032
- ),
2033
-
2034
-
2035
- );
2036
-
2037
-
2038
- $elements_data['meta_key'] = array(
2039
- 'key' => 'meta_key',
2040
- 'options'=>array(
2041
-
2042
- 'custom_class'=>'',
2043
- 'meta_key'=>'',
2044
- 'wrapper_text'=>'',
2045
-
2046
- ),
2047
-
2048
- 'style_idle'=>array(
2049
-
2050
- 'fontSize'=>'',
2051
- 'lineHeight'=>'',
2052
- 'color'=>array('hex8'=>'#000000'),
2053
- 'backgroundColor'=>array('hex8'=>'#000000'),
2054
- 'fontFamily'=> '',
2055
- 'fontWeight'=> '',
2056
- 'textDecoration'=> '',
2057
- 'fontStyle'=> '',
2058
- 'textTransform'=> '',
2059
- 'textAlign'=> '',
2060
- 'position'=>'',
2061
- 'display'=> '',
2062
- 'float'=> '',
2063
- 'clear'=> '',
2064
- 'margin'=>'',
2065
- 'padding'=>'',
2066
-
2067
- 'custom_css'=>'',
2068
-
2069
-
2070
-
2071
- ),
2072
- 'style_hover'=>array(
2073
-
2074
- 'enable'=> 'no',
2075
-
2076
- 'fontSize'=>'',
2077
- 'lineHeight'=>'',
2078
- 'color'=>array('hex8'=>'#000000'),
2079
- 'backgroundColor'=>array('hex8'=>'#000000'),
2080
- 'fontFamily'=> '',
2081
- 'fontWeight'=> '',
2082
- 'textDecoration'=> '',
2083
- 'fontStyle'=> '',
2084
- 'textTransform'=> '',
2085
- 'textAlign'=> '',
2086
- 'position'=>'',
2087
- 'display'=> '',
2088
- 'float'=> '',
2089
- 'clear'=> '',
2090
- 'margin'=>'',
2091
- 'padding'=>'',
2092
- 'top'=>'',
2093
- 'bottom'=>'',
2094
- 'left'=>'',
2095
- 'right'=>'',
2096
- 'height'=>'',
2097
- 'width'=>'',
2098
- 'zIndex'=>'',
2099
- 'transform'=>'',
2100
- 'transition'=>'',
2101
- 'opacity'=>'',
2102
- 'custom_css'=>'',
2103
-
2104
- ),
2105
-
2106
-
2107
-
2108
-
2109
- );
2110
-
2111
-
2112
-
2113
-
2114
- $elements_data['custom_taxonomy'] = array(
2115
-
2116
- 'key' => 'custom_taxonomy',
2117
- 'options'=>array(
2118
-
2119
- 'custom_class'=>'',
2120
- 'taxonomy'=>'',
2121
- 'max_limit'=>'',
2122
- 'separator'=>'',
2123
- 'is_linked'=>'',
2124
-
2125
- ),
2126
-
2127
- 'style_idle'=>array(
2128
-
2129
- 'fontSize'=>'',
2130
- 'lineHeight'=>'',
2131
- 'color'=>array('hex8'=>'#000000'),
2132
- 'backgroundColor'=>array('hex8'=>'#000000'),
2133
- 'fontFamily'=> '',
2134
- 'fontWeight'=> '',
2135
- 'textDecoration'=> '',
2136
- 'fontStyle'=> '',
2137
- 'textTransform'=> '',
2138
- 'textAlign'=> '',
2139
- 'position'=>'',
2140
- 'display'=> '',
2141
- 'float'=> '',
2142
- 'clear'=> '',
2143
- 'margin'=>'',
2144
- 'padding'=>'',
2145
- 'top'=>'',
2146
- 'bottom'=>'',
2147
- 'left'=>'',
2148
- 'right'=>'',
2149
- 'height'=>'',
2150
- 'width'=>'',
2151
- 'zIndex'=>'',
2152
- 'transform'=>'',
2153
- 'transition'=>'',
2154
- 'opacity'=>'',
2155
- 'custom_css'=>'',
2156
-
2157
- ),
2158
- 'style_hover'=>array(
2159
-
2160
- 'enable'=> 'no',
2161
-
2162
- 'fontSize'=>'',
2163
- 'lineHeight'=>'',
2164
- 'color'=>array('hex8'=>'#000000'),
2165
- 'backgroundColor'=>array('hex8'=>'#000000'),
2166
- 'fontFamily'=> '',
2167
- 'fontWeight'=> '',
2168
- 'textDecoration'=> '',
2169
- 'fontStyle'=> '',
2170
- 'textTransform'=> '',
2171
- 'textAlign'=> '',
2172
- 'position'=>'',
2173
- 'display'=> '',
2174
- 'float'=> '',
2175
- 'clear'=> '',
2176
- 'margin'=>'',
2177
- 'padding'=>'',
2178
- 'top'=>'',
2179
- 'bottom'=>'',
2180
- 'left'=>'',
2181
- 'right'=>'',
2182
- 'height'=>'',
2183
- 'width'=>'',
2184
- 'zIndex'=>'',
2185
- 'transform'=>'',
2186
- 'transition'=>'',
2187
- 'opacity'=>'',
2188
- 'custom_css'=>'',
2189
-
2190
- ),
2191
-
2192
-
2193
-
2194
- );
2195
-
2196
-
2197
- $elements_data['hr'] = array(
2198
- 'key' => 'hr',
2199
- 'options'=>array(
2200
-
2201
- 'custom_class'=>'',
2202
-
2203
- ),
2204
-
2205
- 'style_idle'=>array(
2206
-
2207
- 'lineHeight'=>'',
2208
- 'color'=>array('hex8'=>'#000000'),
2209
- 'backgroundColor'=>array('hex8'=>'#000000'),
2210
- 'position'=>'',
2211
- 'display'=> '',
2212
- 'float'=> '',
2213
- 'clear'=> '',
2214
- 'margin'=>'',
2215
- 'padding'=>'',
2216
- 'top'=>'',
2217
- 'bottom'=>'',
2218
- 'left'=>'',
2219
- 'right'=>'',
2220
- 'height'=>'',
2221
- 'width'=>'',
2222
- 'zIndex'=>'',
2223
- 'transform'=>'',
2224
- 'transition'=>'',
2225
- 'opacity'=>'',
2226
- 'custom_css'=>'',
2227
-
2228
- ),
2229
- 'style_hover'=>array(
2230
-
2231
- 'enable'=> 'no',
2232
-
2233
- 'fontSize'=>'',
2234
- 'lineHeight'=>'',
2235
- 'color'=>array('hex8'=>'#000000'),
2236
- 'backgroundColor'=>array('hex8'=>'#000000'),
2237
- 'fontFamily'=> '',
2238
- 'fontWeight'=> '',
2239
- 'textDecoration'=> '',
2240
- 'fontStyle'=> '',
2241
- 'textTransform'=> '',
2242
- 'position'=>'',
2243
- 'display'=> '',
2244
- 'float'=> '',
2245
- 'clear'=> '',
2246
- 'margin'=>'',
2247
- 'padding'=>'',
2248
- 'top'=>'',
2249
- 'bottom'=>'',
2250
- 'left'=>'',
2251
- 'right'=>'',
2252
- 'height'=>'',
2253
- 'width'=>'',
2254
- 'zIndex'=>'',
2255
- 'transform'=>'',
2256
- 'transition'=>'',
2257
- 'opacity'=>'',
2258
- 'custom_css'=>'',
2259
-
2260
- ),
2261
-
2262
-
2263
-
2264
-
2265
- );
2266
-
2267
-
2268
-
2269
- $elements_data['html'] = array(
2270
- 'key' => 'html',
2271
-
2272
- 'options'=>array(
2273
-
2274
- 'custom_class'=>'',
2275
- 'do_shortcode'=> '',
2276
- 'wpautop'=> '',
2277
- 'html_content'=>'',
2278
-
2279
-
2280
- ),
2281
-
2282
- 'style_idle'=>array(
2283
-
2284
- 'fontSize'=>'',
2285
- 'lineHeight'=>'',
2286
- 'color'=>array('hex8'=>'#000000'),
2287
- 'backgroundColor'=>array('hex8'=>'#000000'),
2288
- 'fontFamily'=> '',
2289
- 'fontWeight'=> '',
2290
- 'textDecoration'=> '',
2291
- 'fontStyle'=> '',
2292
- 'textTransform'=> '',
2293
- 'textAlign'=> '',
2294
- 'position'=>'',
2295
- 'display'=> '',
2296
- 'float'=> '',
2297
- 'clear'=> '',
2298
- 'margin'=>'',
2299
- 'padding'=>'',
2300
- 'top'=>'',
2301
- 'bottom'=>'',
2302
- 'left'=>'',
2303
- 'right'=>'',
2304
- 'height'=>'',
2305
- 'width'=>'',
2306
- 'zIndex'=>'',
2307
- 'transform'=>'',
2308
- 'transition'=>'',
2309
- 'opacity'=>'',
2310
- 'custom_css'=>'',
2311
-
2312
-
2313
- ),
2314
- 'style_hover'=>array(
2315
-
2316
- 'enable'=> 'no',
2317
- 'fontSize'=>'',
2318
- 'lineHeight'=>'',
2319
- 'color'=>array('hex8'=>'#000000'),
2320
- 'backgroundColor'=>array('hex8'=>'#000000'),
2321
- 'fontFamily'=> '',
2322
- 'fontWeight'=> '',
2323
- 'textDecoration'=> '',
2324
- 'fontStyle'=> '',
2325
- 'textTransform'=> '',
2326
- 'textAlign'=> '',
2327
- 'position'=>'',
2328
- 'display'=> '',
2329
- 'float'=> '',
2330
- 'clear'=> '',
2331
- 'margin'=>'',
2332
- 'padding'=>'',
2333
- 'top'=>'',
2334
- 'bottom'=>'',
2335
- 'left'=>'',
2336
- 'right'=>'',
2337
- 'height'=>'',
2338
- 'width'=>'',
2339
- 'zIndex'=>'',
2340
- 'transform'=>'',
2341
- 'transition'=>'',
2342
- 'opacity'=>'',
2343
- 'custom_css'=>'',
2344
-
2345
- ),
2346
-
2347
-
2348
-
2349
-
2350
-
2351
- );
2352
-
2353
-
2354
- $elements_data['wc_full_price'] = array(
2355
-
2356
- 'key' => 'wc_full_price',
2357
- 'options'=>array(
2358
- 'wrapper_tag'=>'',
2359
- 'custom_class'=>'',
2360
- 'wrapper_text'=>'',
2361
-
2362
-
2363
- ),
2364
-
2365
- 'style_idle'=>array(
2366
-
2367
-
2368
- 'fontSize'=>'',
2369
- 'lineHeight'=>'',
2370
- 'color'=>array('hex8'=>'#000000'),
2371
- 'backgroundColor'=>array('hex8'=>'#000000'),
2372
- 'fontFamily'=> '',
2373
- 'fontWeight'=> '',
2374
- 'textDecoration'=> '',
2375
- 'fontStyle'=> '',
2376
- 'textTransform'=> '',
2377
- 'textAlign'=> '',
2378
- 'position'=>'',
2379
- 'display'=> '',
2380
- 'float'=> '',
2381
- 'clear'=> '',
2382
- 'margin'=>'',
2383
- 'padding'=>'',
2384
- 'top'=>'',
2385
- 'bottom'=>'',
2386
- 'left'=>'',
2387
- 'right'=>'',
2388
- 'height'=>'',
2389
- 'width'=>'',
2390
- 'zIndex'=>'',
2391
- 'transform'=>'',
2392
- 'transition'=>'',
2393
- 'opacity'=>'',
2394
- 'custom_css'=>'',
2395
-
2396
-
2397
-
2398
- ),
2399
- 'style_hover'=>array(
2400
-
2401
- 'enable'=> 'no',
2402
-
2403
- 'fontSize'=>'',
2404
- 'lineHeight'=>'',
2405
- 'color'=>array('hex8'=>'#000000'),
2406
- 'backgroundColor'=>array('hex8'=>'#000000'),
2407
- 'fontFamily'=> '',
2408
- 'fontWeight'=> '',
2409
- 'textDecoration'=> '',
2410
- 'fontStyle'=> '',
2411
- 'textTransform'=> '',
2412
- 'textAlign'=> '',
2413
- 'position'=>'',
2414
- 'display'=> '',
2415
- 'float'=> '',
2416
- 'clear'=> '',
2417
- 'margin'=>'',
2418
- 'padding'=>'',
2419
- 'top'=>'',
2420
- 'bottom'=>'',
2421
- 'left'=>'',
2422
- 'right'=>'',
2423
- 'height'=>'',
2424
- 'width'=>'',
2425
- 'zIndex'=>'',
2426
- 'transform'=>'',
2427
- 'transition'=>'',
2428
- 'opacity'=>'',
2429
- 'custom_css'=>'',
2430
-
2431
- ),
2432
-
2433
-
2434
-
2435
- );
2436
-
2437
-
2438
-
2439
- $elements_data['wc_regular_price'] = array(
2440
- 'key' => 'wc_regular_price',
2441
- 'options'=>array(
2442
- 'wrapper_tag'=>'',
2443
- 'custom_class'=>'',
2444
- 'wrapper_text'=>'',
2445
-
2446
-
2447
- ),
2448
-
2449
- 'style_idle'=>array(
2450
-
2451
-
2452
- 'fontSize'=>'',
2453
- 'lineHeight'=>'',
2454
- 'color'=>array('hex8'=>'#000000'),
2455
- 'backgroundColor'=>array('hex8'=>'#000000'),
2456
- 'fontFamily'=> '',
2457
- 'fontWeight'=> '',
2458
- 'textDecoration'=> '',
2459
- 'fontStyle'=> '',
2460
- 'textTransform'=> '',
2461
- 'textAlign'=> '',
2462
- 'position'=>'',
2463
- 'display'=> '',
2464
- 'float'=> '',
2465
- 'clear'=> '',
2466
- 'margin'=>'',
2467
- 'padding'=>'',
2468
-
2469
- 'custom_css'=>'',
2470
-
2471
-
2472
- ),
2473
- 'style_hover'=>array(
2474
-
2475
-
2476
- 'fontSize'=>'',
2477
- 'lineHeight'=>'',
2478
- 'color'=>array('hex8'=>'#000000'),
2479
- 'backgroundColor'=>array('hex8'=>'#000000'),
2480
- 'fontFamily'=> '',
2481
- 'fontWeight'=> '',
2482
- 'textDecoration'=> '',
2483
- 'fontStyle'=> '',
2484
- 'textTransform'=> '',
2485
- 'textAlign'=> '',
2486
- 'position'=>'',
2487
- 'display'=> '',
2488
- 'float'=> '',
2489
- 'clear'=> '',
2490
- 'margin'=>'',
2491
- 'padding'=>'',
2492
- 'top'=>'',
2493
- 'bottom'=>'',
2494
- 'left'=>'',
2495
- 'right'=>'',
2496
- 'height'=>'',
2497
- 'width'=>'',
2498
- 'zIndex'=>'',
2499
- 'transform'=>'',
2500
- 'transition'=>'',
2501
- 'opacity'=>'',
2502
- 'custom_css'=>'',
2503
-
2504
- ),
2505
-
2506
-
2507
- );
2508
-
2509
-
2510
- $elements_data['wc_sale_price'] = array(
2511
- 'key' => 'wc_sale_price',
2512
- 'options'=>array(
2513
- 'wrapper_tag'=>'',
2514
- 'custom_class'=>'',
2515
- 'wrapper_text'=>'',
2516
-
2517
-
2518
- ),
2519
-
2520
- 'style_idle'=>array(
2521
-
2522
-
2523
- 'fontSize'=>'',
2524
- 'lineHeight'=>'',
2525
- 'color'=>array('hex8'=>'#000000'),
2526
- 'backgroundColor'=>array('hex8'=>'#000000'),
2527
- 'fontFamily'=> '',
2528
- 'fontWeight'=> '',
2529
- 'textDecoration'=> '',
2530
- 'fontStyle'=> '',
2531
- 'textTransform'=> '',
2532
- 'textAlign'=> '',
2533
- 'position'=>'',
2534
- 'display'=> '',
2535
- 'float'=> '',
2536
- 'clear'=> '',
2537
- 'margin'=>'',
2538
- 'padding'=>'',
2539
- 'top'=>'',
2540
- 'bottom'=>'',
2541
- 'left'=>'',
2542
- 'right'=>'',
2543
- 'height'=>'',
2544
- 'width'=>'',
2545
- 'zIndex'=>'',
2546
- 'transform'=>'',
2547
- 'transition'=>'',
2548
- 'opacity'=>'',
2549
- 'custom_css'=>'',
2550
-
2551
-
2552
-
2553
- ),
2554
- 'style_hover'=>array(
2555
-
2556
-
2557
- 'fontSize'=>'',
2558
- 'lineHeight'=>'',
2559
- 'color'=>array('hex8'=>'#000000'),
2560
- 'backgroundColor'=>array('hex8'=>'#000000'),
2561
- 'fontFamily'=> '',
2562
- 'fontWeight'=> '',
2563
- 'textDecoration'=> '',
2564
- 'fontStyle'=> '',
2565
- 'textTransform'=> '',
2566
- 'textAlign'=> '',
2567
- 'position'=>'',
2568
- 'display'=> '',
2569
- 'float'=> '',
2570
- 'clear'=> '',
2571
- 'margin'=>'',
2572
- 'padding'=>'',
2573
- 'top'=>'',
2574
- 'bottom'=>'',
2575
- 'left'=>'',
2576
- 'right'=>'',
2577
- 'height'=>'',
2578
- 'width'=>'',
2579
- 'zIndex'=>'',
2580
- 'transform'=>'',
2581
- 'transition'=>'',
2582
- 'opacity'=>'',
2583
- 'custom_css'=>'',
2584
-
2585
- ),
2586
-
2587
-
2588
-
2589
- );
2590
-
2591
-
2592
-
2593
- $elements_data['wc_gallery'] = array(
2594
- 'key' => 'wc_gallery',
2595
- 'options'=>array(
2596
- 'wrapper_tag'=>'',
2597
- 'custom_class'=>'',
2598
- 'thumb_size'=>'',
2599
-
2600
-
2601
- ),
2602
-
2603
- 'style_idle'=>array(
2604
-
2605
-
2606
- 'filter'=> '',
2607
- 'position'=>'',
2608
- 'display'=> '',
2609
- 'float'=> '',
2610
- 'clear'=> '',
2611
- 'margin'=>'',
2612
- 'padding'=>'',
2613
- 'top'=>'',
2614
- 'bottom'=>'',
2615
- 'left'=>'',
2616
- 'right'=>'',
2617
- 'height'=>'',
2618
- 'width'=>'',
2619
- 'zIndex'=>'',
2620
- 'transform'=>'',
2621
- 'transition'=>'',
2622
- 'opacity'=>'',
2623
- 'custom_css'=>'',
2624
-
2625
-
2626
- ),
2627
- 'style_hover'=>array(
2628
-
2629
-
2630
- 'filter'=> '',
2631
- 'position'=>'',
2632
- 'display'=> '',
2633
- 'float'=> '',
2634
- 'clear'=> '',
2635
- 'margin'=>'',
2636
- 'padding'=>'',
2637
- 'top'=>'',
2638
- 'bottom'=>'',
2639
- 'left'=>'',
2640
- 'right'=>'',
2641
- 'height'=>'',
2642
- 'width'=>'',
2643
- 'zIndex'=>'',
2644
- 'transform'=>'',
2645
- 'transition'=>'',
2646
- 'opacity'=>'',
2647
- 'custom_css'=>'',
2648
-
2649
- ),
2650
-
2651
-
2652
-
2653
-
2654
- );
2655
-
2656
-
2657
-
2658
- $elements_data['wc_add_to_cart'] = array(
2659
- 'key' => 'wc_add_to_cart',
2660
- 'options'=>array(
2661
- 'wrapper_tag'=>'',
2662
- 'custom_class'=>'',
2663
- 'cart_text'=>'',
2664
- 'show_price'=> '',
2665
- 'is_default'=> '',
2666
-
2667
-
2668
- ),
2669
- 'style_idle'=>array(
2670
-
2671
-
2672
- 'fontSize'=>'',
2673
- 'lineHeight'=>'',
2674
- 'color'=>array('hex8'=>'#000000'),
2675
- 'backgroundColor'=>array('hex8'=>'#000000'),
2676
- 'fontFamily'=> '',
2677
- 'fontWeight'=> '',
2678
- 'textDecoration'=> '',
2679
- 'fontStyle'=> '',
2680
- 'textTransform'=> '',
2681
- 'position'=>'',
2682
- 'display'=> '',
2683
- 'float'=> '',
2684
- 'clear'=> '',
2685
- 'margin'=>'',
2686
- 'padding'=>'',
2687
- 'top'=>'',
2688
- 'bottom'=>'',
2689
- 'left'=>'',
2690
- 'right'=>'',
2691
- 'height'=>'',
2692
- 'width'=>'',
2693
- 'zIndex'=>'',
2694
- 'transform'=>'',
2695
- 'transition'=>'',
2696
- 'opacity'=>'',
2697
- 'custom_css'=>'',
2698
-
2699
-
2700
-
2701
- ),
2702
- 'style_hover'=>array(
2703
-
2704
-
2705
- 'fontSize'=>'',
2706
- 'lineHeight'=>'',
2707
- 'color'=>array('hex8'=>'#000000'),
2708
- 'backgroundColor'=>array('hex8'=>'#000000'),
2709
- 'fontFamily'=> '',
2710
- 'fontWeight'=> '',
2711
- 'textDecoration'=> '',
2712
- 'fontStyle'=> '',
2713
- 'textTransform'=> '',
2714
- 'position'=>'',
2715
- 'display'=> '',
2716
- 'float'=> '',
2717
- 'clear'=> '',
2718
- 'margin'=>'',
2719
- 'padding'=>'',
2720
- 'top'=>'',
2721
- 'bottom'=>'',
2722
- 'left'=>'',
2723
- 'right'=>'',
2724
- 'height'=>'',
2725
- 'width'=>'',
2726
- 'zIndex'=>'',
2727
- 'transform'=>'',
2728
- 'transition'=>'',
2729
- 'opacity'=>'',
2730
- 'custom_css'=>'',
2731
-
2732
- ),
2733
-
2734
-
2735
-
2736
-
2737
-
2738
- );
2739
-
2740
-
2741
-
2742
- //
2743
- // $elements_data['wc_rating_star'] = array(
2744
- //
2745
- // 'options_group'=>array(
2746
- // 'settings'=>array(
2747
- //
2748
- // 'options'=>array(
2749
- // 'wrapper_tag'=>'',
2750
- // 'custom_class'=>'',
2751
- //
2752
- // ),
2753
- // ),
2754
- // 'style_idle'=>array(
2755
- //
2756
- // 'options'=>array(
2757
- // 'fontSize'=>'',
2758
- // 'lineHeight'=>'',
2759
- // 'color'=>array('hex8'=>'#000000'),
2760
- // 'backgroundColor'=>array('hex8'=>'#000000'),
2761
- // 'fontFamily'=> '',
2762
- // 'fontWeight'=> '',
2763
- // 'textDecoration'=> '',
2764
- // 'fontStyle'=> '',
2765
- // 'textTransform'=> '',
2766
- // 'position'=>'',
2767
- // 'display'=> '',
2768
- // 'float'=> '',
2769
- // 'clear'=> '',
2770
- // 'margin'=>'',
2771
- // 'padding'=>'',
2772
- // 'top'=>'',
2773
- // 'bottom'=>'',
2774
- // 'left'=>'',
2775
- // 'right'=>'',
2776
- // 'height'=>'',
2777
- // 'width'=>'',
2778
- // 'zIndex'=>'',
2779
- // 'transform'=>'',
2780
- // 'transition'=>'',
2781
- // 'opacity'=>'',
2782
- // 'custom_css'=>'',
2783
- //
2784
- //
2785
- // ),
2786
- // ),
2787
- // 'style_hover'=>array(
2788
- //
2789
- // 'options'=>array(
2790
- // 'fontSize'=>'',
2791
- // 'lineHeight'=>'',
2792
- // 'color'=>array('hex8'=>'#000000'),
2793
- // 'backgroundColor'=>array('hex8'=>'#000000'),
2794
- // 'fontFamily'=> '',
2795
- // 'fontWeight'=> '',
2796
- // 'textDecoration'=> '',
2797
- // 'fontStyle'=> '',
2798
- // 'textTransform'=> '',
2799
- // 'position'=>'',
2800
- // 'display'=> '',
2801
- // 'float'=> '',
2802
- // 'clear'=> '',
2803
- // 'margin'=>'',
2804
- // 'padding'=>'',
2805
- // 'top'=>'',
2806
- // 'bottom'=>'',
2807
- // 'left'=>'',
2808
- // 'right'=>'',
2809
- // 'height'=>'',
2810
- // 'width'=>'',
2811
- // 'zIndex'=>'',
2812
- // 'transform'=>'',
2813
- // 'transition'=>'',
2814
- // 'opacity'=>'',
2815
- // 'custom_css'=>'',
2816
- // ),
2817
- // ),
2818
- //
2819
- //
2820
- // ),
2821
- //
2822
- //
2823
- // );
2824
- //
2825
- //
2826
- //
2827
- //
2828
- // $elements_data['wc_rating_text'] = array(
2829
- //
2830
- // 'options_group'=>array(
2831
- // 'settings'=>array(
2832
- //
2833
- // 'options'=>array(
2834
- // 'wrapper_tag'=>'',
2835
- // 'custom_class'=>'',
2836
- //
2837
- // ),
2838
- // ),
2839
- // 'style_idle'=>array(
2840
- //
2841
- // 'options'=>array(
2842
- // 'fontSize'=>'',
2843
- // 'lineHeight'=>'',
2844
- // 'color'=>array('hex8'=>'#000000'),
2845
- // 'backgroundColor'=>array('hex8'=>'#000000'),
2846
- // 'fontFamily'=> '',
2847
- // 'fontWeight'=> '',
2848
- // 'textDecoration'=> '',
2849
- // 'fontStyle'=> '',
2850
- // 'textTransform'=> '',
2851
- // 'position'=>'',
2852
- // 'display'=> '',
2853
- // 'float'=> '',
2854
- // 'clear'=> '',
2855
- // 'margin'=>'',
2856
- // 'padding'=>'',
2857
- // 'top'=>'',
2858
- // 'bottom'=>'',
2859
- // 'left'=>'',
2860
- // 'right'=>'',
2861
- // 'height'=>'',
2862
- // 'width'=>'',
2863
- // 'zIndex'=>'',
2864
- // 'transform'=>'',
2865
- // 'transition'=>'',
2866
- // 'opacity'=>'',
2867
- // 'custom_css'=>'',
2868
- //
2869
- //
2870
- // ),
2871
- // ),
2872
- // 'style_hover'=>array(
2873
- //
2874
- // 'options'=>array(
2875
- // 'fontSize'=>'',
2876
- // 'lineHeight'=>'',
2877
- // 'color'=>array('hex8'=>'#000000'),
2878
- // 'backgroundColor'=>array('hex8'=>'#000000'),
2879
- // 'fontFamily'=> '',
2880
- // 'fontWeight'=> '',
2881
- // 'textDecoration'=> '',
2882
- // 'fontStyle'=> '',
2883
- // 'textTransform'=> '',
2884
- // 'position'=>'',
2885
- // 'display'=> '',
2886
- // 'float'=> '',
2887
- // 'clear'=> '',
2888
- // 'margin'=>'',
2889
- // 'padding'=>'',
2890
- // 'top'=>'',
2891
- // 'bottom'=>'',
2892
- // 'left'=>'',
2893
- // 'right'=>'',
2894
- // 'height'=>'',
2895
- // 'width'=>'',
2896
- // 'zIndex'=>'',
2897
- // 'transform'=>'',
2898
- // 'transition'=>'',
2899
- // 'opacity'=>'',
2900
- // 'custom_css'=>'',
2901
- // ),
2902
- // ),
2903
- //
2904
- //
2905
- // ),
2906
- //
2907
- //
2908
- // );
2909
- //
2910
- //
2911
- //
2912
- // $elements_data['wc_categories'] = array(
2913
- //
2914
- // 'options_group'=>array(
2915
- // 'settings'=>array(
2916
- //
2917
- // 'options'=>array(
2918
- //
2919
- // 'custom_class'=>'',
2920
- // 'is_linked'=>'',
2921
- // 'max_limit'=>'',
2922
- // 'separator'=>'',
2923
- // ),
2924
- // ),
2925
- // 'style_idle'=>array(
2926
- //
2927
- // 'options'=>array(
2928
- // 'fontSize'=>'',
2929
- // 'lineHeight'=>'',
2930
- // 'color'=>array('hex8'=>'#000000'),
2931
- // 'backgroundColor'=>array('hex8'=>'#000000'),
2932
- // 'fontFamily'=> '',
2933
- // 'fontWeight'=> '',
2934
- // 'textDecoration'=> '',
2935
- // 'fontStyle'=> '',
2936
- // 'textTransform'=> '',
2937
- // 'textAlign'=> '',
2938
- // 'position'=>'',
2939
- // 'display'=> '',
2940
- // 'float'=> '',
2941
- // 'clear'=> '',
2942
- // 'margin'=>'',
2943
- // 'padding'=>'',
2944
- // 'top'=>'',
2945
- // 'bottom'=>'',
2946
- // 'left'=>'',
2947
- // 'right'=>'',
2948
- // 'height'=>'',
2949
- // 'width'=>'',
2950
- // 'zIndex'=>'',
2951
- // 'transform'=>'',
2952
- // 'transition'=>'',
2953
- // 'opacity'=>'',
2954
- // 'custom_css'=>'',
2955
- //
2956
- //
2957
- // ),
2958
- // ),
2959
- // 'style_hover'=>array(
2960
- //
2961
- // 'options'=>array(
2962
- // 'fontSize'=>'',
2963
- // 'lineHeight'=>'',
2964
- // 'color'=>array('hex8'=>'#000000'),
2965
- // 'backgroundColor'=>array('hex8'=>'#000000'),
2966
- // 'fontFamily'=> '',
2967
- // 'fontWeight'=> '',
2968
- // 'textDecoration'=> '',
2969
- // 'fontStyle'=> '',
2970
- // 'textTransform'=> '',
2971
- // 'textAlign'=> '',
2972
- // 'position'=>'',
2973
- // 'display'=> '',
2974
- // 'float'=> '',
2975
- // 'clear'=> '',
2976
- // 'margin'=>'',
2977
- // 'padding'=>'',
2978
- // 'top'=>'',
2979
- // 'bottom'=>'',
2980
- // 'left'=>'',
2981
- // 'right'=>'',
2982
- // 'height'=>'',
2983
- // 'width'=>'',
2984
- // 'zIndex'=>'',
2985
- // 'transform'=>'',
2986
- // 'transition'=>'',
2987
- // 'opacity'=>'',
2988
- // 'custom_css'=>'',
2989
- // ),
2990
- // ),
2991
- //
2992
- //
2993
- // ),
2994
- //
2995
- //
2996
- // );
2997
- //
2998
- //
2999
- //
3000
- // $elements_data['wc_tags'] = array(
3001
- //
3002
- // 'options_group'=>array(
3003
- // 'settings'=>array(
3004
- //
3005
- // 'options'=>array(
3006
- //
3007
- // 'custom_class'=>'',
3008
- // 'is_linked'=>'',
3009
- // 'max_limit'=>'',
3010
- // 'separator'=>'',
3011
- // ),
3012
- // ),
3013
- // 'style_idle'=>array(
3014
- //
3015
- // 'options'=>array(
3016
- // 'fontSize'=>'',
3017
- // 'lineHeight'=>'',
3018
- // 'color'=>array('hex8'=>'#000000'),
3019
- // 'backgroundColor'=>array('hex8'=>'#000000'),
3020
- // 'fontFamily'=> '',
3021
- // 'fontWeight'=> '',
3022
- // 'textDecoration'=> '',
3023
- // 'fontStyle'=> '',
3024
- // 'textTransform'=> '',
3025
- // 'textAlign'=> '',
3026
- // 'position'=>'',
3027
- // 'display'=> '',
3028
- // 'float'=> '',
3029
- // 'clear'=> '',
3030
- // 'margin'=>'',
3031
- // 'padding'=>'',
3032
- // 'top'=>'',
3033
- // 'bottom'=>'',
3034
- // 'left'=>'',
3035
- // 'right'=>'',
3036
- // 'height'=>'',
3037
- // 'width'=>'',
3038
- // 'zIndex'=>'',
3039
- // 'transform'=>'',
3040
- // 'transition'=>'',
3041
- // 'opacity'=>'',
3042
- // 'custom_css'=>'',
3043
- //
3044
- //
3045
- // ),
3046
- // ),
3047
- // 'style_hover'=>array(
3048
- //
3049
- // 'options'=>array(
3050
- // 'fontSize'=>'',
3051
- // 'lineHeight'=>'',
3052
- // 'color'=>array('hex8'=>'#000000'),
3053
- // 'backgroundColor'=>array('hex8'=>'#000000'),
3054
- // 'fontFamily'=> '',
3055
- // 'fontWeight'=> '',
3056
- // 'textDecoration'=> '',
3057
- // 'fontStyle'=> '',
3058
- // 'textTransform'=> '',
3059
- // 'textAlign'=> '',
3060
- // 'position'=>'',
3061
- // 'display'=> '',
3062
- // 'float'=> '',
3063
- // 'clear'=> '',
3064
- // 'margin'=>'',
3065
- // 'padding'=>'',
3066
- // 'top'=>'',
3067
- // 'bottom'=>'',
3068
- // 'left'=>'',
3069
- // 'right'=>'',
3070
- // 'height'=>'',
3071
- // 'width'=>'',
3072
- // 'zIndex'=>'',
3073
- // 'transform'=>'',
3074
- // 'transition'=>'',
3075
- // 'opacity'=>'',
3076
- // 'custom_css'=>'',
3077
- // ),
3078
- // ),
3079
- //
3080
- //
3081
- // ),
3082
- //
3083
- //
3084
- // );
3085
- //
3086
- //
3087
- // $elements_data['wc_sku'] = array(
3088
- //
3089
- // 'options_group'=>array(
3090
- // 'settings'=>array(
3091
- //
3092
- // 'options'=>array(
3093
- //
3094
- // 'custom_class'=>'',
3095
- // 'wrapper_text'=>array('title'=>'Wrapper text', 'type'=>'text', 'value'=>'SKU goes %s here'),
3096
- // ),
3097
- // ),
3098
- // 'style_idle'=>array(
3099
- //
3100
- // 'options'=>array(
3101
- // 'fontSize'=>'',
3102
- // 'lineHeight'=>'',
3103
- // 'color'=>array('hex8'=>'#000000'),
3104
- // 'backgroundColor'=>array('hex8'=>'#000000'),
3105
- // 'fontFamily'=> '',
3106
- // 'fontWeight'=> '',
3107
- // 'textDecoration'=> '',
3108
- // 'fontStyle'=> '',
3109
- // 'textTransform'=> '',
3110
- // 'textAlign'=> '',
3111
- // 'position'=>'',
3112
- // 'display'=> '',
3113
- // 'float'=> '',
3114
- // 'clear'=> '',
3115
- // 'margin'=>'',
3116
- // 'padding'=>'',
3117
- // 'top'=>'',
3118
- // 'bottom'=>'',
3119
- // 'left'=>'',
3120
- // 'right'=>'',
3121
- // 'height'=>'',
3122
- // 'width'=>'',
3123
- // 'zIndex'=>'',
3124
- // 'transform'=>'',
3125
- // 'transition'=>'',
3126
- // 'opacity'=>'',
3127
- // 'custom_css'=>'',
3128
- //
3129
- //
3130
- // ),
3131
- // ),
3132
- // 'style_hover'=>array(
3133
- //
3134
- // 'options'=>array(
3135
- // 'fontSize'=>'',
3136
- // 'lineHeight'=>'',
3137
- // 'color'=>array('hex8'=>'#000000'),
3138
- // 'backgroundColor'=>array('hex8'=>'#000000'),
3139
- // 'fontFamily'=> '',
3140
- // 'fontWeight'=> '',
3141
- // 'textDecoration'=> '',
3142
- // 'fontStyle'=> '',
3143
- // 'textTransform'=> '',
3144
- // 'textAlign'=> '',
3145
- // 'position'=>'',
3146
- // 'display'=> '',
3147
- // 'float'=> '',
3148
- // 'clear'=> '',
3149
- // 'margin'=>'',
3150
- // 'padding'=>'',
3151
- // 'top'=>'',
3152
- // 'bottom'=>'',
3153
- // 'left'=>'',
3154
- // 'right'=>'',
3155
- // 'height'=>'',
3156
- // 'width'=>'',
3157
- // 'zIndex'=>'',
3158
- // 'transform'=>'',
3159
- // 'transition'=>'',
3160
- // 'opacity'=>'',
3161
- // 'custom_css'=>'',
3162
- // ),
3163
- // ),
3164
- //
3165
- //
3166
- // ),
3167
- //
3168
- //
3169
- // );
3170
- //
3171
- //
3172
- //
3173
- //
3174
- //
3175
- //
3176
- // $elements_data['wc_cat_thumbnail']=array(
3177
- //
3178
- // 'options_group'=>array(
3179
- // 'settings'=>array(
3180
- //
3181
- // 'options'=>array(
3182
- //
3183
- // 'custom_class'=>'',
3184
- // 'linked_to'=>'',
3185
- // 'image_size'=>'',
3186
- // ),
3187
- // ),
3188
- // 'style_idle'=>array(
3189
- //
3190
- // 'options'=>array(
3191
- // 'filter'=> '',
3192
- // 'width'=>'',
3193
- // 'height'=>'',
3194
- // 'overflow'=> '',
3195
- // 'position'=>'',
3196
- // 'display'=> '',
3197
- // 'float'=> '',
3198
- // 'clear'=> '',
3199
- // 'margin'=>'',
3200
- // 'padding'=>'',
3201
- // 'top'=>'',
3202
- // 'bottom'=>'',
3203
- // 'left'=>'',
3204
- // 'right'=>'',
3205
- // 'height'=>'',
3206
- // 'width'=>'',
3207
- // 'zIndex'=>'',
3208
- // 'transform'=>'',
3209
- // 'transition'=>'',
3210
- // 'opacity'=>'',
3211
- // 'custom_css'=>'',
3212
- //
3213
- //
3214
- // ),
3215
- // ),
3216
- // 'style_hover'=>array(
3217
- //
3218
- // 'options'=>array(
3219
- // 'filter'=> '',
3220
- // 'width'=>'',
3221
- // 'height'=>'',
3222
- // 'overflow'=> '',
3223
- // 'position'=>'',
3224
- // 'display'=> '',
3225
- // 'float'=> '',
3226
- // 'clear'=> '',
3227
- // 'margin'=>'',
3228
- // 'padding'=>'',
3229
- // 'top'=>'',
3230
- // 'bottom'=>'',
3231
- // 'left'=>'',
3232
- // 'right'=>'',
3233
- // 'height'=>'',
3234
- // 'width'=>'',
3235
- // 'zIndex'=>'',
3236
- // 'transform'=>'',
3237
- // 'transition'=>'',
3238
- // 'opacity'=>'',
3239
- // 'custom_css'=>'',
3240
- // ),
3241
- // ),
3242
- //
3243
- //
3244
- // ),
3245
- //
3246
- //
3247
- // );
3248
- //
3249
- //
3250
- //
3251
- //
3252
- // $elements_data['wc_cat_description'] =array(
3253
- //
3254
- // 'options_group'=>array(
3255
- // 'settings'=>array(
3256
- //
3257
- // 'options'=>array(
3258
- //
3259
- // 'custom_class'=>'',
3260
- // 'limit_by'=>'',
3261
- // 'limit_count'=>'',
3262
- // ),
3263
- // ),
3264
- // 'style_idle'=>array(
3265
- //
3266
- // 'options'=>array(
3267
- // 'fontSize'=>'',
3268
- // 'lineHeight'=>'',
3269
- // 'color'=>array('hex8'=>'#000000'),
3270
- // 'backgroundColor'=>array('hex8'=>'#000000'),
3271
- // 'fontFamily'=> '',
3272
- // 'fontWeight'=> '',
3273
- // 'textDecoration'=> '',
3274
- // 'fontStyle'=> '',
3275
- // 'textTransform'=> '',
3276
- // 'textAlign'=> '',
3277
- // 'position'=>'',
3278
- // 'display'=> '',
3279
- // 'float'=> '',
3280
- // 'clear'=> '',
3281
- // 'margin'=>'',
3282
- // 'padding'=>'',
3283
- // 'top'=>'',
3284
- // 'bottom'=>'',
3285
- // 'left'=>'',
3286
- // 'right'=>'',
3287
- // 'height'=>'',
3288
- // 'width'=>'',
3289
- // 'zIndex'=>'',
3290
- // 'transform'=>'',
3291
- // 'transition'=>'',
3292
- // 'opacity'=>'',
3293
- // 'custom_css'=>'',
3294
- //
3295
- //
3296
- // ),
3297
- // ),
3298
- // 'style_hover'=>array(
3299
- //
3300
- // 'options'=>array(
3301
- // 'fontSize'=>'',
3302
- // 'lineHeight'=>'',
3303
- // 'color'=>array('hex8'=>'#000000'),
3304
- // 'backgroundColor'=>array('hex8'=>'#000000'),
3305
- // 'fontFamily'=> '',
3306
- // 'fontWeight'=> '',
3307
- // 'textDecoration'=> '',
3308
- // 'fontStyle'=> '',
3309
- // 'textTransform'=> '',
3310
- // 'textAlign'=> '',
3311
- // 'position'=>'',
3312
- // 'display'=> '',
3313
- // 'float'=> '',
3314
- // 'clear'=> '',
3315
- // 'margin'=>'',
3316
- // 'padding'=>'',
3317
- // 'top'=>'',
3318
- // 'bottom'=>'',
3319
- // 'left'=>'',
3320
- // 'right'=>'',
3321
- // 'height'=>'',
3322
- // 'width'=>'',
3323
- // 'zIndex'=>'',
3324
- // 'transform'=>'',
3325
- // 'transition'=>'',
3326
- // 'opacity'=>'',
3327
- // 'custom_css'=>'',
3328
- // ),
3329
- // ),
3330
- //
3331
- //
3332
- // ),
3333
- //
3334
- //
3335
- // );
3336
- //
3337
- //
3338
- //
3339
- //
3340
- //
3341
- //
3342
- //
3343
- //
3344
- //
3345
- //
3346
- //
3347
- //
3348
- //
3349
- //
3350
- //
3351
- //
3352
- //
3353
- // $elements_data['edd_price'] = array(
3354
- //
3355
- // 'options_group'=>array(
3356
- // 'settings'=>array(
3357
- //
3358
- // 'options'=>array(
3359
- //
3360
- // 'custom_class'=>'',
3361
- // 'wrapper_text'=>'',
3362
- // ),
3363
- // ),
3364
- // 'style_idle'=>array(
3365
- //
3366
- // 'options'=>array(
3367
- // 'fontSize'=>'',
3368
- // 'lineHeight'=>'',
3369
- // 'color'=>array('hex8'=>'#000000'),
3370
- // 'backgroundColor'=>array('hex8'=>'#000000'),
3371
- // 'fontFamily'=> '',
3372
- // 'fontWeight'=> '',
3373
- // 'textDecoration'=> '',
3374
- // 'fontStyle'=> '',
3375
- // 'textTransform'=> '',
3376
- // 'textAlign'=> '',
3377
- // 'position'=>'',
3378
- // 'display'=> '',
3379
- // 'float'=> '',
3380
- // 'clear'=> '',
3381
- // 'margin'=>'',
3382
- // 'padding'=>'',
3383
- // 'top'=>'',
3384
- // 'bottom'=>'',
3385
- // 'left'=>'',
3386
- // 'right'=>'',
3387
- // 'height'=>'',
3388
- // 'width'=>'',
3389
- // 'zIndex'=>'',
3390
- // 'transform'=>'',
3391
- // 'transition'=>'',
3392
- // 'opacity'=>'',
3393
- // 'custom_css'=>'',
3394
- //
3395
- //
3396
- // ),
3397
- // ),
3398
- // 'style_hover'=>array(
3399
- //
3400
- // 'options'=>array(
3401
- // 'fontSize'=>'',
3402
- // 'lineHeight'=>'',
3403
- // 'color'=>array('hex8'=>'#000000'),
3404
- // 'backgroundColor'=>array('hex8'=>'#000000'),
3405
- // 'fontFamily'=> '',
3406
- // 'fontWeight'=> '',
3407
- // 'textDecoration'=> '',
3408
- // 'fontStyle'=> '',
3409
- // 'textTransform'=> '',
3410
- // 'textAlign'=> '',
3411
- // 'position'=>'',
3412
- // 'display'=> '',
3413
- // 'float'=> '',
3414
- // 'clear'=> '',
3415
- // 'margin'=>'',
3416
- // 'padding'=>'',
3417
- // 'top'=>'',
3418
- // 'bottom'=>'',
3419
- // 'left'=>'',
3420
- // 'right'=>'',
3421
- // 'height'=>'',
3422
- // 'width'=>'',
3423
- // 'zIndex'=>'',
3424
- // 'transform'=>'',
3425
- // 'transition'=>'',
3426
- // 'opacity'=>'',
3427
- // 'custom_css'=>'',
3428
- // ),
3429
- // ),
3430
- //
3431
- //
3432
- // ),
3433
- //
3434
- //
3435
- // );
3436
- //
3437
- //
3438
- //
3439
- // $elements_data['edd_variable_prices'] = array(
3440
- //
3441
- // 'options_group'=>array(
3442
- // 'settings'=>array(
3443
- //
3444
- // 'options'=>array(
3445
- //
3446
- // 'custom_class'=>'',
3447
- // 'wrapper_text'=>'',
3448
- // ),
3449
- // ),
3450
- // 'style_idle'=>array(
3451
- //
3452
- // 'options'=>array(
3453
- // 'fontSize'=>'',
3454
- // 'lineHeight'=>'',
3455
- // 'color'=>array('hex8'=>'#000000'),
3456
- // 'backgroundColor'=>array('hex8'=>'#000000'),
3457
- // 'fontFamily'=> '',
3458
- // 'fontWeight'=> '',
3459
- // 'textDecoration'=> '',
3460
- // 'fontStyle'=> '',
3461
- // 'textTransform'=> '',
3462
- // 'textAlign'=> '',
3463
- // 'position'=>'',
3464
- // 'display'=> '',
3465
- // 'float'=> '',
3466
- // 'clear'=> '',
3467
- // 'margin'=>'',
3468
- // 'padding'=>'',
3469
- // 'top'=>'',
3470
- // 'bottom'=>'',
3471
- // 'left'=>'',
3472
- // 'right'=>'',
3473
- // 'height'=>'',
3474
- // 'width'=>'',
3475
- // 'zIndex'=>'',
3476
- // 'transform'=>'',
3477
- // 'transition'=>'',
3478
- // 'opacity'=>'',
3479
- // 'custom_css'=>'',
3480
- //
3481
- //
3482
- // ),
3483
- // ),
3484
- // 'style_hover'=>array(
3485
- //
3486
- // 'options'=>array(
3487
- // 'fontSize'=>'',
3488
- // 'lineHeight'=>'',
3489
- // 'color'=>array('hex8'=>'#000000'),
3490
- // 'backgroundColor'=>array('hex8'=>'#000000'),
3491
- // 'fontFamily'=> '',
3492
- // 'fontWeight'=> '',
3493
- // 'textDecoration'=> '',
3494
- // 'fontStyle'=> '',
3495
- // 'textTransform'=> '',
3496
- // 'textAlign'=> '',
3497
- // 'position'=>'',
3498
- // 'display'=> '',
3499
- // 'float'=> '',
3500
- // 'clear'=> '',
3501
- // 'margin'=>'',
3502
- // 'padding'=>'',
3503
- // 'top'=>'',
3504
- // 'bottom'=>'',
3505
- // 'left'=>'',
3506
- // 'right'=>'',
3507
- // 'height'=>'',
3508
- // 'width'=>'',
3509
- // 'zIndex'=>'',
3510
- // 'transform'=>'',
3511
- // 'transition'=>'',
3512
- // 'opacity'=>'',
3513
- // 'custom_css'=>'',
3514
- // ),
3515
- // ),
3516
- //
3517
- //
3518
- // ),
3519
- //
3520
- //
3521
- // );
3522
- //
3523
- //
3524
- //
3525
- // $elements_data['edd_sales_stats'] = array(
3526
- //
3527
- // 'options_group'=>array(
3528
- // 'settings'=>array(
3529
- //
3530
- // 'options'=>array(
3531
- //
3532
- // 'custom_class'=>'',
3533
- // 'wrapper_text'=>'',
3534
- // ),
3535
- // ),
3536
- // 'style_idle'=>array(
3537
- //
3538
- // 'options'=>array(
3539
- // 'fontSize'=>'',
3540
- // 'lineHeight'=>'',
3541
- // 'color'=>array('hex8'=>'#000000'),
3542
- // 'backgroundColor'=>array('hex8'=>'#000000'),
3543
- // 'fontFamily'=> '',
3544
- // 'fontWeight'=> '',
3545
- // 'textDecoration'=> '',
3546
- // 'fontStyle'=> '',
3547
- // 'textTransform'=> '',
3548
- // 'textAlign'=> '',
3549
- // 'position'=>'',
3550
- // 'display'=> '',
3551
- // 'float'=> '',
3552
- // 'clear'=> '',
3553
- // 'margin'=>'',
3554
- // 'padding'=>'',
3555
- // 'top'=>'',
3556
- // 'bottom'=>'',
3557
- // 'left'=>'',
3558
- // 'right'=>'',
3559
- // 'height'=>'',
3560
- // 'width'=>'',
3561
- // 'zIndex'=>'',
3562
- // 'transform'=>'',
3563
- // 'transition'=>'',
3564
- // 'opacity'=>'',
3565
- // 'custom_css'=>'',
3566
- //
3567
- //
3568
- // ),
3569
- // ),
3570
- // 'style_hover'=>array(
3571
- //
3572
- // 'options'=>array(
3573
- // 'fontSize'=>'',
3574
- // 'lineHeight'=>'',
3575
- // 'color'=>array('hex8'=>'#000000'),
3576
- // 'backgroundColor'=>array('hex8'=>'#000000'),
3577
- // 'fontFamily'=> '',
3578
- // 'fontWeight'=> '',
3579
- // 'textDecoration'=> '',
3580
- // 'fontStyle'=> '',
3581
- // 'textTransform'=> '',
3582
- // 'textAlign'=> '',
3583
- // 'position'=>'',
3584
- // 'display'=> '',
3585
- // 'float'=> '',
3586
- // 'clear'=> '',
3587
- // 'margin'=>'',
3588
- // 'padding'=>'',
3589
- // 'top'=>'',
3590
- // 'bottom'=>'',
3591
- // 'left'=>'',
3592
- // 'right'=>'',
3593
- // 'height'=>'',
3594
- // 'width'=>'',
3595
- // 'zIndex'=>'',
3596
- // 'transform'=>'',
3597
- // 'transition'=>'',
3598
- // 'opacity'=>'',
3599
- // 'custom_css'=>'',
3600
- // ),
3601
- // ),
3602
- //
3603
- //
3604
- // ),
3605
- //
3606
- //
3607
- // );
3608
- //
3609
- //
3610
- //
3611
- // $elements_data['edd_earnings_stats'] = array(
3612
- //
3613
- // 'options_group'=>array(
3614
- // 'settings'=>array(
3615
- //
3616
- // 'options'=>array(
3617
- //
3618
- // 'custom_class'=>'',
3619
- // 'wrapper_text'=>'',
3620
- // ),
3621
- // ),
3622
- // 'style_idle'=>array(
3623
- //
3624
- // 'options'=>array(
3625
- // 'fontSize'=>'',
3626
- // 'lineHeight'=>'',
3627
- // 'color'=>array('hex8'=>'#000000'),
3628
- // 'backgroundColor'=>array('hex8'=>'#000000'),
3629
- // 'fontFamily'=> '',
3630
- // 'fontWeight'=> '',
3631
- // 'textDecoration'=> '',
3632
- // 'fontStyle'=> '',
3633
- // 'textTransform'=> '',
3634
- // 'textAlign'=> '',
3635
- // 'position'=>'',
3636
- // 'display'=> '',
3637
- // 'float'=> '',
3638
- // 'clear'=> '',
3639
- // 'margin'=>'',
3640
- // 'padding'=>'',
3641
- // 'top'=>'',
3642
- // 'bottom'=>'',
3643
- // 'left'=>'',
3644
- // 'right'=>'',
3645
- // 'height'=>'',
3646
- // 'width'=>'',
3647
- // 'zIndex'=>'',
3648
- // 'transform'=>'',
3649
- // 'transition'=>'',
3650
- // 'opacity'=>'',
3651
- // 'custom_css'=>'',
3652
- //
3653
- //
3654
- // ),
3655
- // ),
3656
- // 'style_hover'=>array(
3657
- //
3658
- // 'options'=>array(
3659
- // 'fontSize'=>'',
3660
- // 'lineHeight'=>'',
3661
- // 'color'=>array('hex8'=>'#000000'),
3662
- // 'backgroundColor'=>array('hex8'=>'#000000'),
3663
- // 'fontFamily'=> '',
3664
- // 'fontWeight'=> '',
3665
- // 'textDecoration'=> '',
3666
- // 'fontStyle'=> '',
3667
- // 'textTransform'=> '',
3668
- // 'textAlign'=> '',
3669
- // 'position'=>'',
3670
- // 'display'=> '',
3671
- // 'float'=> '',
3672
- // 'clear'=> '',
3673
- // 'margin'=>'',
3674
- // 'padding'=>'',
3675
- // 'top'=>'',
3676
- // 'bottom'=>'',
3677
- // 'left'=>'',
3678
- // 'right'=>'',
3679
- // 'height'=>'',
3680
- // 'width'=>'',
3681
- // 'zIndex'=>'',
3682
- // 'transform'=>'',
3683
- // 'transition'=>'',
3684
- // 'opacity'=>'',
3685
- // 'custom_css'=>'',
3686
- // ),
3687
- // ),
3688
- //
3689
- //
3690
- // ),
3691
- //
3692
- //
3693
- // );
3694
- //
3695
- //
3696
- //
3697
- // $elements_data['edd_add_to_cart'] = array(
3698
- //
3699
- // 'options_group'=>array(
3700
- // 'settings'=>array(
3701
- //
3702
- // 'options'=>array(
3703
- // 'custom_class'=>'',
3704
- // 'cart_text'=>'',
3705
- //
3706
- //
3707
- //
3708
- // ),
3709
- // ),
3710
- // 'style_idle'=>array(
3711
- //
3712
- // 'options'=>array(
3713
- // 'fontSize'=>'',
3714
- // 'lineHeight'=>'',
3715
- // 'color'=>array('hex8'=>'#000000'),
3716
- // 'backgroundColor'=>array('hex8'=>'#000000'),
3717
- // 'fontFamily'=> '',
3718
- // 'fontWeight'=> '',
3719
- // 'textDecoration'=> '',
3720
- // 'fontStyle'=> '',
3721
- // 'textTransform'=> '',
3722
- // 'textAlign'=> '',
3723
- // 'position'=>'',
3724
- // 'display'=> '',
3725
- // 'float'=> '',
3726
- // 'clear'=> '',
3727
- // 'margin'=>'',
3728
- // 'padding'=>'',
3729
- // 'top'=>'',
3730
- // 'bottom'=>'',
3731
- // 'left'=>'',
3732
- // 'right'=>'',
3733
- // 'height'=>'',
3734
- // 'width'=>'',
3735
- // 'zIndex'=>'',
3736
- // 'transform'=>'',
3737
- // 'transition'=>'',
3738
- // 'opacity'=>'',
3739
- // 'custom_css'=>'',
3740
- //
3741
- //
3742
- // ),
3743
- // ),
3744
- // 'style_hover'=>array(
3745
- //
3746
- // 'options'=>array(
3747
- // 'fontSize'=>'',
3748
- // 'lineHeight'=>'',
3749
- // 'color'=>array('hex8'=>'#000000'),
3750
- // 'backgroundColor'=>array('hex8'=>'#000000'),
3751
- // 'fontFamily'=> '',
3752
- // 'fontWeight'=> '',
3753
- // 'textDecoration'=> '',
3754
- // 'fontStyle'=> '',
3755
- // 'textTransform'=> '',
3756
- // 'textAlign'=> '',
3757
- // 'position'=>'',
3758
- // 'display'=> '',
3759
- // 'float'=> '',
3760
- // 'clear'=> '',
3761
- // 'margin'=>'',
3762
- // 'padding'=>'',
3763
- // 'top'=>'',
3764
- // 'bottom'=>'',
3765
- // 'left'=>'',
3766
- // 'right'=>'',
3767
- // 'height'=>'',
3768
- // 'width'=>'',
3769
- // 'zIndex'=>'',
3770
- // 'transform'=>'',
3771
- // 'transition'=>'',
3772
- // 'opacity'=>'',
3773
- // 'custom_css'=>'',
3774
- // ),
3775
- // ),
3776
- //
3777
- //
3778
- // ),
3779
- //
3780
- //
3781
- // );
3782
- //
3783
- //
3784
- //
3785
- // $elements_data['edd_rating_star'] = array(
3786
- //
3787
- // 'options_group'=>array(
3788
- // 'settings'=>array(
3789
- //
3790
- // 'options'=>array(
3791
- // 'wrapper_tag'=>'',
3792
- // 'custom_class'=>'',
3793
- // 'is_default'=> array('title'=>'Is default star ratings', 'type'=>'select', 'args'=>array('default','custom'), 'value'=>'default'),
3794
- //
3795
- //
3796
- // ),
3797
- // ),
3798
- // 'style_idle'=>array(
3799
- //
3800
- // 'options'=>array(
3801
- // 'fontSize'=>'',
3802
- // 'lineHeight'=>'',
3803
- // 'color'=>array('hex8'=>'#000000'),
3804
- // 'backgroundColor'=>array('hex8'=>'#000000'),
3805
- // 'fontFamily'=> '',
3806
- // 'fontWeight'=> '',
3807
- // 'textDecoration'=> '',
3808
- // 'fontStyle'=> '',
3809
- // 'textTransform'=> '',
3810
- // 'textAlign'=> '',
3811
- // 'position'=>'',
3812
- // 'display'=> '',
3813
- // 'float'=> '',
3814
- // 'clear'=> '',
3815
- // 'margin'=>'',
3816
- // 'padding'=>'',
3817
- // 'top'=>'',
3818
- // 'bottom'=>'',
3819
- // 'left'=>'',
3820
- // 'right'=>'',
3821
- // 'height'=>'',
3822
- // 'width'=>'',
3823
- // 'zIndex'=>'',
3824
- // 'transform'=>'',
3825
- // 'transition'=>'',
3826
- // 'opacity'=>'',
3827
- // 'custom_css'=>'',
3828
- //
3829
- //
3830
- // ),
3831
- // ),
3832
- // 'style_hover'=>array(
3833
- //
3834
- // 'options'=>array(
3835
- // 'fontSize'=>'',
3836
- // 'lineHeight'=>'',
3837
- // 'color'=>array('hex8'=>'#000000'),
3838
- // 'backgroundColor'=>array('hex8'=>'#000000'),
3839
- // 'fontFamily'=> '',
3840
- // 'fontWeight'=> '',
3841
- // 'textDecoration'=> '',
3842
- // 'fontStyle'=> '',
3843
- // 'textTransform'=> '',
3844
- // 'textAlign'=> '',
3845
- // 'position'=>'',
3846
- // 'display'=> '',
3847
- // 'float'=> '',
3848
- // 'clear'=> '',
3849
- // 'margin'=>'',
3850
- // 'padding'=>'',
3851
- // 'top'=>'',
3852
- // 'bottom'=>'',
3853
- // 'left'=>'',
3854
- // 'right'=>'',
3855
- // 'height'=>'',
3856
- // 'width'=>'',
3857
- // 'zIndex'=>'',
3858
- // 'transform'=>'',
3859
- // 'transition'=>'',
3860
- // 'opacity'=>'',
3861
- // 'custom_css'=>'',
3862
- // ),
3863
- // ),
3864
- //
3865
- //
3866
- // ),
3867
- //
3868
- //
3869
- // );
3870
- //
3871
- //
3872
- //
3873
- // $elements_data['edd_rating_text'] = array(
3874
- //
3875
- // 'options_group'=>array(
3876
- // 'settings'=>array(
3877
- //
3878
- // 'options'=>array(
3879
- // 'wrapper_tag'=>'',
3880
- // 'custom_class'=>'',
3881
- //
3882
- //
3883
- //
3884
- // ),
3885
- // ),
3886
- // 'style_idle'=>array(
3887
- //
3888
- // 'options'=>array(
3889
- // 'fontSize'=>'',
3890
- // 'lineHeight'=>'',
3891
- // 'color'=>array('hex8'=>'#000000'),
3892
- // 'backgroundColor'=>array('hex8'=>'#000000'),
3893
- // 'fontFamily'=> '',
3894
- // 'fontWeight'=> '',
3895
- // 'textDecoration'=> '',
3896
- // 'fontStyle'=> '',
3897
- // 'textTransform'=> '',
3898
- // 'textAlign'=> '',
3899
- // 'position'=>'',
3900
- // 'display'=> '',
3901
- // 'float'=> '',
3902
- // 'clear'=> '',
3903
- // 'margin'=>'',
3904
- // 'padding'=>'',
3905
- // 'top'=>'',
3906
- // 'bottom'=>'',
3907
- // 'left'=>'',
3908
- // 'right'=>'',
3909
- // 'height'=>'',
3910
- // 'width'=>'',
3911
- // 'zIndex'=>'',
3912
- // 'transform'=>'',
3913
- // 'transition'=>'',
3914
- // 'opacity'=>'',
3915
- // 'custom_css'=>'',
3916
- //
3917
- //
3918
- // ),
3919
- // ),
3920
- // 'style_hover'=>array(
3921
- //
3922
- // 'options'=>array(
3923
- // 'fontSize'=>'',
3924
- // 'lineHeight'=>'',
3925
- // 'color'=>array('hex8'=>'#000000'),
3926
- // 'backgroundColor'=>array('hex8'=>'#000000'),
3927
- // 'fontFamily'=> '',
3928
- // 'fontWeight'=> '',
3929
- // 'textDecoration'=> '',
3930
- // 'fontStyle'=> '',
3931
- // 'textTransform'=> '',
3932
- // 'textAlign'=> '',
3933
- // 'position'=>'',
3934
- // 'display'=> '',
3935
- // 'float'=> '',
3936
- // 'clear'=> '',
3937
- // 'margin'=>'',
3938
- // 'padding'=>'',
3939
- // 'top'=>'',
3940
- // 'bottom'=>'',
3941
- // 'left'=>'',
3942
- // 'right'=>'',
3943
- // 'height'=>'',
3944
- // 'width'=>'',
3945
- // 'zIndex'=>'',
3946
- // 'transform'=>'',
3947
- // 'transition'=>'',
3948
- // 'opacity'=>'',
3949
- // 'custom_css'=>'',
3950
- // ),
3951
- // ),
3952
- //
3953
- //
3954
- // ),
3955
- //
3956
- //
3957
- // );
3958
- // $elements_data['edd_categories'] = array(
3959
- //
3960
- // 'options_group'=>array(
3961
- // 'settings'=>array(
3962
- //
3963
- // 'options'=>array(
3964
- //
3965
- // 'custom_class'=>'',
3966
- // 'is_linked'=>'',
3967
- // 'max_limit'=>'',
3968
- // 'separator'=>'',
3969
- // ),
3970
- // ),
3971
- // 'style_idle'=>array(
3972
- //
3973
- // 'options'=>array(
3974
- // 'fontSize'=>'',
3975
- // 'lineHeight'=>'',
3976
- // 'color'=>array('hex8'=>'#000000'),
3977
- // 'backgroundColor'=>array('hex8'=>'#000000'),
3978
- // 'fontFamily'=> '',
3979
- // 'fontWeight'=> '',
3980
- // 'textDecoration'=> '',
3981
- // 'fontStyle'=> '',
3982
- // 'textTransform'=> '',
3983
- // 'textAlign'=> '',
3984
- // 'position'=>'',
3985
- // 'display'=> '',
3986
- // 'float'=> '',
3987
- // 'clear'=> '',
3988
- // 'margin'=>'',
3989
- // 'padding'=>'',
3990
- // 'top'=>'',
3991
- // 'bottom'=>'',
3992
- // 'left'=>'',
3993
- // 'right'=>'',
3994
- // 'height'=>'',
3995
- // 'width'=>'',
3996
- // 'zIndex'=>'',
3997
- // 'transform'=>'',
3998
- // 'transition'=>'',
3999
- // 'opacity'=>'',
4000
- // 'custom_css'=>'',
4001
- //
4002
- //
4003
- // ),
4004
- // ),
4005
- // 'style_hover'=>array(
4006
- //
4007
- // 'options'=>array(
4008
- // 'fontSize'=>'',
4009
- // 'lineHeight'=>'',
4010
- // 'color'=>array('hex8'=>'#000000'),
4011
- // 'backgroundColor'=>array('hex8'=>'#000000'),
4012
- // 'fontFamily'=> '',
4013
- // 'fontWeight'=> '',
4014
- // 'textDecoration'=> '',
4015
- // 'fontStyle'=> '',
4016
- // 'textTransform'=> '',
4017
- // 'textAlign'=> '',
4018
- // 'position'=>'',
4019
- // 'display'=> '',
4020
- // 'float'=> '',
4021
- // 'clear'=> '',
4022
- // 'margin'=>'',
4023
- // 'padding'=>'',
4024
- // 'top'=>'',
4025
- // 'bottom'=>'',
4026
- // 'left'=>'',
4027
- // 'right'=>'',
4028
- // 'height'=>'',
4029
- // 'width'=>'',
4030
- // 'zIndex'=>'',
4031
- // 'transform'=>'',
4032
- // 'transition'=>'',
4033
- // 'opacity'=>'',
4034
- // 'custom_css'=>'',
4035
- // ),
4036
- // ),
4037
- //
4038
- //
4039
- // ),
4040
- //
4041
- //
4042
- // );
4043
- //
4044
- //
4045
- //
4046
- // $elements_data['edd_tags'] = array(
4047
- //
4048
- // 'options_group'=>array(
4049
- // 'settings'=>array(
4050
- //
4051
- // 'options'=>array(
4052
- //
4053
- // 'custom_class'=>'',
4054
- // 'is_linked'=>'',
4055
- // 'max_limit'=>'',
4056
- // 'separator'=>'',
4057
- // ),
4058
- // ),
4059
- // 'style_idle'=>array(
4060
- //
4061
- // 'options'=>array(
4062
- // 'fontSize'=>'',
4063
- // 'lineHeight'=>'',
4064
- // 'color'=>array('hex8'=>'#000000'),
4065
- // 'backgroundColor'=>array('hex8'=>'#000000'),
4066
- // 'fontFamily'=> '',
4067
- // 'fontWeight'=> '',
4068
- // 'textDecoration'=> '',
4069
- // 'fontStyle'=> '',
4070
- // 'textTransform'=> '',
4071
- // 'textAlign'=> '',
4072
- // 'position'=>'',
4073
- // 'display'=> '',
4074
- // 'float'=> '',
4075
- // 'clear'=> '',
4076
- // 'margin'=>'',
4077
- // 'padding'=>'',
4078
- // 'top'=>'',
4079
- // 'bottom'=>'',
4080
- // 'left'=>'',
4081
- // 'right'=>'',
4082
- // 'height'=>'',
4083
- // 'width'=>'',
4084
- // 'zIndex'=>'',
4085
- // 'transform'=>'',
4086
- // 'transition'=>'',
4087
- // 'opacity'=>'',
4088
- // 'custom_css'=>'',
4089
- //
4090
- //
4091
- // ),
4092
- // ),
4093
- // 'style_hover'=>array(
4094
- //
4095
- // 'options'=>array(
4096
- // 'fontSize'=>'',
4097
- // 'lineHeight'=>'',
4098
- // 'color'=>array('hex8'=>'#000000'),
4099
- // 'backgroundColor'=>array('hex8'=>'#000000'),
4100
- // 'fontFamily'=> '',
4101
- // 'fontWeight'=> '',
4102
- // 'textDecoration'=> '',
4103
- // 'fontStyle'=> '',
4104
- // 'textTransform'=> '',
4105
- // 'textAlign'=> '',
4106
- // 'position'=>'',
4107
- // 'display'=> '',
4108
- // 'float'=> '',
4109
- // 'clear'=> '',
4110
- // 'margin'=>'',
4111
- // 'padding'=>'',
4112
- // 'top'=>'',
4113
- // 'bottom'=>'',
4114
- // 'left'=>'',
4115
- // 'right'=>'',
4116
- // 'height'=>'',
4117
- // 'width'=>'',
4118
- // 'zIndex'=>'',
4119
- // 'transform'=>'',
4120
- // 'transition'=>'',
4121
- // 'opacity'=>'',
4122
- // 'custom_css'=>'',
4123
- // ),
4124
- // ),
4125
- //
4126
- //
4127
- // ),
4128
- //
4129
- //
4130
- // );
4131
- //
4132
- //
4133
- // $elements_data['WPeC_old_price'] = array(
4134
- //
4135
- // 'options_group'=>array(
4136
- // 'settings'=>array(
4137
- //
4138
- // 'options'=>array(
4139
- //
4140
- // 'custom_class'=>'',
4141
- // 'wrapper_text'=>'',
4142
- // ),
4143
- // ),
4144
- // 'style_idle'=>array(
4145
- //
4146
- // 'options'=>array(
4147
- // 'fontSize'=>'',
4148
- // 'lineHeight'=>'',
4149
- // 'color'=>array('hex8'=>'#000000'),
4150
- // 'backgroundColor'=>array('hex8'=>'#000000'),
4151
- // 'fontFamily'=> '',
4152
- // 'fontWeight'=> '',
4153
- // 'textDecoration'=> '',
4154
- // 'fontStyle'=> '',
4155
- // 'textTransform'=> '',
4156
- // 'textAlign'=> '',
4157
- // 'position'=>'',
4158
- // 'display'=> '',
4159
- // 'float'=> '',
4160
- // 'clear'=> '',
4161
- // 'margin'=>'',
4162
- // 'padding'=>'',
4163
- // 'top'=>'',
4164
- // 'bottom'=>'',
4165
- // 'left'=>'',
4166
- // 'right'=>'',
4167
- // 'height'=>'',
4168
- // 'width'=>'',
4169
- // 'zIndex'=>'',
4170
- // 'transform'=>'',
4171
- // 'transition'=>'',
4172
- // 'opacity'=>'',
4173
- // 'custom_css'=>'',
4174
- //
4175
- //
4176
- // ),
4177
- // ),
4178
- // 'style_hover'=>array(
4179
- //
4180
- // 'options'=>array(
4181
- // 'fontSize'=>'',
4182
- // 'lineHeight'=>'',
4183
- // 'color'=>array('hex8'=>'#000000'),
4184
- // 'backgroundColor'=>array('hex8'=>'#000000'),
4185
- // 'fontFamily'=> '',
4186
- // 'fontWeight'=> '',
4187
- // 'textDecoration'=> '',
4188
- // 'fontStyle'=> '',
4189
- // 'textTransform'=> '',
4190
- // 'textAlign'=> '',
4191
- // 'position'=>'',
4192
- // 'display'=> '',
4193
- // 'float'=> '',
4194
- // 'clear'=> '',
4195
- // 'margin'=>'',
4196
- // 'padding'=>'',
4197
- // 'top'=>'',
4198
- // 'bottom'=>'',
4199
- // 'left'=>'',
4200
- // 'right'=>'',
4201
- // 'height'=>'',
4202
- // 'width'=>'',
4203
- // 'zIndex'=>'',
4204
- // 'transform'=>'',
4205
- // 'transition'=>'',
4206
- // 'opacity'=>'',
4207
- // 'custom_css'=>'',
4208
- // ),
4209
- // ),
4210
- //
4211
- //
4212
- // ),
4213
- //
4214
- //
4215
- // );
4216
- //
4217
- //
4218
- //
4219
- //
4220
- // $elements_data['WPeC_sale_price'] = array(
4221
- //
4222
- // 'options_group'=>array(
4223
- // 'settings'=>array(
4224
- //
4225
- // 'options'=>array(
4226
- //
4227
- // 'custom_class'=>'',
4228
- // 'wrapper_text'=>'',
4229
- // ),
4230
- // ),
4231
- // 'style_idle'=>array(
4232
- //
4233
- // 'options'=>array(
4234
- // 'fontSize'=>'',
4235
- // 'lineHeight'=>'',
4236
- // 'color'=>array('hex8'=>'#000000'),
4237
- // 'backgroundColor'=>array('hex8'=>'#000000'),
4238
- // 'fontFamily'=> '',
4239
- // 'fontWeight'=> '',
4240
- // 'textDecoration'=> '',
4241
- // 'fontStyle'=> '',
4242
- // 'textTransform'=> '',
4243
- // 'textAlign'=> '',
4244
- // 'position'=>'',
4245
- // 'display'=> '',
4246
- // 'float'=> '',
4247
- // 'clear'=> '',
4248
- // 'margin'=>'',
4249
- // 'padding'=>'',
4250
- // 'top'=>'',
4251
- // 'bottom'=>'',
4252
- // 'left'=>'',
4253
- // 'right'=>'',
4254
- // 'height'=>'',
4255
- // 'width'=>'',
4256
- // 'zIndex'=>'',
4257
- // 'transform'=>'',
4258
- // 'transition'=>'',
4259
- // 'opacity'=>'',
4260
- // 'custom_css'=>'',
4261
- //
4262
- //
4263
- // ),
4264
- // ),
4265
- // 'style_hover'=>array(
4266
- //
4267
- // 'options'=>array(
4268
- // 'fontSize'=>'',
4269
- // 'lineHeight'=>'',
4270
- // 'color'=>array('hex8'=>'#000000'),
4271
- // 'backgroundColor'=>array('hex8'=>'#000000'),
4272
- // 'fontFamily'=> '',
4273
- // 'fontWeight'=> '',
4274
- // 'textDecoration'=> '',
4275
- // 'fontStyle'=> '',
4276
- // 'textTransform'=> '',
4277
- // 'textAlign'=> '',
4278
- // 'position'=>'',
4279
- // 'display'=> '',
4280
- // 'float'=> '',
4281
- // 'clear'=> '',
4282
- // 'margin'=>'',
4283
- // 'padding'=>'',
4284
- // 'top'=>'',
4285
- // 'bottom'=>'',
4286
- // 'left'=>'',
4287
- // 'right'=>'',
4288
- // 'height'=>'',
4289
- // 'width'=>'',
4290
- // 'zIndex'=>'',
4291
- // 'transform'=>'',
4292
- // 'transition'=>'',
4293
- // 'opacity'=>'',
4294
- // 'custom_css'=>'',
4295
- // ),
4296
- // ),
4297
- //
4298
- //
4299
- // ),
4300
- //
4301
- //
4302
- // );
4303
- //
4304
- //
4305
- //
4306
- // $elements_data['WPeC_rating_star'] = array(
4307
- //
4308
- // 'options_group'=>array(
4309
- // 'settings'=>array(
4310
- //
4311
- // 'options'=>array(
4312
- //
4313
- // 'custom_class'=>'',
4314
- // 'wrapper_text'=>'',
4315
- // //'is_default'=> array('title'=>'Is default star ratings', 'type'=>'select', 'args'=>array('default','custom'), 'value'=>'default'),
4316
- //
4317
- //
4318
- // ),
4319
- // ),
4320
- // 'style_idle'=>array(
4321
- //
4322
- // 'options'=>array(
4323
- // 'fontSize'=>'',
4324
- // 'lineHeight'=>'',
4325
- // 'color'=>array('hex8'=>'#000000'),
4326
- // 'backgroundColor'=>array('hex8'=>'#000000'),
4327
- // 'fontFamily'=> '',
4328
- // 'fontWeight'=> '',
4329
- // 'textDecoration'=> '',
4330
- // 'fontStyle'=> '',
4331
- // 'textTransform'=> '',
4332
- // 'position'=>'',
4333
- // 'display'=> '',
4334
- // 'float'=> '',
4335
- // 'clear'=> '',
4336
- // 'margin'=>'',
4337
- // 'padding'=>'',
4338
- // 'top'=>'',
4339
- // 'bottom'=>'',
4340
- // 'left'=>'',
4341
- // 'right'=>'',
4342
- // 'height'=>'',
4343
- // 'width'=>'',
4344
- // 'zIndex'=>'',
4345
- // 'transform'=>'',
4346
- // 'transition'=>'',
4347
- // 'opacity'=>'',
4348
- // 'custom_css'=>'',
4349
- //
4350
- //
4351
- // ),
4352
- // ),
4353
- // 'style_hover'=>array(
4354
- //
4355
- // 'options'=>array(
4356
- // 'fontSize'=>'',
4357
- // 'lineHeight'=>'',
4358
- // 'color'=>array('hex8'=>'#000000'),
4359
- // 'backgroundColor'=>array('hex8'=>'#000000'),
4360
- // 'fontFamily'=> '',
4361
- // 'fontWeight'=> '',
4362
- // 'textDecoration'=> '',
4363
- // 'fontStyle'=> '',
4364
- // 'textTransform'=> '',
4365
- // 'position'=>'',
4366
- // 'display'=> '',
4367
- // 'float'=> '',
4368
- // 'clear'=> '',
4369
- // 'margin'=>'',
4370
- // 'padding'=>'',
4371
- // 'top'=>'',
4372
- // 'bottom'=>'',
4373
- // 'left'=>'',
4374
- // 'right'=>'',
4375
- // 'height'=>'',
4376
- // 'width'=>'',
4377
- // 'zIndex'=>'',
4378
- // 'transform'=>'',
4379
- // 'transition'=>'',
4380
- // 'opacity'=>'',
4381
- // 'custom_css'=>'',
4382
- // ),
4383
- // ),
4384
- //
4385
- //
4386
- // ),
4387
- //
4388
- //
4389
- // );
4390
- //
4391
- //
4392
- //
4393
- // $elements_data['WPeC_categories'] = array(
4394
- //
4395
- // 'options_group'=>array(
4396
- // 'settings'=>array(
4397
- //
4398
- // 'options'=>array(
4399
- //
4400
- // 'custom_class'=>'',
4401
- // 'is_linked'=>'',
4402
- // 'max_limit'=>'',
4403
- // 'separator'=>'',
4404
- // ),
4405
- // ),
4406
- // 'style_idle'=>array(
4407
- //
4408
- // 'options'=>array(
4409
- // 'fontSize'=>'',
4410
- // 'lineHeight'=>'',
4411
- // 'color'=>array('hex8'=>'#000000'),
4412
- // 'backgroundColor'=>array('hex8'=>'#000000'),
4413
- // 'fontFamily'=> '',
4414
- // 'fontWeight'=> '',
4415
- // 'textDecoration'=> '',
4416
- // 'fontStyle'=> '',
4417
- // 'textTransform'=> '',
4418
- // 'position'=>'',
4419
- // 'display'=> '',
4420
- // 'float'=> '',
4421
- // 'clear'=> '',
4422
- // 'margin'=>'',
4423
- // 'padding'=>'',
4424
- // 'top'=>'',
4425
- // 'bottom'=>'',
4426
- // 'left'=>'',
4427
- // 'right'=>'',
4428
- // 'height'=>'',
4429
- // 'width'=>'',
4430
- // 'zIndex'=>'',
4431
- // 'transform'=>'',
4432
- // 'transition'=>'',
4433
- // 'opacity'=>'',
4434
- // 'custom_css'=>'',
4435
- //
4436
- //
4437
- // ),
4438
- // ),
4439
- // 'style_hover'=>array(
4440
- //
4441
- // 'options'=>array(
4442
- // 'fontSize'=>'',
4443
- // 'lineHeight'=>'',
4444
- // 'color'=>array('hex8'=>'#000000'),
4445
- // 'backgroundColor'=>array('hex8'=>'#000000'),
4446
- // 'fontFamily'=> '',
4447
- // 'fontWeight'=> '',
4448
- // 'textDecoration'=> '',
4449
- // 'fontStyle'=> '',
4450
- // 'textTransform'=> '',
4451
- // 'textAlign'=> '',
4452
- // 'position'=>'',
4453
- // 'display'=> '',
4454
- // 'float'=> '',
4455
- // 'clear'=> '',
4456
- // 'margin'=>'',
4457
- // 'padding'=>'',
4458
- // 'top'=>'',
4459
- // 'bottom'=>'',
4460
- // 'left'=>'',
4461
- // 'right'=>'',
4462
- // 'height'=>'',
4463
- // 'width'=>'',
4464
- // 'zIndex'=>'',
4465
- // 'transform'=>'',
4466
- // 'transition'=>'',
4467
- // 'opacity'=>'',
4468
- // 'custom_css'=>'',
4469
- // ),
4470
- // ),
4471
- //
4472
- //
4473
- // ),
4474
- //
4475
- //
4476
- // );
4477
- //
4478
- //
4479
- //
4480
- // $elements_data['WPeC_tags'] = array(
4481
- //
4482
- // 'options_group'=>array(
4483
- // 'settings'=>array(
4484
- //
4485
- // 'options'=>array(
4486
- //
4487
- // 'custom_class'=>'',
4488
- // 'is_linked'=>'',
4489
- // 'max_limit'=>'',
4490
- // 'separator'=>'',
4491
- // ),
4492
- // ),
4493
- // 'style_idle'=>array(
4494
- //
4495
- // 'options'=>array(
4496
- // 'fontSize'=>'',
4497
- // 'lineHeight'=>'',
4498
- // 'color'=>array('hex8'=>'#000000'),
4499
- // 'backgroundColor'=>array('hex8'=>'#000000'),
4500
- // 'fontFamily'=> '',
4501
- // 'fontWeight'=> '',
4502
- // 'textDecoration'=> '',
4503
- // 'fontStyle'=> '',
4504
- // 'textTransform'=> '',
4505
- // 'textAlign'=> '',
4506
- // 'position'=>'',
4507
- // 'display'=> '',
4508
- // 'float'=> '',
4509
- // 'clear'=> '',
4510
- // 'margin'=>'',
4511
- // 'padding'=>'',
4512
- // 'top'=>'',
4513
- // 'bottom'=>'',
4514
- // 'left'=>'',
4515
- // 'right'=>'',
4516
- // 'height'=>'',
4517
- // 'width'=>'',
4518
- // 'zIndex'=>'',
4519
- // 'transform'=>'',
4520
- // 'transition'=>'',
4521
- // 'opacity'=>'',
4522
- // 'custom_css'=>'',
4523
- //
4524
- //
4525
- // ),
4526
- // ),
4527
- // 'style_hover'=>array(
4528
- //
4529
- // 'options'=>array(
4530
- // 'fontSize'=>'',
4531
- // 'lineHeight'=>'',
4532
- // 'color'=>array('hex8'=>'#000000'),
4533
- // 'backgroundColor'=>array('hex8'=>'#000000'),
4534
- // 'fontFamily'=> '',
4535
- // 'fontWeight'=> '',
4536
- // 'textDecoration'=> '',
4537
- // 'fontStyle'=> '',
4538
- // 'textTransform'=> '',
4539
- // 'textAlign'=> '',
4540
- // 'position'=>'',
4541
- // 'display'=> '',
4542
- // 'float'=> '',
4543
- // 'clear'=> '',
4544
- // 'margin'=>'',
4545
- // 'padding'=>'',
4546
- // 'top'=>'',
4547
- // 'bottom'=>'',
4548
- // 'left'=>'',
4549
- // 'right'=>'',
4550
- // 'height'=>'',
4551
- // 'width'=>'',
4552
- // 'zIndex'=>'',
4553
- // 'transform'=>'',
4554
- // 'transition'=>'',
4555
- // 'opacity'=>'',
4556
- // 'custom_css'=>'',
4557
- // ),
4558
- // ),
4559
- //
4560
- //
4561
- // ),
4562
- //
4563
- //
4564
- // );
4565
- //
4566
- //
4567
- //
4568
- //
4569
- //
4570
- //
4571
- //
4572
- //
4573
- // $elements_data['share_button'] = array(
4574
- //
4575
- // 'options_group'=>array(
4576
- // 'settings'=>array(
4577
- //
4578
- // 'options'=>array(
4579
- //
4580
- // 'custom_class'=>'',
4581
- // ),
4582
- // ),
4583
- // 'style_idle'=>array(
4584
- //
4585
- // 'options'=>array(
4586
- // 'fontSize'=>'',
4587
- // 'lineHeight'=>'',
4588
- // 'color'=>array('hex8'=>'#000000'),
4589
- // 'backgroundColor'=>array('hex8'=>'#000000'),
4590
- // 'fontFamily'=> '',
4591
- // 'fontWeight'=> '',
4592
- // 'textDecoration'=> '',
4593
- // 'fontStyle'=> '',
4594
- // 'textTransform'=> '',
4595
- // 'position'=>'',
4596
- // 'display'=> '',
4597
- // 'float'=> '',
4598
- // 'clear'=> '',
4599
- // 'margin'=>'',
4600
- // 'padding'=>'',
4601
- // 'top'=>'',
4602
- // 'bottom'=>'',
4603
- // 'left'=>'',
4604
- // 'right'=>'',
4605
- // 'height'=>'',
4606
- // 'width'=>'',
4607
- // 'zIndex'=>'',
4608
- // 'transform'=>'',
4609
- // 'transition'=>'',
4610
- // 'opacity'=>'',
4611
- // 'custom_css'=>'',
4612
- //
4613
- //
4614
- // ),
4615
- // ),
4616
- // 'style_hover'=>array(
4617
- //
4618
- // 'options'=>array(
4619
- // 'fontSize'=>'',
4620
- // 'lineHeight'=>'',
4621
- // 'color'=>array('hex8'=>'#000000'),
4622
- // 'backgroundColor'=>array('hex8'=>'#000000'),
4623
- // 'fontFamily'=> '',
4624
- // 'fontWeight'=> '',
4625
- // 'textDecoration'=> '',
4626
- // 'fontStyle'=> '',
4627
- // 'textTransform'=> '',
4628
- // 'position'=>'',
4629
- // 'display'=> '',
4630
- // 'float'=> '',
4631
- // 'clear'=> '',
4632
- // 'margin'=>'',
4633
- // 'padding'=>'',
4634
- // 'top'=>'',
4635
- // 'bottom'=>'',
4636
- // 'left'=>'',
4637
- // 'right'=>'',
4638
- // 'height'=>'',
4639
- // 'width'=>'',
4640
- // 'zIndex'=>'',
4641
- // 'transform'=>'',
4642
- // 'transition'=>'',
4643
- // 'opacity'=>'',
4644
- // 'custom_css'=>'',
4645
- // ),
4646
- // ),
4647
- //
4648
- //
4649
- // ),
4650
- //
4651
- //
4652
- // );
4653
- //
4654
- //
4655
- //
4656
- //
4657
- // $elements_data['five_star'] = array(
4658
- //
4659
- // 'options_group'=>array(
4660
- // 'settings'=>array(
4661
- //
4662
- // 'options'=>array(
4663
- // 'wrapper_tag'=>'',
4664
- // 'custom_class'=>'',
4665
- //
4666
- //
4667
- //
4668
- // ),
4669
- // ),
4670
- // 'style_idle'=>array(
4671
- //
4672
- // 'options'=>array(
4673
- // 'fontSize'=>'',
4674
- // 'lineHeight'=>'',
4675
- // 'color'=>array('hex8'=>'#000000'),
4676
- // 'backgroundColor'=>array('hex8'=>'#000000'),
4677
- // 'fontFamily'=> '',
4678
- // 'fontWeight'=> '',
4679
- // 'textDecoration'=> '',
4680
- // 'fontStyle'=> '',
4681
- // 'textTransform'=> '',
4682
- // 'position'=>'',
4683
- // 'display'=> '',
4684
- // 'float'=> '',
4685
- // 'clear'=> '',
4686
- // 'margin'=>'',
4687
- // 'padding'=>'',
4688
- // 'top'=>'',
4689
- // 'bottom'=>'',
4690
- // 'left'=>'',
4691
- // 'right'=>'',
4692
- // 'height'=>'',
4693
- // 'width'=>'',
4694
- // 'zIndex'=>'',
4695
- // 'transform'=>'',
4696
- // 'transition'=>'',
4697
- // 'opacity'=>'',
4698
- // 'custom_css'=>'',
4699
- //
4700
- //
4701
- // ),
4702
- // ),
4703
- // 'style_hover'=>array(
4704
- //
4705
- // 'options'=>array(
4706
- // 'fontSize'=>'',
4707
- // 'lineHeight'=>'',
4708
- // 'color'=>array('hex8'=>'#000000'),
4709
- // 'backgroundColor'=>array('hex8'=>'#000000'),
4710
- // 'fontFamily'=> '',
4711
- // 'fontWeight'=> '',
4712
- // 'textDecoration'=> '',
4713
- // 'fontStyle'=> '',
4714
- // 'textTransform'=> '',
4715
- // 'position'=>'',
4716
- // 'display'=> '',
4717
- // 'float'=> '',
4718
- // 'clear'=> '',
4719
- // 'margin'=>'',
4720
- // 'padding'=>'',
4721
- // 'top'=>'',
4722
- // 'bottom'=>'',
4723
- // 'left'=>'',
4724
- // 'right'=>'',
4725
- // 'height'=>'',
4726
- // 'width'=>'',
4727
- // 'zIndex'=>'',
4728
- // 'transform'=>'',
4729
- // 'transition'=>'',
4730
- // 'opacity'=>'',
4731
- // 'custom_css'=>'',
4732
- // ),
4733
- // ),
4734
- //
4735
- //
4736
- // ),
4737
- //
4738
- //
4739
- // );
4740
- //
4741
- //
4742
- //
4743
- //
4744
- // $elements_data['yith_add_to_wishlist'] = array(
4745
- //
4746
- // 'options_group'=>array(
4747
- // 'settings'=>array(
4748
- //
4749
- // 'options'=>array(
4750
- // 'wrapper_tag'=>'',
4751
- // 'custom_class'=>'',
4752
- // ),
4753
- // ),
4754
- // 'style_idle'=>array(
4755
- //
4756
- // 'options'=>array(
4757
- // 'fontSize'=>'',
4758
- // 'lineHeight'=>'',
4759
- // 'color'=>array('hex8'=>'#000000'),
4760
- // 'backgroundColor'=>array('hex8'=>'#000000'),
4761
- // 'fontFamily'=> '',
4762
- // 'fontWeight'=> '',
4763
- // 'textDecoration'=> '',
4764
- // 'fontStyle'=> '',
4765
- // 'textTransform'=> '',
4766
- // 'position'=>'',
4767
- // 'display'=> '',
4768
- // 'float'=> '',
4769
- // 'clear'=> '',
4770
- // 'margin'=>'',
4771
- // 'padding'=>'',
4772
- // 'top'=>'',
4773
- // 'bottom'=>'',
4774
- // 'left'=>'',
4775
- // 'right'=>'',
4776
- // 'height'=>'',
4777
- // 'width'=>'',
4778
- // 'zIndex'=>'',
4779
- // 'transform'=>'',
4780
- // 'transition'=>'',
4781
- // 'opacity'=>'',
4782
- // 'custom_css'=>'',
4783
- //
4784
- //
4785
- // ),
4786
- // ),
4787
- // 'style_hover'=>array(
4788
- //
4789
- // 'options'=>array(
4790
- // 'fontSize'=>'',
4791
- // 'lineHeight'=>'',
4792
- // 'color'=>array('hex8'=>'#000000'),
4793
- // 'backgroundColor'=>array('hex8'=>'#000000'),
4794
- // 'fontFamily'=> '',
4795
- // 'fontWeight'=> '',
4796
- // 'textDecoration'=> '',
4797
- // 'fontStyle'=> '',
4798
- // 'textTransform'=> '',
4799
- // 'position'=>'',
4800
- // 'display'=> '',
4801
- // 'float'=> '',
4802
- // 'clear'=> '',
4803
- // 'margin'=>'',
4804
- // 'padding'=>'',
4805
- // 'top'=>'',
4806
- // 'bottom'=>'',
4807
- // 'left'=>'',
4808
- // 'right'=>'',
4809
- // 'height'=>'',
4810
- // 'width'=>'',
4811
- // 'zIndex'=>'',
4812
- // 'transform'=>'',
4813
- // 'transition'=>'',
4814
- // 'opacity'=>'',
4815
- // 'custom_css'=>'',
4816
- // ),
4817
- // ),
4818
- // ),
4819
- //
4820
- //
4821
- // );
4822
-
4823
-
4824
-
4825
-
4826
-
4827
- return apply_filters('post_grid_elements_data', $elements_data);
4828
- //return $layout_items;
4829
- }
4830
-
4831
-
4832
-
4833
-
4834
-
4835
-
4836
- }
4837
-
4838
- //new class_post_grid_functions();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/class-metabox-post-grid-layout.php DELETED
@@ -1,186 +0,0 @@
1
- <?php
2
- if ( ! defined('ABSPATH')) exit; // if direct access
3
-
4
- class class_metabox_post_grid_layout{
5
-
6
- public function __construct(){
7
-
8
- //meta box action for "post_grid"
9
- add_action('add_meta_boxes', array($this, 'metabox_post_grid_layout'));
10
- add_action('save_post', array($this, 'metabox_post_grid_layout_save'));
11
-
12
-
13
-
14
- }
15
-
16
-
17
- public function metabox_post_grid_layout($post_type){
18
-
19
- add_meta_box('metabox-post_grid-layout',__('Layout data', 'post-grid'), array($this, 'meta_box_post_grid_layout_data'), 'post_grid_layout', 'normal', 'high');
20
-
21
- }
22
-
23
-
24
-
25
-
26
-
27
-
28
- public function meta_box_post_grid_layout_data($post) {
29
-
30
- // Add an nonce field so we can check for it later.
31
- wp_nonce_field('post_grid_nonce_check', 'post_grid_nonce_check_value');
32
-
33
- // Use get_post_meta to retrieve an existing value from the database.
34
- // $post_grid_data = get_post_meta($post -> ID, 'post_grid_data', true);
35
-
36
- $post_id = $post->ID;
37
-
38
-
39
- $settings_tabs_field = new settings_tabs_field();
40
-
41
- $post_grid_settings_tab = array();
42
-
43
- $post_grid_settings_tab[] = array(
44
- 'id' => 'layout_builder',
45
- 'title' => sprintf(__('%s Layout editor','post-grid'),'<i class="fas fa-qrcode"></i>'),
46
- 'priority' => 4,
47
- 'active' => true,
48
- );
49
-
50
-
51
- $post_grid_settings_tab[] = array(
52
- 'id' => 'custom_scripts',
53
- 'title' => sprintf(__('%s Custom scripts','post-grid'),'<i class="far fa-building"></i>'),
54
- 'priority' => 5,
55
- 'active' => false,
56
- );
57
-
58
-
59
-
60
- $post_grid_settings_tab = apply_filters('post_grid_layout_metabox_navs', $post_grid_settings_tab);
61
-
62
- $tabs_sorted = array();
63
- foreach ($post_grid_settings_tab as $page_key => $tab) $tabs_sorted[$page_key] = isset( $tab['priority'] ) ? $tab['priority'] : 0;
64
- array_multisort($tabs_sorted, SORT_ASC, $post_grid_settings_tab);
65
-
66
-
67
-
68
- wp_enqueue_script('jquery');
69
- wp_enqueue_script('jquery-ui-sortable');
70
- wp_enqueue_script( 'jquery-ui-core' );
71
- wp_enqueue_script('jquery-ui-accordion');
72
- wp_enqueue_script('wp-color-picker');
73
- wp_enqueue_style('wp-color-picker');
74
-
75
-
76
- wp_enqueue_style( 'jquery-ui');
77
- wp_enqueue_style( 'font-awesome-5' );
78
- wp_enqueue_style( 'settings-tabs' );
79
- wp_enqueue_script( 'settings-tabs' );
80
-
81
-
82
- ?>
83
-
84
-
85
- <div class="settings-tabs vertical">
86
- <ul class="tab-navs">
87
- <?php
88
- foreach ($post_grid_settings_tab as $tab){
89
- $id = $tab['id'];
90
- $title = $tab['title'];
91
- $active = $tab['active'];
92
- $data_visible = isset($tab['data_visible']) ? $tab['data_visible'] : '';
93
- $hidden = isset($tab['hidden']) ? $tab['hidden'] : false;
94
- ?>
95
- <li <?php if(!empty($data_visible)): ?> data_visible="<?php echo $data_visible; ?>" <?php endif; ?> class="tab-nav <?php if($hidden) echo 'hidden';?> <?php if($active) echo 'active';?>" data-id="<?php echo $id; ?>"><?php echo $title; ?></li>
96
- <?php
97
- }
98
- ?>
99
- </ul>
100
- <?php
101
- foreach ($post_grid_settings_tab as $tab){
102
- $id = $tab['id'];
103
- $title = $tab['title'];
104
- $active = $tab['active'];
105
- ?>
106
-
107
- <div class="tab-content <?php if($active) echo 'active';?>" id="<?php echo $id; ?>">
108
- <?php
109
- do_action('post_grid_layout_metabox_content_'.$id, $post_id);
110
- ?>
111
- </div>
112
- <?php
113
- }
114
- ?>
115
- </div>
116
- <div class="clear clearfix"></div>
117
-
118
- <?php
119
-
120
-
121
-
122
-
123
-
124
-
125
- //do_action('post_grid_metabox_post_grid_data', $post);
126
-
127
-
128
- }
129
-
130
-
131
-
132
-
133
- public function metabox_post_grid_layout_save($post_id){
134
-
135
- /*
136
- * We need to verify this came from the our screen and with
137
- * proper authorization,
138
- * because save_post can be triggered at other times.
139
- */
140
-
141
- // Check if our nonce is set.
142
- if (!isset($_POST['post_grid_nonce_check_value']))
143
- return $post_id;
144
-
145
- $nonce = $_POST['post_grid_nonce_check_value'];
146
-
147
- // Verify that the nonce is valid.
148
- if (!wp_verify_nonce($nonce, 'post_grid_nonce_check'))
149
- return $post_id;
150
-
151
- // If this is an autosave, our form has not been submitted,
152
- // so we don't want to do anything.
153
- if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
154
- return $post_id;
155
-
156
- // Check the user's permissions.
157
- if ('page' == $_POST['post_type']) {
158
-
159
- if (!current_user_can('edit_page', $post_id))
160
- return $post_id;
161
-
162
- } else {
163
-
164
- if (!current_user_can('edit_post', $post_id))
165
- return $post_id;
166
- }
167
-
168
- /* OK, its safe for us to save the data now. */
169
-
170
- // Sanitize the user input.
171
- //$grid_item_layout = stripslashes_deep($_POST['grid_item_layout']);
172
-
173
-
174
- // Update the meta field.
175
- //update_post_meta($post_id, 'grid_item_layout', $grid_item_layout);
176
-
177
- do_action('post_grid_layout_metabox_save', $post_id);
178
-
179
-
180
-
181
- }
182
-
183
- }
184
-
185
-
186
- new class_metabox_post_grid_layout();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/class-post-grid-meta-box.php DELETED
@@ -1,60 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * @Author pickplugins
5
- * Copyright: 2015 pickplugins
6
- */
7
-
8
- if ( ! defined('ABSPATH')) exit; // if direct access
9
-
10
- if( ! class_exists( 'class_post_grid_meta_box' )){
11
- class class_post_grid_meta_box{
12
-
13
-
14
- function get_query_orderby(){
15
-
16
- $args['ID'] = __('ID','post-grid');
17
- $args['author'] = __('Author','post-grid');
18
- $args['title'] = __('Title','post-grid');
19
- $args['name'] = __('Name','post-grid');
20
- $args['type'] = __('Type','post-grid');
21
- $args['date'] = __('Date','post-grid');
22
- $args['post_date'] = __('post_date','post-grid');
23
- $args['modified'] = __('modified','post-grid');
24
- $args['parent'] = __('Parent','post-grid');
25
- $args['rand'] = __('Random','post-grid');
26
- $args['comment_count'] = __('Comment count','post-grid');
27
- $args['menu_order'] = __('Menu order','post-grid');
28
- $args['meta_value'] = __('Meta value','post-grid');
29
- $args['meta_value_num'] = __('Meta Value(number)','post-grid');
30
- $args['post__in'] = __('post__in','post-grid');
31
- $args['post_name__in'] = __('post_name__in','post-grid');
32
-
33
- return apply_filters('post_grid_orderby', $args);
34
- }
35
-
36
- function get_post_status(){
37
-
38
- $args['publish'] = __('Publish','post-grid');
39
- $args['pending'] = __('Pending','post-grid');
40
- $args['draft'] = __('Draft','post-grid');
41
- $args['auto-draft'] = __('Auto draft','post-grid');
42
- $args['future'] = __('Future','post-grid');
43
- $args['private'] = __('Private','post-grid');
44
- $args['inherit'] = __('Inherit','post-grid');
45
- $args['trash'] = __('Trash','post-grid');
46
- $args['any'] = __('Any','post-grid');
47
-
48
-
49
- return apply_filters('post_grid_post_status', $args);
50
- }
51
-
52
-
53
-
54
-
55
-
56
-
57
-
58
-
59
- }
60
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/class-shortcodes.php DELETED
@@ -1,90 +0,0 @@
1
- <?php
2
- if ( ! defined('ABSPATH')) exit; // if direct access
3
-
4
- class class_post_grid_shortcodes{
5
-
6
-
7
- public function __construct(){
8
-
9
- add_shortcode( 'post_grid', array( $this, 'post_grid_new_display' ) );
10
- add_shortcode( 'post_grid_new', array( $this, 'post_grid_new_display' ) );
11
-
12
- }
13
- public function post_grid_new_display($atts, $content = null ){
14
-
15
- $atts = shortcode_atts(
16
- array(
17
- 'id' => "",
18
- ),
19
- $atts
20
- );
21
-
22
- $atts = apply_filters('post_grid_atts',$atts);
23
-
24
- $grid_id = $atts['id'];
25
-
26
-
27
-
28
-
29
- //wp_reset_postdata();
30
-
31
- ob_start();
32
-
33
- if(empty($grid_id)){
34
- echo 'Please provide valid post grid id, ex: <code>[post_grid id="123"]</code>';
35
- return;
36
- }
37
-
38
- //include( post_grid_plugin_dir . 'templates/post-grid.php');
39
-
40
- do_action('post_grid_main', $atts);
41
-
42
-
43
-
44
-
45
- return ob_get_clean();
46
-
47
-
48
- }
49
-
50
-
51
- public function post_grid_display($atts, $content = null ){
52
-
53
- $atts = shortcode_atts(
54
- array(
55
- 'id' => "",
56
- ), $atts);
57
-
58
- $grid_id = $atts['id'];
59
-
60
-
61
-
62
- wp_reset_postdata();
63
- //var_dump(get_the_ID());
64
-
65
- ob_start();
66
-
67
- if(empty($grid_id)){
68
- echo 'Please provide valid post grid id, ex: <code>[post_grid id="123"]</code>';
69
- return;
70
- }
71
-
72
- include( post_grid_plugin_dir . 'templates/post-grid.php');
73
-
74
- wp_enqueue_script( 'post_grid_scripts');
75
- wp_localize_script('post_grid_scripts', 'post_grid_ajax', array('post_grid_ajaxurl' => admin_url('admin-ajax.php')));
76
-
77
- wp_enqueue_script( 'masonry.js' );
78
- wp_enqueue_script( 'imagesloaded.js' );
79
- wp_enqueue_style( 'post-grid-style' );
80
- wp_enqueue_style( 'post-grid-skin' );
81
- //wp_enqueue_style('font-awesome-5' );
82
- wp_enqueue_style('font-awesome-5');
83
- return ob_get_clean();
84
-
85
-
86
- }
87
-
88
- }
89
-
90
- new class_post_grid_shortcodes();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/classes/class-functions.php ADDED
@@ -0,0 +1,314 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * @Author pickplugins
5
+ * Copyright: 2015 pickplugins.com
6
+ */
7
+
8
+ if ( ! defined('ABSPATH')) exit; // if direct access
9
+
10
+ class class_post_grid_functions{
11
+
12
+ public function __construct(){
13
+
14
+
15
+ }
16
+
17
+
18
+ function get_query_orderby(){
19
+
20
+ $args['ID'] = __('ID','post-grid');
21
+ $args['author'] = __('Author','post-grid');
22
+ $args['title'] = __('Title','post-grid');
23
+ $args['name'] = __('Name','post-grid');
24
+ $args['type'] = __('Type','post-grid');
25
+ $args['date'] = __('Date','post-grid');
26
+ $args['post_date'] = __('post_date','post-grid');
27
+ $args['modified'] = __('modified','post-grid');
28
+ $args['parent'] = __('Parent','post-grid');
29
+ $args['rand'] = __('Random','post-grid');
30
+ $args['comment_count'] = __('Comment count','post-grid');
31
+ $args['menu_order'] = __('Menu order','post-grid');
32
+ $args['meta_value'] = __('Meta value','post-grid');
33
+ $args['meta_value_num'] = __('Meta Value(number)','post-grid');
34
+ $args['post__in'] = __('post__in','post-grid');
35
+ $args['post_name__in'] = __('post_name__in','post-grid');
36
+
37
+ return apply_filters('post_grid_orderby', $args);
38
+ }
39
+
40
+ function get_post_status(){
41
+
42
+ $args['publish'] = __('Publish','post-grid');
43
+ $args['pending'] = __('Pending','post-grid');
44
+ $args['draft'] = __('Draft','post-grid');
45
+ $args['auto-draft'] = __('Auto draft','post-grid');
46
+ $args['future'] = __('Future','post-grid');
47
+ $args['private'] = __('Private','post-grid');
48
+ $args['inherit'] = __('Inherit','post-grid');
49
+ $args['trash'] = __('Trash','post-grid');
50
+ $args['any'] = __('Any','post-grid');
51
+
52
+
53
+ return apply_filters('post_grid_post_status', $args);
54
+ }
55
+
56
+
57
+
58
+ public function media_source(){
59
+
60
+ $media_source = array(
61
+
62
+ 'featured_image' =>array('id'=>'featured_image','title'=>__('Featured Image', 'woocommerce-products-slider'),'checked'=>'yes'),
63
+ 'first_image'=>array('id'=>'first_image','title'=>__('First images from content', 'woocommerce-products-slider'),'checked'=>'yes'),
64
+ 'empty_thumb'=>array('id'=>'empty_thumb','title'=>__('Empty thumbnail', 'woocommerce-products-slider'),'checked'=>'yes'),
65
+
66
+
67
+ );
68
+
69
+ $media_source = apply_filters('post_grid_filter_media_source', $media_source);
70
+
71
+ return $media_source;
72
+
73
+
74
+ }
75
+
76
+
77
+ public function layout_items(){
78
+
79
+
80
+
81
+ $layout_items['general'] = array(
82
+
83
+ 'name'=>'General',
84
+ 'description'=>'Default WordPress items for post.',
85
+ 'items'=>array(
86
+
87
+ 'title'=>array(
88
+ 'name'=>'Title',
89
+ 'dummy_html'=>'Lorem Ipsum is simply.',
90
+ 'css'=>'display: block;font-size: 21px;line-height: normal;padding: 5px 10px;text-align: left;',
91
+ ),
92
+
93
+ 'title_link'=>array(
94
+ 'name'=>'Title with Link',
95
+ 'dummy_html'=>'<a href="#">Lorem Ipsum is simply</a>',
96
+ 'css'=>'display: block;font-size: 21px;line-height: normal;padding: 5px 10px;text-align: left;',
97
+ ),
98
+ 'content'=>array(
99
+ 'name'=>'Content',
100
+ 'dummy_html'=>'Lorem',
101
+ 'css'=>'display: block;font-size: 13px;line-height: normal;padding: 5px 10px;text-align: left;',
102
+ ),
103
+ 'read_more'=>array(
104
+ 'name'=>'Read more',
105
+ 'dummy_html'=>'<a href="#">Read more</a>',
106
+ 'css'=>'display: block;font-size: 13px;line-height: normal;padding: 5px 10px;text-align: left;',
107
+ ),
108
+ 'thumb'=>array(
109
+ 'name'=>'Thumbnail',
110
+ 'dummy_html'=>'<img style="width:100%;" src="'.post_grid_plugin_url.'assets/admin/images/thumb.png" />',
111
+ 'css'=>'display: block;font-size: 13px;line-height: normal;padding: 5px 10px;text-align: left;',
112
+ ),
113
+ 'thumb_link'=>array(
114
+ 'name'=>'Thumbnail with Link',
115
+ 'dummy_html'=>'<a href="#"><img style="width:100%;" src="'.post_grid_plugin_url.'assets/admin/images/thumb.png" /></a>',
116
+ 'css'=>'display: block;font-size: 13px;line-height: normal;padding: 5px 10px;text-align: left;',
117
+ ),
118
+ 'excerpt'=>array(
119
+ 'name'=>'Excerpt',
120
+ 'dummy_html'=>'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text',
121
+ 'css'=>'display: block;font-size: 13px;line-height: normal;padding: 5px 10px;text-align: left;',
122
+ ),
123
+ 'excerpt_read_more'=>array(
124
+ 'name'=>'Excerpt with Read more',
125
+ 'dummy_html'=>'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text <a href="#">Read more</a>',
126
+ 'css'=>'display: block;font-size: 13px;line-height: normal;padding: 5px 10px;text-align: left;',
127
+ ),
128
+ 'post_date'=>array(
129
+ 'name'=>'Post date',
130
+ 'dummy_html'=>'18/06/2015',
131
+ 'css'=>'display: block;font-size: 13px;line-height: normal;padding: 5px 10px;text-align: left;',
132
+ ),
133
+ 'author'=>array(
134
+ 'name'=>'Author',
135
+ 'dummy_html'=>'PickPlugins',
136
+ 'css'=>'display: block;font-size: 13px;line-height: normal;padding: 5px 10px;text-align: left;',
137
+ ),
138
+ 'author_link'=>array(
139
+ 'name'=>'Author with Link',
140
+ 'dummy_html'=>'Lorem',
141
+ 'css'=>'display: block;font-size: 13px;line-height: normal;padding: 5px 10px;text-align: left;',
142
+ ),
143
+ 'categories'=>array(
144
+ 'name'=>'Categories',
145
+ 'dummy_html'=>'<a hidden="#">Category 1</a> <a hidden="#">Category 2</a>',
146
+ 'css'=>'display: block;font-size: 13px;line-height: normal;padding: 5px 10px;text-align: left;',
147
+ ),
148
+ 'tags'=>array(
149
+ 'name'=>'Tags',
150
+ 'dummy_html'=>'<a hidden="#">Tags 1</a> <a hidden="#">Tags 2</a>',
151
+ 'css'=>'display: block;font-size: 13px;line-height: normal;padding: 5px 10px;text-align: left;',
152
+ ),
153
+ 'comments_count'=>array(
154
+ 'name'=>'Comments Count',
155
+ 'dummy_html'=>'3 Comments',
156
+ 'css'=>'display: block;font-size: 13px;line-height: normal;padding: 5px 10px;text-align: left;',
157
+ ),
158
+ 'comments'=>array(
159
+ 'name'=>'Comments',
160
+ 'dummy_html'=>'Lorem',
161
+ 'css'=>'display: block;font-size: 13px;line-height: normal;padding: 5px 10px;text-align: left;',
162
+ ),
163
+ 'rating_widget'=>array(
164
+ 'name'=>'Rating-Widget: Star Review System',
165
+ 'dummy_html'=>'Lorem',
166
+ 'css'=>'display: block;font-size: 13px;line-height: normal;padding: 5px 10px;text-align: left;',
167
+ ),
168
+ 'share_button'=>array(
169
+ 'name'=>'Share button',
170
+ 'dummy_html'=>'<i class="fa fa-facebook-square"></i> <i class="fa fa-twitter-square"></i> <i class="fa fa-google-plus-square"></i>',
171
+ 'css'=>'display: block;font-size: 13px;line-height: normal;padding: 5px 10px;text-align: left;',
172
+ ),
173
+
174
+ 'hr'=>array(
175
+ 'name'=>'Horizontal line',
176
+ 'dummy_html'=>'<hr />',
177
+ 'css'=>'display: block;font-size: 13px;line-height: normal;padding: 5px 10px;text-align: left;',
178
+ ),
179
+
180
+ 'five_star'=>array(
181
+ 'name'=>'Five star',
182
+ 'dummy_html'=>'Star',
183
+ 'css'=>'display: block;font-size: 13px;line-height: normal;padding: 5px 10px;text-align: left;',
184
+ ),
185
+
186
+
187
+ ),
188
+
189
+ );
190
+
191
+
192
+ $layout_items = apply_filters('post_grid_filter_layout_items', $layout_items);
193
+
194
+ return $layout_items;
195
+ }
196
+
197
+
198
+ public function layout_content_list(){
199
+
200
+ $layout_content_list = array(
201
+
202
+ 'flat'=>array(
203
+ '0'=>array('key'=>'title_link', 'char_limit'=>'20', 'name'=>'Title with linked', 'css'=>'display: block;font-size: 21px;line-height: normal;padding: 5px 10px;text-align: left; text-decoration: none;', 'css_hover'=>'', ),
204
+ '1'=>array('key'=>'excerpt', 'char_limit'=>'20', 'name'=>'Excerpt', 'css'=>'display: block;font-size: 14px;padding: 5px 10px;text-align: left;', 'css_hover'=>''),
205
+ '2'=>array('key'=>'read_more', 'name'=>'Read more', 'css'=>'display: block;font-size: 12px;font-weight: bold;padding: 0 10px;text-align: left;text-decoration: none;', 'css_hover'=>''),
206
+
207
+ ),
208
+
209
+ 'flat-center'=>array(
210
+ '0'=>array('key'=>'title_link', 'char_limit'=>'20', 'name'=>'Title with linked', 'css'=>'display: block;font-size: 21px;line-height: normal;padding: 5px 10px;text-align: center;text-decoration: none;', 'css_hover'=>''),
211
+ '1'=>array('key'=>'excerpt', 'char_limit'=>'20', 'name'=>'Excerpt', 'css'=>'display: block;font-size: 14px;padding: 5px 10px;text-align: center;', 'css_hover'=>''),
212
+ '2'=>array('key'=>'read_more', 'name'=>'Read more', 'css'=>'display: block;font-size: 12px;font-weight: bold;padding: 0 10px;text-align: center;', 'css_hover'=>''),
213
+
214
+ ),
215
+
216
+ 'flat-right'=>array(
217
+ '0'=>array('key'=>'title_link', 'char_limit'=>'20', 'name'=>'Title with linked', 'css'=>'display: block;font-size: 21px;line-height: normal;padding: 5px 10px;text-align: right;text-decoration: none;', 'css_hover'=>''),
218
+ '1'=>array('key'=>'excerpt', 'char_limit'=>'20', 'name'=>'Excerpt', 'css'=>'display: block;font-size: 14px;padding: 5px 10px;text-align: right;', 'css_hover'=>''),
219
+ '2'=>array('key'=>'read_more', 'name'=>'Read more', 'css'=>'display: block;font-size: 12px;font-weight: bold;padding: 0 10px;text-align: right;', 'css_hover'=>''),
220
+ ),
221
+
222
+ 'flat-left'=>array(
223
+ '0'=>array('key'=>'title_link', 'char_limit'=>'20', 'name'=>'Title with linked', 'css'=>'display: block;font-size: 21px;line-height: normal;padding: 5px 10px;text-align: left;text-decoration: none;', 'css_hover'=>''),
224
+
225
+ '1'=>array('key'=>'excerpt', 'char_limit'=>'20', 'name'=>'Excerpt', 'css'=>'display: block;font-size: 14px;padding: 5px 10px;text-align: left;', 'css_hover'=>''),
226
+ '2'=>array('key'=>'read_more', 'name'=>'Read more', 'css'=>'display: block;font-size: 12px;font-weight: bold;padding: 0 10px;text-align: left;', 'css_hover'=>'')
227
+ ),
228
+
229
+ 'wc-center-price'=>array(
230
+ '0'=>array('key'=>'title_link', 'char_limit'=>'20', 'name'=>'Title with linked', 'css'=>'display: block;font-size: 21px;line-height: normal;padding: 5px 10px;text-align: center;text-decoration: none;', 'css_hover'=>''),
231
+ '1'=>array('key'=>'wc_full_price', 'name'=>'Price', 'css'=>'background:#f9b013;color:#fff;display: inline-block;font-size: 20px;line-height:normal;padding: 0 17px;text-align: center;', 'css_hover'=>''),
232
+ '2'=>array('key'=>'excerpt', 'char_limit'=>'20', 'name'=>'Excerpt', 'css'=>'display: block;font-size: 14px;padding: 5px 10px;text-align: center;', 'css_hover'=>''),
233
+ ),
234
+
235
+ 'wc-center-cart'=>array(
236
+ '0'=>array('key'=>'title_link', 'char_limit'=>'20', 'name'=>'Title with linked', 'css'=>'display: block;font-size: 21px;line-height: normal;padding: 5px 10px;text-align: center;text-decoration: none;', 'css_hover'=>''),
237
+ '1'=>array('key'=>'wc_gallery', 'name'=>'Add to Cart', 'css'=>'color:#555;display: inline-block;font-size: 13px;line-height:normal;padding: 0 17px;text-align: center;', 'css_hover'=>''),
238
+
239
+ '2'=>array('key'=>'excerpt', 'char_limit'=>'20', 'name'=>'Excerpt', 'css'=>'display: block;font-size: 14px;padding: 5px 10px;text-align: center;', 'css_hover'=>''),
240
+ ),
241
+
242
+ );
243
+
244
+ $layout_content_list = apply_filters('post_grid_filter_layout_content_list', $layout_content_list);
245
+
246
+
247
+ return $layout_content_list;
248
+ }
249
+
250
+
251
+
252
+ public function layout_content($layout){
253
+
254
+ $layout_content = $this->layout_content_list();
255
+
256
+ return $layout_content[$layout];
257
+ }
258
+
259
+
260
+ public function skins(){
261
+
262
+ $skins = array(
263
+
264
+
265
+
266
+ 'flat'=> array(
267
+ 'slug'=>'flat',
268
+ 'name'=>'Flat',
269
+ 'thumb_url'=>'',
270
+ ),
271
+ 'flip-x'=> array(
272
+ 'slug'=>'flip-x',
273
+ 'name'=>'Flip-x',
274
+ 'thumb_url'=>'',
275
+ ),
276
+ 'spinright'=>array(
277
+ 'slug'=>'spinright',
278
+ 'name'=>'SpinRight',
279
+ 'thumb_url'=>'',
280
+ ),
281
+ 'thumbgoleft'=>array(
282
+ 'slug'=>'thumbgoleft',
283
+ 'name'=>'ThumbGoLeft',
284
+ 'thumb_url'=>'',
285
+ ),
286
+ 'thumbrounded'=>array(
287
+ 'slug'=>'thumbrounded',
288
+ 'name'=>'ThumbRounded',
289
+ 'thumb_url'=>'',
290
+ ),
291
+ 'contentbottom'=>array(
292
+ 'slug'=>'contentbottom',
293
+ 'name'=>'ContentBottom',
294
+ 'thumb_url'=>'',
295
+ ),
296
+
297
+
298
+
299
+
300
+
301
+ );
302
+
303
+ $skins = apply_filters('post_grid_filter_skins', $skins);
304
+
305
+ return $skins;
306
+
307
+ }
308
+
309
+
310
+
311
+
312
+
313
+ }
314
+
includes/{class-license.php → classes/class-license.php} RENAMED
File without changes
includes/classes/class-meta-boxes.php ADDED
@@ -0,0 +1,699 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined('ABSPATH')) exit; // if direct access
3
+
4
+ class post_grid_meta_boxs{
5
+
6
+ public function __construct(){
7
+
8
+
9
+ // meta box for post_grid
10
+ add_action('add_meta_boxes', array($this, 'post_grid'));
11
+ add_action('save_post', array($this, 'post_grid_save'));
12
+
13
+ // Post options
14
+ add_action('add_meta_boxes', array($this, 'post_options'));
15
+ add_action('save_post', array($this, 'post_options_save'));
16
+
17
+
18
+ //meta box for "post_grid_layout"
19
+ add_action('add_meta_boxes', array($this, 'post_grid_layout'));
20
+ add_action('save_post', array($this, 'post_grid_layout_save'));
21
+
22
+ }
23
+
24
+
25
+ public function post_grid_layout($post_type){
26
+
27
+ add_meta_box('post-grid-layout',__('Layout data', 'post-grid'), array($this, 'post_grid_layout_display'), 'post_grid_layout', 'normal', 'high');
28
+ }
29
+
30
+ public function post_grid($post_type){
31
+
32
+ add_meta_box('post-grid',__('Post Grid Options', 'post-grid'), array($this, 'post_grid_display'), 'post_grid', 'normal', 'high');
33
+ add_meta_box('post-grid-side',__('Post Grid Info', 'post-grid'), array($this, 'post_grid_side'), 'post_grid', 'side', 'low');
34
+
35
+ }
36
+
37
+ public function post_options($post_type){
38
+
39
+ $post_grid_settings = get_option('post_grid_settings');
40
+ $post_options_post_types = isset($post_grid_settings['post_options_post_types']) ? $post_grid_settings['post_options_post_types'] : array('post');
41
+
42
+
43
+ add_meta_box('post-grid-post-option',__('Post Grid - Post Options', 'post-grid'), array($this, 'post_options_display'), $post_options_post_types, 'normal', 'high');
44
+ }
45
+
46
+
47
+
48
+
49
+
50
+ public function post_grid_layout_display($post) {
51
+
52
+ // Add an nonce field so we can check for it later.
53
+ wp_nonce_field('post_grid_nonce_check', 'post_grid_nonce_check_value');
54
+
55
+ $post_id = $post->ID;
56
+
57
+
58
+ $settings_tabs_field = new settings_tabs_field();
59
+
60
+ $post_grid_settings_tab = array();
61
+
62
+ $post_grid_settings_tab[] = array(
63
+ 'id' => 'layout_builder',
64
+ 'title' => sprintf(__('%s Layout editor','post-grid'),'<i class="fas fa-qrcode"></i>'),
65
+ 'priority' => 4,
66
+ 'active' => true,
67
+ );
68
+
69
+
70
+ $post_grid_settings_tab[] = array(
71
+ 'id' => 'custom_scripts',
72
+ 'title' => sprintf(__('%s Custom scripts','post-grid'),'<i class="far fa-building"></i>'),
73
+ 'priority' => 5,
74
+ 'active' => false,
75
+ );
76
+
77
+
78
+
79
+ $post_grid_settings_tab = apply_filters('post_grid_layout_metabox_navs', $post_grid_settings_tab);
80
+
81
+ $tabs_sorted = array();
82
+ foreach ($post_grid_settings_tab as $page_key => $tab) $tabs_sorted[$page_key] = isset( $tab['priority'] ) ? $tab['priority'] : 0;
83
+ array_multisort($tabs_sorted, SORT_ASC, $post_grid_settings_tab);
84
+
85
+
86
+
87
+ wp_enqueue_script('jquery');
88
+ wp_enqueue_script('jquery-ui-sortable');
89
+ wp_enqueue_script( 'jquery-ui-core' );
90
+ wp_enqueue_script('jquery-ui-accordion');
91
+ wp_enqueue_script('wp-color-picker');
92
+ wp_enqueue_style('wp-color-picker');
93
+
94
+
95
+ wp_enqueue_style( 'jquery-ui');
96
+ wp_enqueue_style( 'font-awesome-5' );
97
+ wp_enqueue_style( 'settings-tabs' );
98
+ wp_enqueue_script( 'settings-tabs' );
99
+
100
+
101
+ ?>
102
+
103
+
104
+ <div class="settings-tabs vertical">
105
+ <ul class="tab-navs">
106
+ <?php
107
+ foreach ($post_grid_settings_tab as $tab){
108
+ $id = $tab['id'];
109
+ $title = $tab['title'];
110
+ $active = $tab['active'];
111
+ $data_visible = isset($tab['data_visible']) ? $tab['data_visible'] : '';
112
+ $hidden = isset($tab['hidden']) ? $tab['hidden'] : false;
113
+ ?>
114
+ <li <?php if(!empty($data_visible)): ?> data_visible="<?php echo $data_visible; ?>" <?php endif; ?> class="tab-nav <?php if($hidden) echo 'hidden';?> <?php if($active) echo 'active';?>" data-id="<?php echo $id; ?>"><?php echo $title; ?></li>
115
+ <?php
116
+ }
117
+ ?>
118
+ </ul>
119
+ <?php
120
+ foreach ($post_grid_settings_tab as $tab){
121
+ $id = $tab['id'];
122
+ $title = $tab['title'];
123
+ $active = $tab['active'];
124
+ ?>
125
+
126
+ <div class="tab-content <?php if($active) echo 'active';?>" id="<?php echo $id; ?>">
127
+ <?php
128
+ do_action('post_grid_layout_metabox_content_'.$id, $post_id);
129
+ ?>
130
+ </div>
131
+ <?php
132
+ }
133
+ ?>
134
+ </div>
135
+ <div class="clear clearfix"></div>
136
+
137
+ <?php
138
+
139
+ }
140
+
141
+
142
+
143
+
144
+ public function post_grid_layout_save($post_id){
145
+
146
+ /*
147
+ * We need to verify this came from the our screen and with
148
+ * proper authorization,
149
+ * because save_post can be triggered at other times.
150
+ */
151
+
152
+ // Check if our nonce is set.
153
+ if (!isset($_POST['post_grid_nonce_check_value']))
154
+ return $post_id;
155
+
156
+ $nonce = $_POST['post_grid_nonce_check_value'];
157
+
158
+ // Verify that the nonce is valid.
159
+ if (!wp_verify_nonce($nonce, 'post_grid_nonce_check'))
160
+ return $post_id;
161
+
162
+ // If this is an autosave, our form has not been submitted,
163
+ // so we don't want to do anything.
164
+ if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
165
+ return $post_id;
166
+
167
+ // Check the user's permissions.
168
+ if ('page' == $_POST['post_type']) {
169
+
170
+ if (!current_user_can('edit_page', $post_id))
171
+ return $post_id;
172
+
173
+ } else {
174
+
175
+ if (!current_user_can('edit_post', $post_id))
176
+ return $post_id;
177
+ }
178
+
179
+ /* OK, its safe for us to save the data now. */
180
+
181
+ // Sanitize the user input.
182
+ //$grid_item_layout = stripslashes_deep($_POST['grid_item_layout']);
183
+
184
+
185
+ // Update the meta field.
186
+ //update_post_meta($post_id, 'grid_item_layout', $grid_item_layout);
187
+
188
+ do_action('post_grid_layout_metabox_save', $post_id);
189
+
190
+
191
+
192
+ }
193
+
194
+
195
+
196
+
197
+
198
+
199
+ function post_grid_display( $post ) {
200
+
201
+ global $post;
202
+ wp_nonce_field( 'meta_boxes_post_grid_input', 'meta_boxes_post_grid_input_nonce' );
203
+
204
+ $post_id = $post->ID;
205
+ $post_grid_meta_options = get_post_meta($post_id, 'post_grid_meta_options', true);
206
+
207
+ $grid_type = $post_types = !empty($post_grid_meta_options['grid_type']) ? $post_grid_meta_options['grid_type'] : 'grid';
208
+
209
+ $current_tab = isset($post_grid_meta_options['current_tab']) ? $post_grid_meta_options['current_tab'] : 'query_post';
210
+
211
+ $settings_tabs_field = new settings_tabs_field();
212
+
213
+ $settings_tabs = array();
214
+
215
+
216
+
217
+ $settings_tabs[] = array(
218
+ 'id' => 'shortcode',
219
+ 'title' => sprintf(__('%s Shortcode','post-grid'), '<i class="fas fa-laptop-code"></i>'),
220
+ 'priority' => 5,
221
+ 'active' => ($current_tab == 'shortcode') ? true : false,
222
+ );
223
+
224
+ $settings_tabs[] = array(
225
+ 'id' => 'general',
226
+ 'title' => sprintf(__('%s General','post-grid'), '<i class="fas fa-cogs"></i>'),
227
+ 'priority' => 10,
228
+ 'active' => ($current_tab == 'general') ? true : false,
229
+ );
230
+
231
+ $settings_tabs[] = array(
232
+ 'id' => 'query_post',
233
+ 'title' => sprintf(__('%s Query Post','post-grid'), '<i class="fas fa-cubes"></i>'),
234
+ 'priority' => 15,
235
+ 'active' => ($current_tab == 'query_post') ? true : false,
236
+ );
237
+
238
+ $settings_tabs[] = array(
239
+ 'id' => 'skin_layout',
240
+ 'title' => sprintf(__('%s Skin & Layout (Old)','post-grid'), '<i class="fas fa-magic"></i>'),
241
+ 'priority' => 20,
242
+ 'active' => ($current_tab == 'skin_layout') ? true : false,
243
+ );
244
+
245
+ $settings_tabs[] = array(
246
+ 'id' => 'layouts',
247
+ 'title' => sprintf(__('%s Layouts (New)','post-grid'),'<i class="fas fa-qrcode"></i>'),
248
+ 'priority' => 30,
249
+ 'active' => ($current_tab == 'layouts') ? true : false,
250
+ );
251
+
252
+
253
+
254
+ $settings_tabs[] = array(
255
+ 'id' => 'grid_settings',
256
+ 'title' => sprintf(__('%s Grid settings','post-grid'), '<i class="fas fa-th"></i>'),
257
+ 'priority' => 35,
258
+ 'active' => ($current_tab == 'grid_settings') ? true : false,
259
+ 'data_visible' => 'grid',
260
+ 'hidden' => ($grid_type == 'grid')? false : true ,
261
+ );
262
+
263
+ $settings_tabs[] = array(
264
+ 'id' => 'item_style',
265
+ 'title' => sprintf(__('%s Item style','post-grid'),'<i class="fas fa-qrcode"></i>'),
266
+ 'priority' => 38,
267
+ 'active' => ($current_tab == 'item_style') ? true : false,
268
+ );
269
+
270
+
271
+
272
+ $settings_tabs[] = array(
273
+ 'id' => 'masonry',
274
+ 'title' => sprintf(__('%s Masonry','post-grid'), '<i class="fas fa-th-large"></i>'),
275
+ 'priority' => 40,
276
+ 'active' => ($current_tab == 'masonry') ? true : false,
277
+ 'data_visible' => 'grid glossary timeline filterable',
278
+ 'hidden' => ($grid_type == 'slider')? true : false ,
279
+ );
280
+
281
+ $settings_tabs[] = array(
282
+ 'id' => 'pagination',
283
+ 'title' => sprintf(__('%s Pagination','post-grid'), '<i class="fas fa-pager"></i>'),
284
+ 'priority' => 45,
285
+ 'active' => ($current_tab == 'pagination') ? true : false,
286
+ 'data_visible' => ' grid glossary timeline filterable collapsible',
287
+ 'hidden' => ($grid_type == 'slider')? true : false ,
288
+ );
289
+
290
+ $settings_tabs[] = array(
291
+ 'id' => 'custom_scripts',
292
+ 'title' => sprintf(__('%s Custom Scripts','post-grid'), '<i class="fas fa-code"></i>'),
293
+ 'priority' => 50,
294
+ 'active' => ($current_tab == 'custom_scripts') ? true : false,
295
+ );
296
+
297
+ $settings_tabs[] = array(
298
+ 'id' => 'search',
299
+ 'title' => sprintf(__('%s Search','post-grid'), '<i class="fas fa-search"></i>'),
300
+ 'priority' => 55,
301
+ 'active' => ($current_tab == 'search') ? true : false,
302
+ );
303
+
304
+ $settings_tabs = apply_filters('post_grid_metabox_tabs', $settings_tabs);
305
+
306
+ //var_dump($settings_tabs);
307
+
308
+
309
+ $tabs_sorted = array();
310
+ foreach ($settings_tabs as $page_key => $tab) $tabs_sorted[$page_key] = isset( $tab['priority'] ) ? $tab['priority'] : 0;
311
+ array_multisort($tabs_sorted, SORT_ASC, $settings_tabs);
312
+
313
+
314
+ ?>
315
+
316
+ <div class="post-grid-meta-box">
317
+
318
+ <script>
319
+ jQuery(document).ready(function($){
320
+ $(document).on('click', '.settings-tabs input[name="post_grid_meta_options[grid_type]"]', function(){
321
+ var val = $(this).val();
322
+ console.log( val );
323
+ $('.settings-tabs .tab-navs li').each(function( index ) {
324
+ data_visible = $( this ).attr('data_visible');
325
+ if(typeof data_visible != 'undefined'){
326
+ n = data_visible.indexOf(val);
327
+ if(n<0){
328
+ $( this ).hide();
329
+ }else{
330
+ $( this ).show();
331
+ }
332
+ }else{
333
+ console.log('Not matched: '+ data_visible );
334
+ }
335
+ });
336
+ })
337
+ })
338
+ </script>
339
+
340
+ <div class="settings-tabs vertical">
341
+ <input class="current_tab" type="hidden" name="post_grid_meta_options[current_tab]" value="<?php echo $current_tab; ?>">
342
+
343
+ <?php
344
+
345
+
346
+ $args = array(
347
+ 'id' => 'grid_type',
348
+ 'parent' => 'post_grid_meta_options',
349
+ 'title' => __('View Type','team'),
350
+ 'details' => '',
351
+ 'type' => 'radio',
352
+ 'value' => $grid_type,
353
+ 'default' => '',
354
+ 'args' => apply_filters('post_grid_view_types', array('grid' => 'Normal grid' )),
355
+ );
356
+
357
+ $settings_tabs_field->generate_field($args);
358
+
359
+ ?>
360
+
361
+
362
+ <ul class="tab-navs">
363
+ <?php
364
+ foreach ($settings_tabs as $tab){
365
+ $id = $tab['id'];
366
+ $title = $tab['title'];
367
+ $active = $tab['active'];
368
+ $data_visible = isset($tab['data_visible']) ? $tab['data_visible'] : '';
369
+ $hidden = isset($tab['hidden']) ? $tab['hidden'] : false;
370
+ ?>
371
+ <li <?php if(!empty($data_visible)): ?> data_visible="<?php echo $data_visible; ?>" <?php endif; ?> class="tab-nav <?php if($hidden) echo 'hidden';?> <?php if($active) echo 'active';?>" data-id="<?php echo $id; ?>"><?php echo $title; ?></li>
372
+ <?php
373
+ }
374
+ ?>
375
+ </ul>
376
+ <?php
377
+ foreach ($settings_tabs as $tab){
378
+ $id = $tab['id'];
379
+ $title = $tab['title'];
380
+ $active = $tab['active'];
381
+
382
+
383
+ ?>
384
+
385
+ <div class="tab-content <?php if($active) echo 'active';?>" id="<?php echo $id; ?>">
386
+ <?php
387
+ do_action('post_grid_metabox_tabs_content_'.$id, $tab, $post_id);
388
+ ?>
389
+ </div>
390
+ <?php
391
+ }
392
+ ?>
393
+ </div>
394
+ <div class="clear clearfix"></div>
395
+
396
+ </div>
397
+
398
+
399
+
400
+
401
+
402
+
403
+
404
+
405
+
406
+
407
+ <?php
408
+
409
+
410
+
411
+ }
412
+
413
+
414
+ function post_grid_save( $post_id ) {
415
+
416
+ /*
417
+ * We need to verify this came from the our screen and with proper authorization,
418
+ * because save_post can be triggered at other times.
419
+ */
420
+
421
+ // Check if our nonce is set.
422
+ if ( ! isset( $_POST['meta_boxes_post_grid_input_nonce'] ) )
423
+ return $post_id;
424
+
425
+ $nonce = $_POST['meta_boxes_post_grid_input_nonce'];
426
+
427
+ // Verify that the nonce is valid.
428
+ if ( ! wp_verify_nonce( $nonce, 'meta_boxes_post_grid_input' ) )
429
+ return $post_id;
430
+
431
+ // If this is an autosave, our form has not been submitted, so we don't want to do anything.
432
+ if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
433
+ return $post_id;
434
+
435
+
436
+
437
+ /* OK, its safe for us to save the data now. */
438
+
439
+ // Sanitize user input.
440
+ //$post_grid_collapsible = sanitize_text_field( $_POST['post_grid_collapsible'] );
441
+
442
+
443
+ $post_grid_meta_options = stripslashes_deep( $_POST['post_grid_meta_options'] );
444
+ update_post_meta( $post_id, 'post_grid_meta_options', $post_grid_meta_options );
445
+
446
+
447
+
448
+
449
+
450
+ }
451
+
452
+
453
+ function post_grid_side( $post ) {
454
+
455
+ ?>
456
+ <div class="plugin-help-search">
457
+ <input type="search" value="" placeholder="Start typing">
458
+
459
+ <ul>
460
+
461
+ <?php
462
+ $class_post_grid_support = new class_post_grid_support();
463
+
464
+ $video_tutorials = $class_post_grid_support->video_tutorials();
465
+
466
+ foreach($video_tutorials as $item){
467
+ $url = isset($item['url']) ?$item['url'] : '';
468
+ $title = isset($item['title']) ?$item['title'] : '';
469
+ $keywords = isset($item['keywords']) ? $item['keywords'] : '';
470
+
471
+ ?>
472
+ <li keywords="<?php echo $keywords; ?>" class="item">
473
+ <a target="_blank" href="<?php echo $url; ?>"><i class="far fa-dot-circle"></i> <?php echo $title; ?></a>
474
+
475
+ </li>
476
+ <?php
477
+
478
+ }
479
+
480
+ ?>
481
+
482
+
483
+ </ul>
484
+ </div>
485
+
486
+
487
+
488
+ <style type="text/css">
489
+ .plugin-help-search{}
490
+ .plugin-help-search input[type=search]{
491
+ width: 100%;
492
+ }
493
+ </style>
494
+
495
+ <script>
496
+ jQuery(document).ready(function($){
497
+ jQuery(document).on('keyup', '.plugin-help-search input', function(){
498
+ keyword = jQuery(this).val().toLowerCase();
499
+ content_body = [];
500
+
501
+ console.log(keyword);
502
+
503
+ $('.plugin-help-search li').each(function( index ) {
504
+ $( this ).hide();
505
+ content = $( this ).text().toLowerCase();
506
+ content_body[index] = content;
507
+ n = content_body[index].indexOf(keyword);
508
+ if(n<0){
509
+ $( this ).hide();
510
+ }else{
511
+ $( this ).show();
512
+ }
513
+ });
514
+ })
515
+ })
516
+ </script>
517
+
518
+
519
+
520
+
521
+ <div class="post-grid-meta-box">
522
+
523
+
524
+
525
+
526
+
527
+
528
+ <ul>
529
+ <li>Post Grid Version: <?php echo post_grid_version; ?></li>
530
+ <li>Tested WP: 5.4</li>
531
+
532
+ </ul>
533
+
534
+ <h3>Try Pro</h3>
535
+ <a class="button" href="https://www.pickplugins.com/item/post-grid-create-awesome-grid-from-any-post-type-for-wordpress/?ref=dashboard" target="_blank">Buy Pro</a><p class="description">If you are looking some extra feature you may try our premium version.</p>
536
+
537
+ <h3>Documentation</h3>
538
+ <a class="button" href="https://www.pickplugins.com/documentation/post-grid/?ref=dashboard" target="_blank">Documentation</a><p class="description">Before asking, submitting reviews please take a look on our documentation, may help your issue fast.</p>
539
+
540
+ <h3>Looking for support?</h3>
541
+ <a class="button" href="https://www.pickplugins.com/forum/?ref=dashboard" target="_blank">Create Support Ticket</a><p class="description">Its free and you can ask any question about our plugins and get support fast.</p>
542
+
543
+ <h3>Provide your feedback</h3>
544
+
545
+ <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>
546
+
547
+
548
+
549
+
550
+ <h3>Video Tutorials</h3>
551
+ <p class="description">Some tutorial contain pro features.</p>
552
+ <div class="faq">
553
+ <?php
554
+
555
+
556
+ ?>
557
+
558
+ </div>
559
+
560
+
561
+
562
+
563
+
564
+
565
+
566
+
567
+
568
+
569
+ </div>
570
+ <?php
571
+
572
+ }
573
+
574
+
575
+
576
+ function post_options_display( $post ) {
577
+
578
+ global $post;
579
+ wp_nonce_field( 'post_grid_post_settings_input', 'post_grid_post_settings_input_nonce' );
580
+
581
+ $post_id = $post->ID;
582
+ $post_grid_post_settings = get_post_meta($post_id, 'post_grid_post_settings', true);
583
+
584
+
585
+ $post_grid_settings_tab = array();
586
+ $current_tab = isset($post_grid_post_settings['current_tab']) ? $post_grid_post_settings['current_tab'] : 'options';
587
+
588
+
589
+ $post_grid_settings_tab[] = array(
590
+ 'id' => 'options',
591
+ 'title' => sprintf(__('%s Options','post-grid'), '<i class="fas fas fa-tools"></i>'),
592
+ 'priority' => 1,
593
+ 'active' => ($current_tab == 'options') ? true : false,
594
+ );
595
+ // $post_grid_settings_tab[] = array(
596
+ // 'id' => 'layouts',
597
+ // 'title' => sprintf(__('%s Layouts','post-grid'), '<i class="fas fa-qrcode"></i>'),
598
+ // 'priority' => 2,
599
+ // 'active' => ($current_tab == 'layouts') ? true : false,
600
+ // );
601
+ // $post_grid_settings_tab[] = array(
602
+ // 'id' => 'post_template',
603
+ // 'title' => sprintf(__('%s Post template','post-grid'), '<i class="fas fa-newspaper"></i>'),
604
+ // 'priority' => 2,
605
+ // 'active' => ($current_tab == 'post_template') ? true : false,
606
+ // );
607
+
608
+
609
+
610
+ $post_grid_settings_tabs = apply_filters('post_grid_post_options_tabs', $post_grid_settings_tab);
611
+
612
+
613
+ $tabs_sorted = array();
614
+ foreach ($post_grid_settings_tabs as $page_key => $tab) $tabs_sorted[$page_key] = isset( $tab['priority'] ) ? $tab['priority'] : 0;
615
+ array_multisort($tabs_sorted, SORT_ASC, $post_grid_settings_tabs);
616
+
617
+ $settings_tabs_field = new settings_tabs_field();
618
+ $settings_tabs_field->admin_scripts();
619
+
620
+ ?>
621
+
622
+ <div class="settings-tabs vertical">
623
+ <input class="current_tab" type="hidden" name="post_grid_post_settings[current_tab]" value="<?php echo $current_tab; ?>">
624
+
625
+ <ul class="tab-navs">
626
+ <?php
627
+ foreach ($post_grid_settings_tabs as $tab){
628
+ $id = $tab['id'];
629
+ $title = $tab['title'];
630
+ $active = $tab['active'];
631
+ $data_visible = isset($tab['data_visible']) ? $tab['data_visible'] : '';
632
+ $hidden = isset($tab['hidden']) ? $tab['hidden'] : false;
633
+ ?>
634
+ <li <?php if(!empty($data_visible)): ?> data_visible="<?php echo $data_visible; ?>" <?php endif; ?> class="tab-nav <?php if($hidden) echo 'hidden';?> <?php if($active) echo 'active';?>" data-id="<?php echo $id; ?>"><?php echo $title; ?></li>
635
+ <?php
636
+ }
637
+ ?>
638
+ </ul>
639
+ <?php
640
+ foreach ($post_grid_settings_tabs as $tab){
641
+ $id = $tab['id'];
642
+ $title = $tab['title'];
643
+ $active = $tab['active'];
644
+
645
+
646
+ ?>
647
+
648
+ <div class="tab-content <?php if($active) echo 'active';?>" id="<?php echo $id; ?>">
649
+ <?php
650
+ do_action('post_grid_post_options_content_'.$id, $tab, $post_id);
651
+ ?>
652
+ </div>
653
+ <?php
654
+ }
655
+ ?>
656
+ </div>
657
+ <div class="clear clearfix"></div>
658
+
659
+
660
+ <?php
661
+
662
+ }
663
+
664
+
665
+ function post_options_save( $post_id ) {
666
+
667
+ /*
668
+ * We need to verify this came from the our screen and with proper authorization,
669
+ * because save_post can be triggered at other times.
670
+ */
671
+
672
+ // Check if our nonce is set.
673
+ if ( ! isset( $_POST['post_grid_post_settings_input_nonce'] ) )
674
+ return $post_id;
675
+
676
+ $nonce = $_POST['post_grid_post_settings_input_nonce'];
677
+
678
+ // Verify that the nonce is valid.
679
+ if ( ! wp_verify_nonce( $nonce, 'post_grid_post_settings_input' ) )
680
+ return $post_id;
681
+
682
+ // If this is an autosave, our form has not been submitted, so we don't want to do anything.
683
+ if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
684
+ return $post_id;
685
+
686
+ /* OK, its safe for us to save the data now. */
687
+
688
+ // Sanitize user input.
689
+ $post_grid_post_settings = stripslashes_deep( $_POST['post_grid_post_settings'] );
690
+ update_post_meta( $post_id, 'post_grid_post_settings', $post_grid_post_settings );
691
+
692
+
693
+ }
694
+
695
+
696
+ }
697
+
698
+
699
+ new post_grid_meta_boxs();
includes/{class-settings-tabs.php → classes/class-settings-tabs.php} RENAMED
File without changes
includes/{class-settings.php → classes/class-settings.php} RENAMED
@@ -43,20 +43,20 @@ class class_post_grid_settings{
43
  }
44
 
45
  public function settings(){
46
- include('menu/settings.php');
47
  }
48
 
49
 
50
  public function layout_editor(){
51
- include('menu/layout-editor.php');
52
  }
53
 
54
  public function data_update(){
55
- include('menu/data-update.php');
56
  }
57
 
58
  public function import_layouts(){
59
- include( 'menu/import-layouts.php' );
60
 
61
  }
62
 
43
  }
44
 
45
  public function settings(){
46
+ include(post_grid_plugin_dir.'includes/menu/settings.php');
47
  }
48
 
49
 
50
  public function layout_editor(){
51
+ include(post_grid_plugin_dir.'includes/menu/layout-editor.php');
52
  }
53
 
54
  public function data_update(){
55
+ include(post_grid_plugin_dir.'includes/menu/data-update.php');
56
  }
57
 
58
  public function import_layouts(){
59
+ include( post_grid_plugin_dir.'includes/menu/import-layouts.php' );
60
 
61
  }
62
 
includes/classes/class-shortcodes.php ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined('ABSPATH')) exit; // if direct access
3
+
4
+ class class_post_grid_shortcodes{
5
+
6
+
7
+ public function __construct(){
8
+
9
+ add_shortcode( 'post_grid', array( $this, 'post_grid_new_display' ) );
10
+
11
+ }
12
+
13
+
14
+ public function post_grid_new_display($atts, $content = null ){
15
+
16
+ $atts = shortcode_atts(
17
+ array(
18
+ 'id' => "",
19
+ ),
20
+ $atts
21
+ );
22
+
23
+ $atts = apply_filters('post_grid_atts',$atts);
24
+
25
+ $grid_id = $atts['id'];
26
+
27
+
28
+
29
+
30
+ //wp_reset_postdata();
31
+
32
+ ob_start();
33
+
34
+ if(empty($grid_id)){
35
+ echo 'Please provide valid post grid id, ex: <code>[post_grid id="123"]</code>';
36
+ return;
37
+ }
38
+
39
+ //include( post_grid_plugin_dir . 'templates/post-grid.php');
40
+
41
+ do_action('post_grid_main', $atts);
42
+
43
+
44
+
45
+
46
+ return ob_get_clean();
47
+
48
+
49
+ }
50
+
51
+
52
+
53
+ }
54
+
55
+ new class_post_grid_shortcodes();
includes/functions-post-grid.php ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined('ABSPATH')) exit; // if direct access
3
+
4
+
5
+ add_filter('the_content','post_grid_preview_content');
6
+
7
+ function post_grid_preview_content($content){
8
+
9
+ if(is_singular('post_grid')){
10
+
11
+ $post_id = get_the_id();
12
+
13
+ $content .= do_shortcode('[post_grid id="'.$post_id.'"]');
14
+
15
+ }
16
+
17
+ return $content;
18
+
19
+ }
20
+
21
+
22
+
23
+
24
+
25
+ function post_grid_image_sizes(){
26
+
27
+ $get_intermediate_image_sizes = get_intermediate_image_sizes();
28
+ $image_sizes = array();
29
+
30
+ foreach($get_intermediate_image_sizes as $size_key){
31
+ $size_key_name = str_replace('-', ' ',$size_key);
32
+ $size_key_name = str_replace('_', ' ',$size_key);
33
+ $size_key_name = ucfirst($size_key);
34
+ $image_sizes[$size_key] = $size_key_name;
35
+
36
+ }
37
+
38
+ return $image_sizes;
39
+ }
40
+
41
+
42
+
43
+
44
+
45
+
46
+ function post_grid_posttypes_array(){
47
+
48
+ $post_types_array = array();
49
+ global $wp_post_types;
50
+
51
+ $post_types_all = get_post_types( '', 'names' );
52
+ foreach ( $post_types_all as $post_type ) {
53
+
54
+
55
+ $obj = $wp_post_types[$post_type];
56
+ $post_types_array[$post_type] = $obj->labels->singular_name;
57
+ }
58
+
59
+
60
+ return $post_types_array;
61
+ }
62
+
63
+ function post_grid_get_taxonomies($post_types){
64
+ //$taxonomies = get_taxonomies();
65
+ $taxonomies = get_object_taxonomies( $post_types );
66
+ return $taxonomies;
67
+ //var_dump($taxonomies);
68
+ }
69
+
70
+
includes/functions-single.php CHANGED
@@ -68,6 +68,61 @@ function post_grid_single_post($content){
68
 
69
 
70
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
 
72
 
73
 
68
 
69
 
70
 
71
+ function post_grid_remove_post_title($post_title){
72
+
73
+ $post_id = get_the_ID();
74
+
75
+ $post_grid_post_settings = get_post_meta($post_id, 'post_grid_post_settings', true);
76
+ $remove_post_title = isset($post_grid_post_settings['remove_post_title']) ? $post_grid_post_settings['remove_post_title'] : 'no';
77
+
78
+
79
+ if($remove_post_title =='yes' && in_the_loop()){
80
+
81
+ return '';
82
+ }
83
+ else{
84
+ return $post_title;
85
+ }
86
+
87
+ }
88
+
89
+ //add_filter('the_title','post_grid_remove_post_title');
90
+
91
+
92
+ function post_grid_remove_post_thumbnail($post_thumbnail){
93
+
94
+ $post_id = get_the_ID();
95
+
96
+ $post_grid_post_settings = get_post_meta($post_id, 'post_grid_post_settings', true);
97
+ $remove_post_thumbnail = isset($post_grid_post_settings['remove_post_thumbnail']) ? $post_grid_post_settings['remove_post_thumbnail'] : 'no';
98
+
99
+
100
+ if(is_singular() && $remove_post_thumbnail == 'yes'){
101
+
102
+ return '';
103
+ }
104
+ else{
105
+ return $post_thumbnail;
106
+ }
107
+
108
+ }
109
+
110
+ //add_filter('post_thumbnail_html','post_grid_remove_post_thumbnail');
111
+
112
+
113
+ function post_grid_single_template($single_template) {
114
+ global $post;
115
+
116
+ if ($post->post_type == 'post') {
117
+
118
+ $single_template = post_grid_plugin_dir . 'templates/single/single-template-hook.php';
119
+
120
+ }
121
+ return $single_template;
122
+ }
123
+ //add_filter( 'single_template', 'post_grid_single_template' );
124
+
125
+
126
 
127
 
128
 
includes/functions.php CHANGED
@@ -28,41 +28,6 @@ function post_grid_get_first_post($post_type = 'post'){
28
 
29
 
30
 
31
- function post_grid_intermediate_image_sizes(){
32
-
33
-
34
- $get_intermediate_image_sizes = get_intermediate_image_sizes();
35
- $get_intermediate_image_sizes = array_merge($get_intermediate_image_sizes,array('full'));
36
-
37
- $all_sizes = array();
38
-
39
- foreach($get_intermediate_image_sizes as $size_key){
40
-
41
- $size_key_title = str_replace('_', ' ',$size_key);
42
- $size_key_title = str_replace('-', ' ',$size_key_title);
43
- $all_sizes[$size_key] = ucfirst($size_key_title);
44
- }
45
-
46
- return $all_sizes;
47
-
48
-
49
- }
50
-
51
-
52
-
53
-
54
- function post_grid_filter_layout_items_html($item_id, $item, $item_info){
55
-
56
-
57
- $item_key = $item_info['key'];
58
-
59
- $item['dummy'] = '<div class="element element_'.$item_id.' '.$item_key.'"></div>';
60
-
61
- return $item;
62
-
63
- }
64
-
65
- add_filter('post_grid_filter_layout_items_html','post_grid_filter_layout_items_html', 10, 3);
66
 
67
 
68
 
@@ -97,7 +62,7 @@ function post_grid_get_media($item_post_id, $media_source, $featured_img_size, $
97
  $item_post_permalink = apply_filters('post_grid_item_post_permalink', get_permalink($item_post_id));
98
 
99
  $post_grid_post_settings = get_post_meta($item_post_id, 'post_grid_post_settings');
100
- $item_thumb_placeholder = apply_filters('post_grid_item_thumb_placeholder', post_grid_plugin_url.'assets/frontend/css/images/placeholder.png');
101
 
102
  $custom_thumb_source = isset($post_grid_post_settings[0]['custom_thumb_source']) ? $post_grid_post_settings[0]['custom_thumb_source'] : $item_thumb_placeholder;
103
  $thumb_custom_url = isset($post_grid_post_settings[0]['thumb_custom_url']) ? $post_grid_post_settings[0]['thumb_custom_url'] : '';
@@ -140,10 +105,10 @@ function post_grid_get_media($item_post_id, $media_source, $featured_img_size, $
140
  elseif($media_source == 'empty_thumb'){
141
 
142
  if($thumb_linked=='yes'){
143
- $html_thumb.= '<a class="custom" href="'.$item_post_permalink.'"><img src="'.post_grid_plugin_url.'assets/frontend/css/images/placeholder.png" /></a>';
144
  }
145
  else{
146
- $html_thumb.= '<img class="custom" src="'.post_grid_plugin_url.'assets/frontend/css/images/placeholder.png" />';
147
  }
148
  }
149
  elseif($media_source == 'custom_thumb'){
@@ -549,7 +514,7 @@ function post_grid_media($post_id, $args ){
549
  $link_to = isset($source_args['link_to']) ? $source_args['link_to'] : 'post_link';
550
  $link_target = isset($source_args['link_target']) ? $source_args['link_target'] : '';
551
 
552
- $default_thumb_src = isset($source_args['default_thumb_src']) ? $source_args['default_thumb_src'] : post_grid_plugin_url.'assets/frontend/css/images/placeholder.png';
553
 
554
 
555
  if($link_to=='post_link'){
@@ -727,77 +692,6 @@ function post_grid_term_slug_list($post_id){
727
 
728
 
729
 
730
- function post_grid_meta_query_args($meta_query){
731
-
732
- foreach($meta_query as $key=>$meta_info){
733
-
734
- ?>
735
- <div class="item">
736
- <div class="header">
737
- <span class="remove"><i class="fa fa-times"></i></span>
738
- <span class="move " title="<?php echo __('Move', 'post-grid'); ?>"><i class="fas fa-bars"></i></span>
739
- <span class="expand-collapse " title="<?php echo __('Expand or collapse', 'post-grid'); ?>">
740
- <i class="fas fa-expand"></i>
741
- <i class="fa fa-collapse"></i>
742
- </span>
743
-
744
- <?php echo $key; ?>
745
-
746
- </div>
747
- <div class="options">
748
-
749
- <?php echo __('Key', 'post-grid'); ?><br />
750
- <input type="text" name="post_grid_meta_options[meta_query][<?php echo $key; ?>][key]" value="<?php echo $meta_info['key']; ?>" /><br>
751
- <?php echo __('Value', 'post-grid'); ?><br />
752
- <input type="text" name="post_grid_meta_options[meta_query][<?php echo $key; ?>][value]" value="<?php echo $meta_info['value']; ?>" /><br>
753
- <?php echo __('Compare', 'post-grid'); ?><br />
754
- <input type="text" name="post_grid_meta_options[meta_query][<?php echo $key; ?>][compare]" value="<?php echo $meta_info['compare']; ?>" /><br>
755
- <?php echo __('Type', 'post-grid'); ?><br />
756
- <input type="text" name="post_grid_meta_options[meta_query][<?php echo $key; ?>][type]" value="<?php echo $meta_info['type']; ?>" /><br>
757
-
758
- </div>
759
- </div>
760
- <?php
761
-
762
- }
763
-
764
-
765
- }
766
-
767
-
768
-
769
-
770
-
771
-
772
- function post_grid_posttypes($post_types){
773
-
774
- $html = '';
775
- $html .= '<select post_id="'.get_the_ID().'" class="post_types select2" multiple="multiple" size="6" name="post_grid_meta_options[post_types][]">';
776
-
777
- $post_types_all = get_post_types( '', 'names' );
778
- foreach ( $post_types_all as $post_type ) {
779
-
780
- global $wp_post_types;
781
- $obj = $wp_post_types[$post_type];
782
-
783
- if(in_array($post_type,$post_types)){
784
- $selected = 'selected';
785
- }
786
- else{
787
- $selected = '';
788
- }
789
-
790
- $html .= '<option '.$selected.' value="'.$post_type.'" >'.$obj->labels->singular_name.'</option>';
791
- }
792
-
793
- $html .= '</select>';
794
- return $html;
795
- }
796
-
797
-
798
-
799
-
800
-
801
 
802
 
803
 
@@ -820,9 +714,7 @@ function post_grid_layout_content_ajax(){
820
 
821
  }
822
 
823
- //$layout = $class_post_grid_functions->layout_content($layout_key);
824
-
825
-
826
 
827
  ?>
828
  <div class="<?php echo $layout_key; ?>">
@@ -831,8 +723,6 @@ function post_grid_layout_content_ajax(){
831
  foreach($layout as $item_key=>$item_info){
832
  $item_key = $item_info['key'];
833
  ?>
834
-
835
-
836
  <div class="item <?php echo $item_key; ?>" style=" <?php echo $item_info['css']; ?> ">
837
 
838
  <?php
@@ -1020,27 +910,6 @@ function post_grid_layout_add_elements(){
1020
  $class_post_grid_functions = new class_post_grid_functions();
1021
  $layout_items_group = $class_post_grid_functions->layout_items();
1022
 
1023
- //
1024
- // foreach($layout_items_group as $group_key=>$group_data) {
1025
- //
1026
- // $group_name = $group_data['name'];
1027
- // $group_items = $group_data['items'];
1028
- //
1029
- // $layout_items_list = array();
1030
- //
1031
- // foreach($group_items as $element_key=>$item_info){
1032
- //
1033
- //
1034
- // $layout_items_list[$element_key]['name'] = $item_info['name'];
1035
- // $layout_items_list[$element_key]['dummy_html'] = $item_info['dummy_html'];
1036
- // $layout_items_list[$element_key]['css'] = $item_info['css'];
1037
- //
1038
- // }
1039
- // }
1040
- //
1041
- //
1042
- // update_option('hellO_option', $layout_items_list);
1043
-
1044
 
1045
  $item_name = $layout_items_group[$item_group]['items'][$item_key]['name'];
1046
  $item_html = $layout_items_group[$item_group]['items'][$item_key]['dummy_html'];
28
 
29
 
30
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
 
32
 
33
 
62
  $item_post_permalink = apply_filters('post_grid_item_post_permalink', get_permalink($item_post_id));
63
 
64
  $post_grid_post_settings = get_post_meta($item_post_id, 'post_grid_post_settings');
65
+ $item_thumb_placeholder = apply_filters('post_grid_item_thumb_placeholder', post_grid_plugin_url.'assets/frontend/images/placeholder.png');
66
 
67
  $custom_thumb_source = isset($post_grid_post_settings[0]['custom_thumb_source']) ? $post_grid_post_settings[0]['custom_thumb_source'] : $item_thumb_placeholder;
68
  $thumb_custom_url = isset($post_grid_post_settings[0]['thumb_custom_url']) ? $post_grid_post_settings[0]['thumb_custom_url'] : '';
105
  elseif($media_source == 'empty_thumb'){
106
 
107
  if($thumb_linked=='yes'){
108
+ $html_thumb.= '<a class="custom" href="'.$item_post_permalink.'"><img src="'.post_grid_plugin_url.'assets/frontend/images/placeholder.png" /></a>';
109
  }
110
  else{
111
+ $html_thumb.= '<img class="custom" src="'.post_grid_plugin_url.'assets/frontend/images/placeholder.png" />';
112
  }
113
  }
114
  elseif($media_source == 'custom_thumb'){
514
  $link_to = isset($source_args['link_to']) ? $source_args['link_to'] : 'post_link';
515
  $link_target = isset($source_args['link_target']) ? $source_args['link_target'] : '';
516
 
517
+ $default_thumb_src = isset($source_args['default_thumb_src']) ? $source_args['default_thumb_src'] : post_grid_plugin_url.'assets/frontend/images/placeholder.png';
518
 
519
 
520
  if($link_to=='post_link'){
692
 
693
 
694
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
695
 
696
 
697
 
714
 
715
  }
716
 
717
+
 
 
718
 
719
  ?>
720
  <div class="<?php echo $layout_key; ?>">
723
  foreach($layout as $item_key=>$item_info){
724
  $item_key = $item_info['key'];
725
  ?>
 
 
726
  <div class="item <?php echo $item_key; ?>" style=" <?php echo $item_info['css']; ?> ">
727
 
728
  <?php
910
  $class_post_grid_functions = new class_post_grid_functions();
911
  $layout_items_group = $class_post_grid_functions->layout_items();
912
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
913
 
914
  $item_name = $layout_items_group[$item_group]['items'][$item_key]['name'];
915
  $item_html = $layout_items_group[$item_group]['items'][$item_key]['dummy_html'];
includes/functions/functions-post-grid.php DELETED
@@ -1,218 +0,0 @@
1
- <?php
2
- if ( ! defined('ABSPATH')) exit; // if direct access
3
-
4
-
5
- add_filter('the_content','post_grid_preview_content');
6
-
7
- function post_grid_preview_content($content){
8
-
9
- if(is_singular('post_grid')){
10
-
11
- $post_id = get_the_id();
12
-
13
- $content .= do_shortcode('[post_grid_new id="'.$post_id.'"]');
14
-
15
- }
16
-
17
- return $content;
18
-
19
- }
20
-
21
-
22
- function post_grid_get_glossary_index($wp_query){
23
-
24
- $glossary_index = array();
25
-
26
- if ( $wp_query->have_posts() ) :
27
- while ( $wp_query->have_posts() ) : $wp_query->the_post();
28
- $post_title = get_the_title();
29
-
30
- $glossary_index[] = isset($post_title[0]) ? $post_title[0] : '';
31
-
32
- endwhile;
33
- wp_reset_query();
34
- wp_reset_postdata();
35
- endif;
36
-
37
- return $glossary_index;
38
-
39
- }
40
-
41
-
42
- function post_grid_image_sizes(){
43
-
44
- $get_intermediate_image_sizes = get_intermediate_image_sizes();
45
- $image_sizes = array();
46
-
47
- foreach($get_intermediate_image_sizes as $size_key){
48
- $size_key_name = str_replace('-', ' ',$size_key);
49
- $size_key_name = str_replace('_', ' ',$size_key);
50
- $size_key_name = ucfirst($size_key);
51
- $image_sizes[$size_key] = $size_key_name;
52
-
53
- }
54
-
55
-
56
-
57
- return $image_sizes;
58
- }
59
-
60
-
61
-
62
-
63
-
64
-
65
- function post_grid_posttypes_array(){
66
-
67
- $post_types_array = array();
68
- global $wp_post_types;
69
-
70
- $post_types_all = get_post_types( '', 'names' );
71
- foreach ( $post_types_all as $post_type ) {
72
-
73
-
74
- $obj = $wp_post_types[$post_type];
75
- $post_types_array[$post_type] = $obj->labels->singular_name;
76
- }
77
-
78
-
79
- return $post_types_array;
80
- }
81
-
82
- function post_grid_get_taxonomies($post_types){
83
- //$taxonomies = get_taxonomies();
84
- $taxonomies = get_object_taxonomies( $post_types );
85
- return $taxonomies;
86
- //var_dump($taxonomies);
87
- }
88
-
89
-
90
-
91
- function post_grid_categories_array($post_id){
92
-
93
- if(current_user_can('manage_options')){
94
- if(isset($_POST['post_types'])){
95
-
96
- //var_dump($_POST['post_types']);
97
-
98
- $post_types = stripslashes_deep($_POST['post_types']);
99
- //var_dump($post_types);
100
-
101
- $post_id = sanitize_text_field($_POST['post_id']);
102
- $post_grid_meta_options = get_post_meta( $post_id, 'post_grid_meta_options', true );
103
- //$categories = $post_grid_meta_options['categories'];
104
-
105
- if(!empty($post_grid_meta_options['categories'])){
106
- $categories = $post_grid_meta_options['categories'];
107
- }
108
- else{
109
- $categories = array();
110
- }
111
-
112
-
113
-
114
- }
115
- else{
116
- $post_grid_meta_options = get_post_meta( $post_id, 'post_grid_meta_options', true );
117
-
118
- if(!empty($post_grid_meta_options['post_types'])){
119
- $post_types = $post_grid_meta_options['post_types'];
120
- }
121
- else{
122
- $post_types = array();
123
- }
124
-
125
- //$post_types = $post_grid_meta_options['post_types'];
126
-
127
- if(!empty($post_grid_meta_options['categories'])){
128
- $categories = $post_grid_meta_options['categories'];
129
- }
130
- else{
131
- $categories = array();
132
- }
133
-
134
- //$categories = $post_grid_meta_options['categories'];
135
-
136
-
137
- }
138
-
139
-
140
- if(isset($_POST['post_id'])){
141
- $post_id = sanitize_text_field($_POST['post_id']);
142
- }
143
-
144
-
145
- $taxonomies = get_object_taxonomies( $post_types );
146
-
147
- if(!empty($taxonomies)){
148
-
149
- echo '<select class="categories select2" name="post_grid_meta_options[categories][]" multiple="multiple" size="10">';
150
-
151
- foreach ($taxonomies as $taxonomy ) {
152
-
153
- $the_taxonomy = get_taxonomy($taxonomy);
154
-
155
- $args=array(
156
- 'orderby' => 'name',
157
- 'order' => 'ASC',
158
- 'taxonomy' => $taxonomy,
159
- 'hide_empty' => false,
160
- );
161
-
162
- $categories_all = get_categories($args);
163
-
164
- if(!empty($categories_all)){
165
-
166
- ?>
167
- <option disabled value="<?php echo $taxonomy; ?>" > - - - <?php echo $the_taxonomy->labels->name; ?> - - -</option>
168
-
169
- <?php
170
- foreach($categories_all as $category_info){
171
-
172
- if(in_array($taxonomy.','.$category_info->cat_ID, $categories)){
173
- $selected = 'selected';
174
- }
175
- else{
176
- $selected = '';
177
- }
178
-
179
- ?>
180
- <option <?php echo $selected; ?> value="<?php echo $taxonomy.','.$category_info->cat_ID; ?>" ><?php echo $category_info->cat_name; echo ' (Total Post: '.$category_info->count.')'; ?></option>
181
- <?php
182
-
183
-
184
- }
185
-
186
- }
187
-
188
-
189
- }
190
-
191
- echo '</select>';
192
-
193
- }
194
- else{
195
- echo __('No categories found.', 'post-grid');
196
- }
197
-
198
- }
199
-
200
-
201
-
202
-
203
- if(isset($_POST['post_types'])){
204
- die();
205
- }
206
-
207
-
208
- }
209
-
210
-
211
-
212
-
213
-
214
-
215
-
216
-
217
-
218
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/functions/post-grid-layout-elements.php DELETED
@@ -1,2031 +0,0 @@
1
- <?php
2
- if ( ! defined('ABSPATH')) exit; // if direct access
3
-
4
-
5
- add_action('post_grid_layout_element_wrapper_start', 'post_grid_layout_element_wrapper_start', 10);
6
- function post_grid_layout_element_wrapper_start($args){
7
-
8
- $index = isset($args['index']) ? $args['index'] : '';
9
- $element_class = !empty($index) ? 'element_'.$index : '';
10
-
11
- //echo '<pre>'.var_export($args, true).'</pre>';
12
- $element = isset($args['element']) ? $args['element'] : array();
13
- $wrapper_class = isset($element['wrapper_class']) ? $element['wrapper_class'] : '';
14
- $wrapper_id = isset($element['wrapper_id']) ? $element['wrapper_id'] : '';
15
-
16
-
17
-
18
- ?>
19
- <div class="<?php echo $wrapper_class; ?> <?php echo $element_class; ?>" id="<?php echo $wrapper_id; ?>">
20
- <?php
21
-
22
- }
23
-
24
-
25
- add_action('post_grid_layout_element_css_wrapper_start', 'post_grid_layout_element_css_wrapper_start', 10);
26
- function post_grid_layout_element_css_wrapper_start($args){
27
-
28
-
29
- $index = isset($args['index']) ? $args['index'] : '';
30
- $element = isset($args['element']) ? $args['element'] : array();
31
- $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
32
-
33
- $color = isset($element['color']) ? $element['color'] : '';
34
- $font_size = isset($element['font_size']) ? $element['font_size'] : '';
35
- $font_family = isset($element['font_family']) ? $element['font_family'] : '';
36
- $margin = isset($element['margin']) ? $element['margin'] : '';
37
- $text_align = isset($element['text_align']) ? $element['text_align'] : '';
38
-
39
- $css = isset($element['css']) ? $element['css'] : '';
40
- $css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
41
-
42
- ?>
43
- <style type="text/css">
44
- .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
45
- <?php if(!empty($color)): ?>
46
- color: <?php echo $color; ?>;
47
- <?php endif; ?>
48
- <?php if(!empty($font_size)): ?>
49
- font-size: <?php echo $font_size; ?>;
50
- <?php endif; ?>
51
- <?php if(!empty($font_family)): ?>
52
- font-family: <?php echo $font_family; ?>;
53
- <?php endif; ?>
54
- <?php if(!empty($margin)): ?>
55
- margin: <?php echo $margin; ?>;
56
- <?php endif; ?>
57
- <?php if(!empty($text_align)): ?>
58
- text-align: <?php echo $text_align; ?>;
59
- <?php endif; ?>
60
- <?php if(!empty($css)): ?>
61
- <?php echo $css; ?>
62
- <?php endif; ?>
63
- }
64
- <?php if(!empty($css_hover)): ?>
65
- .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
66
- <?php echo $css_hover; ?>
67
- }
68
- <?php endif; ?>
69
- </style>
70
- <?php
71
- }
72
-
73
-
74
-
75
- add_action('post_grid_layout_element_wrapper_end', 'post_grid_layout_element_wrapper_end', 10);
76
- function post_grid_layout_element_wrapper_end($args){
77
-
78
-
79
- ?>
80
- </div>
81
- <?php
82
-
83
- }
84
-
85
-
86
-
87
-
88
-
89
- add_action('post_grid_layout_element_custom_text', 'post_grid_layout_element_custom_text');
90
- function post_grid_layout_element_custom_text($args){
91
-
92
- $element = isset($args['element']) ? $args['element'] : array();
93
- $elementIndex = isset($args['index']) ? $args['index'] : '';
94
- $post_id = isset($args['post_id']) ? $args['post_id'] : '';
95
-
96
- if(empty($post_id)) return;
97
-
98
- $title = get_the_title($post_id);
99
-
100
- $custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
101
- $text = isset($element['text']) ? $element['text'] : '';
102
-
103
- ?>
104
- <div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> custom_text ">
105
- <?php echo esc_html($text); ?>
106
- </div>
107
- <?php
108
- }
109
-
110
-
111
-
112
- add_action('post_grid_layout_element_css_custom_text', 'post_grid_layout_element_css_custom_text', 10);
113
- function post_grid_layout_element_css_custom_text($args){
114
-
115
-
116
- $index = isset($args['index']) ? $args['index'] : '';
117
- $element = isset($args['element']) ? $args['element'] : array();
118
- $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
119
-
120
- $color = isset($element['color']) ? $element['color'] : '';
121
- $font_size = isset($element['font_size']) ? $element['font_size'] : '';
122
- $font_family = isset($element['font_family']) ? $element['font_family'] : '';
123
- $margin = isset($element['margin']) ? $element['margin'] : '';
124
- $text_align = isset($element['text_align']) ? $element['text_align'] : '';
125
-
126
- $css = isset($element['css']) ? $element['css'] : '';
127
- $css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
128
-
129
- ?>
130
- <style type="text/css">
131
- .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
132
- <?php if(!empty($color)): ?>
133
- color: <?php echo $color; ?>;
134
- <?php endif; ?>
135
- <?php if(!empty($font_size)): ?>
136
- font-size: <?php echo $font_size; ?>;
137
- <?php endif; ?>
138
- <?php if(!empty($font_family)): ?>
139
- font-family: <?php echo $font_family; ?>;
140
- <?php endif; ?>
141
- <?php if(!empty($margin)): ?>
142
- margin: <?php echo $margin; ?>;
143
- <?php endif; ?>
144
- <?php if(!empty($text_align)): ?>
145
- text-align: <?php echo $text_align; ?>;
146
- <?php endif; ?>
147
- <?php if(!empty($css)): ?>
148
- <?php echo $css; ?>
149
- <?php endif; ?>
150
- }
151
- <?php if(!empty($css_hover)): ?>
152
- .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
153
- <?php echo $css_hover; ?>
154
- }
155
- <?php endif; ?>
156
- </style>
157
- <?php
158
- }
159
-
160
-
161
-
162
-
163
- add_action('post_grid_layout_element_title', 'post_grid_layout_element_title');
164
-
165
- function post_grid_layout_element_title($args){
166
-
167
- $element = isset($args['element']) ? $args['element'] : array();
168
- $elementIndex = isset($args['index']) ? $args['index'] : '';
169
-
170
- $post_id = isset($args['post_id']) ? $args['post_id'] : '';
171
-
172
- if(empty($post_id)) return;
173
-
174
- $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
175
-
176
- $post_link = get_permalink($post_id);
177
- $title = get_the_title($post_id);
178
-
179
- $link_target = isset($element['link_target']) ? $element['link_target'] : '';
180
- $custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
181
- $char_limit = isset($element['char_limit']) ? (int) $element['char_limit'] : 0;
182
- $char_end = isset($element['char_end']) ? $element['char_end'] : '...';
183
- $link_to = isset($element['link_to']) ? $element['link_to'] : 'post_link';
184
-
185
-
186
- if($char_limit > 0){
187
- $title = wp_trim_words($title, $char_limit, $char_end);
188
- }
189
-
190
- ?>
191
- <div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> title ">
192
- <?php if($link_to == 'post_link'): ?>
193
- <a target="<?php echo esc_attr($link_target); ?>" href="<?php echo esc_url_raw($post_link); ?>"><?php echo esc_html($title); ?></a>
194
- <?php else: ?>
195
- <?php echo esc_html($title); ?>
196
- <?php endif; ?>
197
-
198
-
199
- </div>
200
- <?php
201
- }
202
-
203
-
204
- add_action('post_grid_layout_element_css_title', 'post_grid_layout_element_css_title', 10);
205
- function post_grid_layout_element_css_title($args){
206
-
207
-
208
- $index = isset($args['index']) ? $args['index'] : '';
209
- $element = isset($args['element']) ? $args['element'] : array();
210
- $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
211
-
212
- $color = isset($element['color']) ? $element['color'] : '';
213
- $font_size = isset($element['font_size']) ? $element['font_size'] : '';
214
- $font_family = isset($element['font_family']) ? $element['font_family'] : '';
215
- $margin = isset($element['margin']) ? $element['margin'] : '';
216
- $text_align = isset($element['text_align']) ? $element['text_align'] : '';
217
- $css = isset($element['css']) ? $element['css'] : '';
218
- $css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
219
-
220
- ?>
221
- <style type="text/css">
222
- .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
223
- <?php if(!empty($color)): ?>
224
- color: <?php echo $color; ?>;
225
- <?php endif; ?>
226
- <?php if(!empty($font_size)): ?>
227
- font-size: <?php echo $font_size; ?>;
228
- <?php endif; ?>
229
- <?php if(!empty($font_family)): ?>
230
- font-family: <?php echo $font_family; ?>;
231
- <?php endif; ?>
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
- .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?> a{
248
- <?php if(!empty($color)): ?>
249
- color: <?php echo $color; ?>;
250
- <?php endif; ?>
251
- <?php if(!empty($font_size)): ?>
252
- font-size: <?php echo $font_size; ?>;
253
- <?php endif; ?>
254
- <?php if(!empty($font_family)): ?>
255
- font-family: <?php echo $font_family; ?>;
256
- <?php endif; ?>
257
- }
258
- </style>
259
- <?php
260
- }
261
-
262
-
263
-
264
-
265
-
266
- add_action('post_grid_layout_element_title_link', 'post_grid_layout_element_title_link');
267
-
268
- function post_grid_layout_element_title_link($args){
269
-
270
- $element = isset($args['element']) ? $args['element'] : array();
271
- $elementIndex = isset($args['index']) ? $args['index'] : '';
272
-
273
- $post_id = isset($args['post_id']) ? $args['post_id'] : '';
274
-
275
- if(empty($post_id)) return;
276
-
277
- $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
278
-
279
-
280
- $title = get_the_title($post_id);
281
- $post_link = get_permalink($post_id);
282
-
283
- $link_to = isset($element['link_to']) ? $element['link_to'] : 'post_link';
284
- $link_target = isset($element['link_target']) ? $element['link_target'] : '';
285
- $custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
286
- $char_limit = isset($element['char_limit']) ? (int) $element['char_limit'] : 0;
287
- $char_end = isset($element['char_end']) ? $element['char_end'] : '...';
288
-
289
-
290
- if($char_limit > 0){
291
- $title = wp_trim_words($title, $char_limit, $char_end);
292
- }
293
-
294
-
295
- ?>
296
- <div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> title_link ">
297
- <?php if($link_to == 'post_link'): ?>
298
- <a target="<?php echo esc_attr($link_target); ?>" href="<?php echo esc_url_raw($post_link); ?>"><?php echo esc_html($title); ?></a>
299
- <?php else: ?>
300
- <?php echo esc_html($title); ?>
301
- <?php endif; ?>
302
- </div>
303
- <?php
304
- }
305
-
306
-
307
-
308
- add_action('post_grid_layout_element_css_title_link', 'post_grid_layout_element_css_title_link', 10);
309
- function post_grid_layout_element_css_title_link($args){
310
-
311
-
312
- $index = isset($args['index']) ? $args['index'] : '';
313
- $element = isset($args['element']) ? $args['element'] : array();
314
- $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
315
-
316
- $color = isset($element['color']) ? $element['color'] : '';
317
- $font_size = isset($element['font_size']) ? $element['font_size'] : '';
318
- $font_family = isset($element['font_family']) ? $element['font_family'] : '';
319
- $margin = isset($element['margin']) ? $element['margin'] : '';
320
- $text_align = isset($element['text_align']) ? $element['text_align'] : '';
321
-
322
- $css = isset($element['css']) ? $element['css'] : '';
323
- $css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
324
-
325
- ?>
326
- <style type="text/css">
327
- .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
328
- <?php if(!empty($color)): ?>
329
- color: <?php echo $color; ?>;
330
- <?php endif; ?>
331
- <?php if(!empty($font_size)): ?>
332
- font-size: <?php echo $font_size; ?>;
333
- <?php endif; ?>
334
- <?php if(!empty($font_family)): ?>
335
- font-family: <?php echo $font_family; ?>;
336
- <?php endif; ?>
337
- <?php if(!empty($margin)): ?>
338
- margin: <?php echo $margin; ?>;
339
- <?php endif; ?>
340
- <?php if(!empty($text_align)): ?>
341
- text-align: <?php echo $text_align; ?>;
342
- <?php endif; ?>
343
- <?php if(!empty($css)): ?>
344
- <?php echo $css; ?>
345
- <?php endif; ?>
346
- }
347
- <?php if(!empty($css_hover)): ?>
348
- .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
349
- <?php echo $css_hover; ?>
350
- }
351
- <?php endif; ?>
352
- .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?> a{
353
- <?php if(!empty($color)): ?>
354
- color: <?php echo $color; ?>;
355
- <?php endif; ?>
356
- <?php if(!empty($font_size)): ?>
357
- font-size: <?php echo $font_size; ?>;
358
- <?php endif; ?>
359
- <?php if(!empty($font_family)): ?>
360
- font-family: <?php echo $font_family; ?>;
361
- <?php endif; ?>
362
- }
363
- </style>
364
- <?php
365
- }
366
-
367
-
368
-
369
- add_action('post_grid_layout_element_content', 'post_grid_layout_element_content');
370
-
371
- function post_grid_layout_element_content($args){
372
-
373
- $element = isset($args['element']) ? $args['element'] : array();
374
- $elementIndex = isset($args['index']) ? $args['index'] : '';
375
-
376
- $post_id = isset($args['post_id']) ? $args['post_id'] : '';
377
-
378
- if(empty($post_id)) return;
379
-
380
- $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
381
-
382
- $post_content = get_the_content($post_id);
383
-
384
-
385
- $custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
386
- $char_limit = isset($element['char_limit']) ? (int) $element['char_limit'] : 0;
387
- $char_end = isset($element['char_end']) ? $element['char_end'] : '...';
388
-
389
-
390
- if($char_limit > 0){
391
- $post_content = wp_trim_words($post_content, $char_limit, $char_end);
392
- }
393
-
394
- $post_content = wpautop($post_content);
395
- $post_content = do_shortcode($post_content);
396
-
397
-
398
- ?>
399
- <div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> content ">
400
- <?php echo ($post_content); ?>
401
- </div>
402
- <?php
403
- }
404
-
405
-
406
-
407
- add_action('post_grid_layout_element_excerpt', 'post_grid_layout_element_excerpt');
408
-
409
- function post_grid_layout_element_excerpt($args){
410
-
411
- $element = isset($args['element']) ? $args['element'] : array();
412
- $elementIndex = isset($args['index']) ? $args['index'] : '';
413
-
414
- $post_id = isset($args['post_id']) ? $args['post_id'] : '';
415
-
416
- if(empty($post_id)) return;
417
-
418
- $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
419
-
420
-
421
-
422
-
423
- //$post_excerpt = get_the_excerpt($post_id);
424
-
425
-
426
- $post_link = get_permalink($post_id);
427
- $excerpt_source = !empty($element['excerpt_source']) ? $element['excerpt_source'] : 'excerpt_content';
428
-
429
- $link_target = isset($element['link_target']) ? $element['link_target'] : '';
430
- $custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
431
- $char_limit = !empty($element['char_limit']) ? (int) $element['char_limit'] : 50;
432
- $read_more_text = isset($element['read_more_text']) ? $element['read_more_text'] : '';
433
-
434
- //var_dump($excerpt_source);
435
-
436
- if($excerpt_source == 'excerpt_field'){
437
-
438
- $the_post = get_post($post_id);
439
- $post_excerpt = isset($the_post->post_excerpt) ? $the_post->post_excerpt : '';
440
- //$post_content = strip_shortcodes( $post_content );
441
- //$post_excerpt = excerpt_remove_blocks( $post_content );
442
-
443
-
444
-
445
- }elseif($excerpt_source == 'content'){
446
-
447
- $the_post = get_post($post_id);
448
- $post_content = isset($the_post->post_content) ? $the_post->post_content : '';
449
- $post_content = strip_shortcodes( $post_content );
450
- $post_excerpt = excerpt_remove_blocks( $post_content );
451
-
452
- }elseif($excerpt_source == 'excerpt_content'){
453
-
454
- $the_post = get_post($post_id);
455
- $post_excerpt = isset($the_post->post_excerpt) ? $the_post->post_excerpt : '';
456
- $post_content = isset($the_post->post_content) ? $the_post->post_content : '';
457
-
458
- $post_excerpt = !empty($post_excerpt) ? $post_excerpt : $post_content;
459
- $post_excerpt = strip_shortcodes( $post_excerpt );
460
- $post_excerpt = excerpt_remove_blocks( $post_excerpt );
461
-
462
- }
463
-
464
-
465
-
466
-
467
- if($char_limit > 0){
468
- $post_excerpt = wp_trim_words($post_excerpt, $char_limit, '');
469
- }
470
-
471
- //var_dump($post_excerpt);
472
-
473
-
474
- ?>
475
- <div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> excerpt ">
476
- <?php echo ($post_excerpt); ?>
477
- <?php
478
- if(!empty($read_more_text)):
479
- ?>
480
- <a target="<?php echo esc_attr($link_target); ?>" href="<?php echo esc_url_raw($post_link); ?>"><?php echo esc_html($read_more_text); ?></a>
481
- <?php
482
- endif;
483
- ?>
484
- </div>
485
- <?php
486
- }
487
-
488
-
489
- add_action('post_grid_layout_element_css_excerpt', 'post_grid_layout_element_css_excerpt', 10);
490
- function post_grid_layout_element_css_excerpt($args){
491
-
492
-
493
- $index = isset($args['index']) ? $args['index'] : '';
494
- $element = isset($args['element']) ? $args['element'] : array();
495
- $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
496
-
497
- $color = isset($element['color']) ? $element['color'] : '';
498
- $font_size = isset($element['font_size']) ? $element['font_size'] : '';
499
- $font_family = isset($element['font_family']) ? $element['font_family'] : '';
500
- $margin = isset($element['margin']) ? $element['margin'] : '';
501
- $text_align = isset($element['text_align']) ? $element['text_align'] : '';
502
-
503
- $css = isset($element['css']) ? $element['css'] : '';
504
- $css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
505
- ?>
506
- <style type="text/css">
507
- .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
508
- <?php if(!empty($color)): ?>
509
- color: <?php echo $color; ?>;
510
- <?php endif; ?>
511
- <?php if(!empty($font_size)): ?>
512
- font-size: <?php echo $font_size; ?>;
513
- <?php endif; ?>
514
- <?php if(!empty($font_family)): ?>
515
- font-family: <?php echo $font_family; ?>;
516
- <?php endif; ?>
517
- <?php if(!empty($margin)): ?>
518
- margin: <?php echo $margin; ?>;
519
- <?php endif; ?>
520
- <?php if(!empty($text_align)): ?>
521
- text-align: <?php echo $text_align; ?>;
522
- <?php endif; ?>
523
- <?php if(!empty($css)): ?>
524
- <?php echo $css; ?>
525
- <?php endif; ?>
526
- }
527
- <?php if(!empty($css_hover)): ?>
528
- .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
529
- <?php echo $css_hover; ?>
530
- }
531
- <?php endif; ?>
532
- .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?> a{
533
- <?php if(!empty($color)): ?>
534
- color: <?php echo $color; ?>;
535
- <?php endif; ?>
536
- <?php if(!empty($font_size)): ?>
537
- font-size: <?php echo $font_size; ?>;
538
- <?php endif; ?>
539
- <?php if(!empty($font_family)): ?>
540
- font-family: <?php echo $font_family; ?>;
541
- <?php endif; ?>
542
- }
543
- </style>
544
- <?php
545
- }
546
-
547
-
548
-
549
-
550
- add_action('post_grid_layout_element_excerpt_read_more', 'post_grid_layout_element_excerpt_read_more');
551
-
552
- function post_grid_layout_element_excerpt_read_more($args){
553
-
554
- $element = isset($args['element']) ? $args['element'] : array();
555
- $elementIndex = isset($args['index']) ? $args['index'] : '';
556
-
557
- $post_id = isset($args['post_id']) ? $args['post_id'] : '';
558
-
559
- if(empty($post_id)) return;
560
-
561
- $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
562
-
563
-
564
-
565
- $post_link = get_permalink($post_id);
566
-
567
- $excerpt_source = !empty($element['excerpt_source']) ? $element['excerpt_source'] : 'excerpt_content';
568
-
569
- $custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
570
- $char_limit = isset($element['char_limit']) ? (int) $element['char_limit'] : 0;
571
- $read_more_text = isset($element['read_more_text']) ? $element['read_more_text'] : '';
572
- $link_target = isset($element['link_target']) ? $element['link_target'] : '';
573
-
574
-
575
- if($excerpt_source == 'excerpt_field'){
576
-
577
- $the_post = get_post($post_id);
578
- $post_excerpt = isset($the_post->post_excerpt) ? $the_post->post_excerpt : '';
579
- //$post_content = strip_shortcodes( $post_content );
580
- //$post_excerpt = excerpt_remove_blocks( $post_content );
581
-
582
-
583
- }elseif($excerpt_source == 'content'){
584
-
585
- $the_post = get_post($post_id);
586
- $post_content = isset($the_post->post_content) ? $the_post->post_content : '';
587
- $post_content = strip_shortcodes( $post_content );
588
- $post_excerpt = excerpt_remove_blocks( $post_content );
589
-
590
- }elseif($excerpt_source == 'excerpt_content'){
591
-
592
- $the_post = get_post($post_id);
593
- $post_excerpt = isset($the_post->post_excerpt) ? $the_post->post_excerpt : '';
594
- $post_content = isset($the_post->post_content) ? $the_post->post_content : '';
595
-
596
- $post_excerpt = !empty($post_excerpt) ? $post_excerpt : $post_content;
597
- $post_excerpt = strip_shortcodes( $post_excerpt );
598
- $post_excerpt = excerpt_remove_blocks( $post_excerpt );
599
-
600
- }
601
-
602
- if($char_limit > 0){
603
- $post_excerpt = wp_trim_words($post_excerpt, $char_limit, '');
604
- }
605
-
606
-
607
- ?>
608
- <div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> excerpt_read_more ">
609
- <?php echo ($post_excerpt); ?>
610
- <a target="<?php echo esc_attr($link_target); ?>" href="<?php echo esc_url_raw($post_link); ?>"><?php echo esc_html($read_more_text); ?></a>
611
-
612
- </div>
613
- <?php
614
- }
615
-
616
-
617
- add_action('post_grid_layout_element_css_excerpt_read_more', 'post_grid_layout_element_css_excerpt_read_more', 10);
618
- function post_grid_layout_element_css_excerpt_read_more($args){
619
-
620
-
621
- $index = isset($args['index']) ? $args['index'] : '';
622
- $element = isset($args['element']) ? $args['element'] : array();
623
- $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
624
-
625
- $color = isset($element['color']) ? $element['color'] : '';
626
- $font_size = isset($element['font_size']) ? $element['font_size'] : '';
627
- $font_family = isset($element['font_family']) ? $element['font_family'] : '';
628
- $margin = isset($element['margin']) ? $element['margin'] : '';
629
- $text_align = isset($element['text_align']) ? $element['text_align'] : '';
630
-
631
- $css = isset($element['css']) ? $element['css'] : '';
632
- $css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
633
- ?>
634
- <style type="text/css">
635
- .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
636
- <?php if(!empty($color)): ?>
637
- color: <?php echo $color; ?>;
638
- <?php endif; ?>
639
- <?php if(!empty($font_size)): ?>
640
- font-size: <?php echo $font_size; ?>;
641
- <?php endif; ?>
642
- <?php if(!empty($font_family)): ?>
643
- font-family: <?php echo $font_family; ?>;
644
- <?php endif; ?>
645
- <?php if(!empty($margin)): ?>
646
- margin: <?php echo $margin; ?>;
647
- <?php endif; ?>
648
- <?php if(!empty($text_align)): ?>
649
- text-align: <?php echo $text_align; ?>;
650
- <?php endif; ?>
651
- <?php if(!empty($css)): ?>
652
- <?php echo $css; ?>
653
- <?php endif; ?>
654
- }
655
- <?php if(!empty($css_hover)): ?>
656
- .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
657
- <?php echo $css_hover; ?>
658
- }
659
- <?php endif; ?>
660
- .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?> a{
661
- <?php if(!empty($color)): ?>
662
- color: <?php echo $color; ?>;
663
- <?php endif; ?>
664
- <?php if(!empty($font_size)): ?>
665
- font-size: <?php echo $font_size; ?>;
666
- <?php endif; ?>
667
- <?php if(!empty($font_family)): ?>
668
- font-family: <?php echo $font_family; ?>;
669
- <?php endif; ?>
670
- }
671
- </style>
672
- <?php
673
- }
674
-
675
-
676
-
677
- add_action('post_grid_layout_element_read_more', 'post_grid_layout_element_read_more');
678
-
679
- function post_grid_layout_element_read_more($args){
680
-
681
- $element = isset($args['element']) ? $args['element'] : array();
682
- $elementIndex = isset($args['index']) ? $args['index'] : '';
683
- $post_id = isset($args['post_id']) ? $args['post_id'] : '';
684
-
685
- if(empty($post_id)) return;
686
-
687
- $post_link = get_permalink($post_id);
688
-
689
-
690
- $custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
691
- $read_more_text = isset($element['read_more_text']) ? $element['read_more_text'] : '';
692
- $link_target = isset($element['link_target']) ? $element['link_target'] : '';
693
- $link_to = isset($element['link_to']) ? $element['link_to'] : 'post_link';
694
-
695
-
696
- ?>
697
- <?php if($link_to == 'post_link'): ?>
698
- <a class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> read_more " target="<?php echo esc_attr($link_target); ?>" href="<?php echo esc_url_raw($post_link); ?>"><?php echo esc_html($read_more_text); ?></a>
699
- <?php else: ?>
700
- <div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> read_more ">
701
- <?php echo esc_html($read_more_text); ?>
702
- </div>
703
- <?php endif; ?>
704
-
705
- <?php
706
- }
707
-
708
-
709
-
710
- add_action('post_grid_layout_element_css_read_more', 'post_grid_layout_element_css_read_more', 10);
711
- function post_grid_layout_element_css_read_more($args){
712
-
713
-
714
- $index = isset($args['index']) ? $args['index'] : '';
715
- $element = isset($args['element']) ? $args['element'] : array();
716
- $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
717
-
718
- $color = isset($element['color']) ? $element['color'] : '';
719
- $font_size = isset($element['font_size']) ? $element['font_size'] : '';
720
- $font_family = isset($element['font_family']) ? $element['font_family'] : '';
721
- $margin = isset($element['margin']) ? $element['margin'] : '';
722
- $text_align = isset($element['text_align']) ? $element['text_align'] : '';
723
-
724
- $css = isset($element['css']) ? $element['css'] : '';
725
- $css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
726
- ?>
727
- <style type="text/css">
728
- .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
729
- <?php if(!empty($color)): ?>
730
- color: <?php echo $color; ?> !important;;
731
- <?php endif; ?>
732
- <?php if(!empty($font_size)): ?>
733
- font-size: <?php echo $font_size; ?>;
734
- <?php endif; ?>
735
- <?php if(!empty($font_family)): ?>
736
- font-family: <?php echo $font_family; ?>;
737
- <?php endif; ?>
738
- <?php if(!empty($margin)): ?>
739
- margin: <?php echo $margin; ?>;
740
- <?php endif; ?>
741
- <?php if(!empty($text_align)): ?>
742
- text-align: <?php echo $text_align; ?>;
743
- <?php endif; ?>
744
- <?php if(!empty($css)): ?>
745
- <?php echo $css; ?>
746
- <?php endif; ?>
747
- }
748
- <?php if(!empty($css_hover)): ?>
749
- .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
750
- <?php echo $css_hover; ?>
751
- }
752
- <?php endif; ?>
753
- .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?> a{
754
- <?php if(!empty($color)): ?>
755
- color: <?php echo $color; ?> !important; ;
756
- <?php endif; ?>
757
- <?php if(!empty($font_size)): ?>
758
- font-size: <?php echo $font_size; ?> !important;;
759
- <?php endif; ?>
760
- <?php if(!empty($font_family)): ?>
761
- font-family: <?php echo $font_family; ?> !important;;
762
- <?php endif; ?>
763
- }
764
- </style>
765
- <?php
766
- }
767
-
768
-
769
- add_action('post_grid_layout_element_media', 'post_grid_layout_element_media');
770
-
771
- function post_grid_layout_element_media($args){
772
-
773
- $element = isset($args['element']) ? $args['element'] : array();
774
- $elementIndex = isset($args['index']) ? $args['index'] : '';
775
- $post_id = isset($args['post_id']) ? $args['post_id'] : '';
776
-
777
- if(empty($post_id)) return;
778
-
779
- $custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
780
- $media_source = isset($element['media_source']) ? $element['media_source'] : '';
781
-
782
- $featured_img_size = !empty($element['featured_img_size']) ? $element['featured_img_size'] : 'full';
783
- $thumb_linked = !empty($element['thumb_linked']) ? $element['thumb_linked'] : 'yes';
784
-
785
- $post_grid_post_settings = get_post_meta($post_id, 'post_grid_post_settings', true);
786
-
787
-
788
- ?>
789
- <div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> element-media ">
790
- <?php
791
-
792
- $html_media = '';
793
-
794
- $is_image = false;
795
- foreach($media_source as $source_id => $source_info){
796
-
797
- $args['source_id'] = $source_id;
798
- $args['source_args'] = $source_info;
799
- $args['post_settings'] = $post_grid_post_settings;
800
-
801
-
802
- //var_dump($source_id);
803
- // var_dump($source_info);
804
-
805
- $is_enable = isset($source_info['enable']) ? $source_info['enable'] : '';
806
-
807
- $media = post_grid_media($post_id, $args);
808
-
809
- if ( $is_image ) continue;
810
-
811
- if($is_enable == 'yes'){
812
- if(!empty($media)){
813
-
814
- $html_media = post_grid_media($post_id, $args);
815
- $is_image = true;
816
- }
817
- else{
818
- $html_media = '';
819
- }
820
- }
821
- }
822
-
823
- echo $html_media;
824
-
825
- ?>
826
-
827
-
828
- </div>
829
- <?php
830
- }
831
-
832
-
833
- add_action('post_grid_layout_element_css_media', 'post_grid_layout_element_css_media', 10);
834
- function post_grid_layout_element_css_media($args){
835
-
836
- //echo '<pre>'.var_export($args, true).'</pre>';
837
- $index = isset($args['index']) ? $args['index'] : '';
838
- $element = isset($args['element']) ? $args['element'] : array();
839
- $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
840
-
841
- $media_height = isset($element['media_height']) ? $element['media_height'] : '';
842
- $thumb_height_large = isset($media_height['large']) ? $media_height['large'] : '';
843
- $thumb_height_medium = isset($media_height['medium']) ? $media_height['medium'] : '';
844
- $thumb_height_small = isset($media_height['small']) ? $media_height['small'] : '';
845
-
846
- $height_large_type = isset($media_height['large_type']) ? $media_height['large_type'] : '';
847
- $height_medium_type = isset($media_height['medium_type']) ? $media_height['medium_type'] : '';
848
- $height_small_type = isset($media_height['small_type']) ? $media_height['small_type'] : '';
849
-
850
- $padding = isset($element['padding']) ? $element['padding'] : '';
851
- $margin = isset($element['margin']) ? $element['margin'] : '';
852
- $css = isset($element['css']) ? $element['css'] : '';
853
- $css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
854
-
855
- //var_dump($css);
856
-
857
- ?>
858
- <style type="text/css">
859
- .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
860
- <?php if(!empty($margin)): ?>
861
- margin: <?php echo $margin; ?>;
862
- <?php endif; ?>
863
- <?php if(!empty($padding)): ?>
864
- padding: <?php echo $padding; ?>;
865
- <?php endif; ?>
866
- overflow: hidden;
867
- <?php if(!empty($css)): ?>
868
- <?php echo $css; ?>
869
- <?php endif; ?>
870
- }
871
- <?php if(!empty($css_hover)): ?>
872
- .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
873
- <?php echo $css_hover; ?>
874
- }
875
- <?php endif; ?>
876
- @media only screen and (min-width: 1024px ){
877
- .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
878
- <?php if($height_large_type =='auto_height'): ?>
879
- height: auto;
880
- <?php elseif ($height_large_type =='fixed_height'): ?>
881
- <?php if(!empty($thumb_height_large)): ?>
882
- height: <?php echo $thumb_height_large; ?>;
883
- <?php endif; ?>
884
- <?php elseif ($height_large_type =='max_height'): ?>
885
- <?php if(!empty($thumb_height_large)): ?>
886
- max-height: <?php echo $thumb_height_large; ?>;
887
- <?php endif; ?>
888
- <?php endif; ?>
889
- }
890
- }
891
- @media only screen and ( min-width: 768px ) and ( max-width: 1023px ) {
892
- .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
893
- <?php if($height_medium_type =='auto_height'): ?>
894
- height: auto;
895
- <?php elseif ($height_medium_type =='fixed_height'): ?>
896
- <?php if(!empty($thumb_height_medium)): ?>
897
- height: <?php echo $thumb_height_medium; ?>;
898
- <?php endif; ?>
899
- <?php elseif ($height_medium_type =='max_height'): ?>
900
- <?php if(!empty($thumb_height_medium)): ?>
901
- max-height: <?php echo $thumb_height_medium; ?>;
902
- <?php endif; ?>
903
- <?php endif; ?>
904
- }
905
- }
906
- @media only screen and ( min-width: 0px ) and ( max-width: 767px ){
907
- .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
908
- <?php if($height_small_type =='auto_height'): ?>
909
- height: auto;
910
- <?php elseif ($height_small_type =='fixed_height'): ?>
911
- <?php if(!empty($thumb_height_small)): ?>
912
- height: <?php echo $thumb_height_small; ?>;
913
- <?php endif; ?>
914
- <?php elseif ($height_small_type =='max_height'): ?>
915
- <?php if(!empty($thumb_height_small)): ?>
916
- max-height: <?php echo $thumb_height_small; ?>;
917
- <?php endif; ?>
918
- <?php endif; ?>
919
- }
920
- }
921
- </style>
922
- <?php
923
- }
924
-
925
-
926
- add_action('post_grid_layout_element_thumb', 'post_grid_layout_element_thumb');
927
-
928
- function post_grid_layout_element_thumb($args){
929
-
930
- $element = isset($args['element']) ? $args['element'] : array();
931
- $elementIndex = isset($args['index']) ? $args['index'] : '';
932
- $post_id = isset($args['post_id']) ? $args['post_id'] : '';
933
-
934
- if(empty($post_id)) return;
935
-
936
- $custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
937
- $default_thumb_src = isset($element['default_thumb_src']) ? $element['default_thumb_src'] : '';
938
- $thumb_size = isset($element['thumb_size']) ? $element['thumb_size'] : 'large';
939
-
940
- $link_target = isset($element['link_target']) ? $element['link_target'] : '';
941
- $link_to = isset($element['link_to']) ? $element['link_to'] : 'post_link';
942
-
943
-
944
- $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post_id), $thumb_size );
945
- $thumb_url = !empty($thumb['0']) ? $thumb['0'] : $default_thumb_src;
946
-
947
- if(empty($thumb_url)) return;
948
-
949
-
950
- $post_link = get_permalink($post_id);
951
-
952
-
953
-
954
- ?>
955
- <div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> thumb ">
956
- <?php
957
- if($link_to == 'post_link'):
958
- ?>
959
- <a target="<?php echo esc_attr($link_target); ?>" href="<?php echo esc_url_raw($post_link); ?>"><img src="<?php echo esc_url_raw($thumb_url); ?>"></a>
960
- <?php
961
- else:
962
- ?>
963
- <img src="<?php echo esc_url_raw($thumb_url); ?>">
964
- <?php
965
-
966
- endif;
967
- ?>
968
-
969
-
970
- </div>
971
- <?php
972
- }
973
-
974
-
975
- add_action('post_grid_layout_element_css_thumb', 'post_grid_layout_element_css_thumb', 10);
976
- function post_grid_layout_element_css_thumb($args){
977
-
978
- //echo '<pre>'.var_export($args, true).'</pre>';
979
- $index = isset($args['index']) ? $args['index'] : '';
980
- $element = isset($args['element']) ? $args['element'] : array();
981
- $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
982
-
983
- $thumb_height = isset($element['thumb_height']) ? $element['thumb_height'] : '';
984
- $thumb_height_large = isset($thumb_height['large']) ? $thumb_height['large'] : '';
985
- $thumb_height_medium = isset($thumb_height['medium']) ? $thumb_height['medium'] : '';
986
- $thumb_height_small = isset($thumb_height['small']) ? $thumb_height['small'] : '';
987
-
988
- $margin = isset($element['margin']) ? $element['margin'] : '';
989
- $css = isset($element['css']) ? $element['css'] : '';
990
- $css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
991
-
992
- ?>
993
- <style type="text/css">
994
- .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
995
- overflow: hidden;
996
- <?php if(!empty($margin)): ?>
997
- margin: <?php echo $margin; ?>;
998
- <?php endif; ?>
999
- }
1000
- @media only screen and (min-width: 1024px ){
1001
- .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
1002
- <?php if(!empty($thumb_height_large)): ?>
1003
- max-height: <?php echo $thumb_height_large; ?>;
1004
- <?php endif; ?>
1005
- }
1006
- }
1007
- @media only screen and ( min-width: 768px ) and ( max-width: 1023px ) {
1008
- .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
1009
- <?php if(!empty($thumb_height_medium)): ?>
1010
- max-height: <?php echo $thumb_height_medium; ?>;
1011
- <?php endif; ?>
1012
- }
1013
- }
1014
- @media only screen and ( min-width: 0px ) and ( max-width: 767px ){
1015
- .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
1016
- <?php if(!empty($thumb_height_small)): ?>
1017
- max-height: <?php echo $thumb_height_small; ?>;
1018
- <?php endif; ?>
1019
- }
1020
- }
1021
- </style>
1022
- <?php
1023
- }
1024
-
1025
-
1026
-
1027
- add_action('post_grid_layout_element_thumb_link', 'post_grid_layout_element_thumb_link');
1028
-
1029
- function post_grid_layout_element_thumb_link($args){
1030
-
1031
- $element = isset($args['element']) ? $args['element'] : array();
1032
- $elementIndex = isset($args['index']) ? $args['index'] : '';
1033
- $post_id = isset($args['post_id']) ? $args['post_id'] : '';
1034
-
1035
- if(empty($post_id)) return;
1036
-
1037
- $custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
1038
- $default_thumb_src = isset($element['default_thumb_src']) ? $element['default_thumb_src'] : '';
1039
- $thumb_size = isset($element['thumb_size']) ? $element['thumb_size'] : 'large';
1040
-
1041
- $link_target = isset($element['link_target']) ? $element['link_target'] : '';
1042
- $link_to = isset($element['link_to']) ? $element['link_to'] : 'post_link';
1043
-
1044
-
1045
- $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post_id), $thumb_size );
1046
- $thumb_url = !empty($thumb['0']) ? $thumb['0'] : $default_thumb_src;
1047
-
1048
- if(empty($thumb_url)) return;
1049
-
1050
-
1051
- $post_link = get_permalink($post_id);
1052
-
1053
-
1054
-
1055
- ?>
1056
- <div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> thumb_link ">
1057
- <?php
1058
- if($link_to == 'post_link'):
1059
- ?>
1060
- <a target="<?php echo esc_attr($link_target); ?>" href="<?php echo esc_url_raw($post_link); ?>"><img src="<?php echo esc_url_raw($thumb_url); ?>"></a>
1061
- <?php
1062
- else:
1063
- ?>
1064
- <img src="<?php echo esc_url_raw($thumb_url); ?>">
1065
- <?php
1066
-
1067
- endif;
1068
- ?>
1069
-
1070
-
1071
- </div>
1072
- <?php
1073
- }
1074
-
1075
-
1076
- add_action('post_grid_layout_element_css_thumb_link', 'post_grid_layout_element_css_thumb_link', 10);
1077
- function post_grid_layout_element_css_thumb_link($args){
1078
-
1079
- //echo '<pre>'.var_export($args, true).'</pre>';
1080
- $index = isset($args['index']) ? $args['index'] : '';
1081
- $element = isset($args['element']) ? $args['element'] : array();
1082
- $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
1083
-
1084
- $thumb_height = isset($element['thumb_height']) ? $element['thumb_height'] : '';
1085
- $thumb_height_large = isset($thumb_height['large']) ? $thumb_height['large'] : '';
1086
- $thumb_height_medium = isset($thumb_height['medium']) ? $thumb_height['medium'] : '';
1087
- $thumb_height_small = isset($thumb_height['small']) ? $thumb_height['small'] : '';
1088
-
1089
- $margin = isset($element['margin']) ? $element['margin'] : '';
1090
- $css = isset($element['css']) ? $element['css'] : '';
1091
- $css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
1092
-
1093
- ?>
1094
- <style type="text/css">
1095
- .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
1096
- overflow: hidden;
1097
- <?php if(!empty($margin)): ?>
1098
- margin: <?php echo $margin; ?>;
1099
- <?php endif; ?>
1100
- }
1101
- @media only screen and (min-width: 1024px ){
1102
- .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
1103
- <?php if(!empty($thumb_height_large)): ?>
1104
- max-height: <?php echo $thumb_height_large; ?>;
1105
- <?php endif; ?>
1106
- }
1107
- }
1108
- @media only screen and ( min-width: 768px ) and ( max-width: 1023px ) {
1109
- .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
1110
- <?php if(!empty($thumb_height_medium)): ?>
1111
- max-height: <?php echo $thumb_height_medium; ?>;
1112
- <?php endif; ?>
1113
- }
1114
- }
1115
- @media only screen and ( min-width: 0px ) and ( max-width: 767px ){
1116
- .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
1117
- <?php if(!empty($thumb_height_small)): ?>
1118
- max-height: <?php echo $thumb_height_small; ?>;
1119
- <?php endif; ?>
1120
- }
1121
- }
1122
- </style>
1123
- <?php
1124
- }
1125
-
1126
-
1127
-
1128
-
1129
-
1130
-
1131
-
1132
-
1133
-
1134
-
1135
-
1136
-
1137
-
1138
- add_action('post_grid_layout_element_post_date', 'post_grid_layout_element_post_date');
1139
-
1140
- function post_grid_layout_element_post_date($args){
1141
-
1142
- $element = isset($args['element']) ? $args['element'] : array();
1143
- $elementIndex = isset($args['index']) ? $args['index'] : '';
1144
- $post_id = isset($args['post_id']) ? $args['post_id'] : '';
1145
-
1146
- if(empty($post_id)) return;
1147
-
1148
- $custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
1149
- $link_to = isset($element['link_to']) ? $element['link_to'] : '';
1150
- $link_target = isset($element['link_target']) ? $element['link_target'] : '';
1151
- $date_format = isset($element['date_format']) ? $element['date_format'] : 'd-m-Y';
1152
- $wrapper_html = !empty($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
1153
-
1154
-
1155
- $post_link = get_permalink($post_id);
1156
- $post_date = get_the_date($date_format, $post_id);
1157
-
1158
- $post_date = sprintf($wrapper_html,$post_date);
1159
-
1160
- ?>
1161
- <div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> post_date ">
1162
- <?php
1163
- if($link_to == 'post_link'):
1164
- ?>
1165
- <a target="<?php echo esc_attr($link_target); ?>" href="<?php echo esc_url_raw($post_link); ?>"><?php echo esc_html($post_date); ?></a>
1166
- <?php
1167
- else:
1168
- ?>
1169
- <?php echo esc_html($post_date); ?>
1170
- <?php
1171
- endif;
1172
- ?>
1173
-
1174
- </div>
1175
- <?php
1176
- }
1177
-
1178
-
1179
- add_action('post_grid_layout_element_css_post_date', 'post_grid_layout_element_css_post_date', 10);
1180
- function post_grid_layout_element_css_post_date($args){
1181
-
1182
-
1183
- $index = isset($args['index']) ? $args['index'] : '';
1184
- $element = isset($args['element']) ? $args['element'] : array();
1185
- $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
1186
-
1187
- $color = isset($element['color']) ? $element['color'] : '';
1188
- $font_size = isset($element['font_size']) ? $element['font_size'] : '';
1189
- $font_family = isset($element['font_family']) ? $element['font_family'] : '';
1190
- $margin = isset($element['margin']) ? $element['margin'] : '';
1191
- $text_align = isset($element['text_align']) ? $element['text_align'] : '';
1192
- $css = isset($element['css']) ? $element['css'] : '';
1193
- $css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
1194
- ?>
1195
- <style type="text/css">
1196
- .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
1197
- <?php if(!empty($color)): ?>
1198
- color: <?php echo $color; ?>;
1199
- <?php endif; ?>
1200
- <?php if(!empty($font_size)): ?>
1201
- font-size: <?php echo $font_size; ?>;
1202
- <?php endif; ?>
1203
- <?php if(!empty($font_family)): ?>
1204
- font-family: <?php echo $font_family; ?>;
1205
- <?php endif; ?>
1206
- <?php if(!empty($margin)): ?>
1207
- margin: <?php echo $margin; ?>;
1208
- <?php endif; ?>
1209
- <?php if(!empty($text_align)): ?>
1210
- text-align: <?php echo $text_align; ?>;
1211
- <?php endif; ?>
1212
- <?php if(!empty($css)): ?>
1213
- <?php echo $css; ?>
1214
- <?php endif; ?>
1215
- }
1216
- <?php if(!empty($css_hover)): ?>
1217
- .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
1218
- <?php echo $css_hover; ?>
1219
- }
1220
- <?php endif; ?>
1221
- .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?> a{
1222
- <?php if(!empty($color)): ?>
1223
- color: <?php echo $color; ?>;
1224
- <?php endif; ?>
1225
- <?php if(!empty($font_size)): ?>
1226
- font-size: <?php echo $font_size; ?>;
1227
- <?php endif; ?>
1228
- <?php if(!empty($font_family)): ?>
1229
- font-family: <?php echo $font_family; ?>;
1230
- <?php endif; ?>
1231
- }
1232
- </style>
1233
- <?php
1234
- }
1235
-
1236
- add_action('post_grid_layout_element_author', 'post_grid_layout_element_author');
1237
-
1238
- function post_grid_layout_element_author($args){
1239
-
1240
- $element = isset($args['element']) ? $args['element'] : array();
1241
- $elementIndex = isset($args['index']) ? $args['index'] : '';
1242
- $post_id = isset($args['post_id']) ? $args['post_id'] : '';
1243
-
1244
- if(empty($post_id)) return;
1245
-
1246
- $custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
1247
- $link_to = isset($element['link_to']) ? $element['link_to'] : '';
1248
- $link_target = isset($element['link_target']) ? $element['link_target'] : '';
1249
- $wrapper_html = !empty($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
1250
-
1251
- $post_link = get_permalink($post_id);
1252
- $post_author = get_the_author();
1253
-
1254
- $post_author = sprintf($wrapper_html, $post_author);
1255
-
1256
- ?>
1257
- <div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> author ">
1258
- <?php
1259
- if($link_to == 'post_link'):
1260
- ?>
1261
- <a target="<?php echo esc_attr($link_target); ?>" href="<?php echo esc_url_raw($post_link); ?>"><?php echo esc_html($post_author); ?></a>
1262
- <?php
1263
- elseif($link_to == 'author_posts_link'):
1264
- $post_author_link = get_author_posts_url( get_the_author_meta( 'ID' ) ) ;
1265
-
1266
- ?>
1267
- <a target="<?php echo esc_attr($link_target); ?>" href="<?php echo esc_url_raw($post_author_link); ?>"><?php echo esc_html($post_author); ?></a>
1268
- <?php
1269
-
1270
- else:
1271
- ?>
1272
- <?php echo esc_html($post_author); ?>
1273
- <?php
1274
- endif;
1275
- ?>
1276
-
1277
- </div>
1278
- <?php
1279
- }
1280
-
1281
-
1282
-
1283
- add_action('post_grid_layout_element_css_author', 'post_grid_layout_element_css_author', 10);
1284
- function post_grid_layout_element_css_author($args){
1285
-
1286
-
1287
- $index = isset($args['index']) ? $args['index'] : '';
1288
- $element = isset($args['element']) ? $args['element'] : array();
1289
- $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
1290
-
1291
- $color = isset($element['color']) ? $element['color'] : '';
1292
- $font_size = isset($element['font_size']) ? $element['font_size'] : '';
1293
- $font_family = isset($element['font_family']) ? $element['font_family'] : '';
1294
- $margin = isset($element['margin']) ? $element['margin'] : '';
1295
- $text_align = isset($element['text_align']) ? $element['text_align'] : '';
1296
- $css = isset($element['css']) ? $element['css'] : '';
1297
- $css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
1298
- ?>
1299
- <style type="text/css">
1300
- .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
1301
- <?php if(!empty($color)): ?>
1302
- color: <?php echo $color; ?>;
1303
- <?php endif; ?>
1304
- <?php if(!empty($font_size)): ?>
1305
- font-size: <?php echo $font_size; ?>;
1306
- <?php endif; ?>
1307
- <?php if(!empty($font_family)): ?>
1308
- font-family: <?php echo $font_family; ?>;
1309
- <?php endif; ?>
1310
- <?php if(!empty($margin)): ?>
1311
- margin: <?php echo $margin; ?>;
1312
- <?php endif; ?>
1313
- <?php if(!empty($text_align)): ?>
1314
- text-align: <?php echo $text_align; ?>;
1315
- <?php endif; ?>
1316
- <?php if(!empty($css)): ?>
1317
- <?php echo $css; ?>
1318
- <?php endif; ?>
1319
- }
1320
- <?php if(!empty($css_hover)): ?>
1321
- .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
1322
- <?php echo $css_hover; ?>
1323
- }
1324
- <?php endif; ?>
1325
- .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?> a{
1326
- <?php if(!empty($color)): ?>
1327
- color: <?php echo $color; ?>;
1328
- <?php endif; ?>
1329
- <?php if(!empty($font_size)): ?>
1330
- font-size: <?php echo $font_size; ?>;
1331
- <?php endif; ?>
1332
- <?php if(!empty($font_family)): ?>
1333
- font-family: <?php echo $font_family; ?>;
1334
- <?php endif; ?>
1335
- }
1336
- </style>
1337
- <?php
1338
- }
1339
-
1340
-
1341
- add_action('post_grid_layout_element_author_link', 'post_grid_layout_element_author_link');
1342
-
1343
- function post_grid_layout_element_author_link($args){
1344
-
1345
- $element = isset($args['element']) ? $args['element'] : array();
1346
- $elementIndex = isset($args['index']) ? $args['index'] : '';
1347
- $post_id = isset($args['post_id']) ? $args['post_id'] : '';
1348
-
1349
- if(empty($post_id)) return;
1350
-
1351
- $custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
1352
- $link_to = isset($element['link_to']) ? $element['link_to'] : 'post_link';
1353
- $link_target = isset($element['link_target']) ? $element['link_target'] : '';
1354
- $wrapper_html = !empty($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
1355
-
1356
- $post_link = get_permalink($post_id);
1357
- $post_author = get_the_author();
1358
-
1359
- $post_author = sprintf($wrapper_html, $post_author);
1360
-
1361
- ?>
1362
- <div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> author_link ">
1363
- <?php
1364
- if($link_to == 'post_link'):
1365
- ?>
1366
- <a target="<?php echo esc_attr($link_target); ?>" href="<?php echo esc_url_raw($post_link); ?>"><?php echo esc_html($post_author); ?></a>
1367
- <?php
1368
- elseif($link_to == 'author_posts_link'):
1369
- $post_author_link = get_author_posts_url( get_the_author_meta( 'ID' ) ) ;
1370
-
1371
- ?>
1372
- <a target="<?php echo esc_attr($link_target); ?>" href="<?php echo esc_url_raw($post_author_link); ?>"><?php echo esc_html($post_author); ?></a>
1373
- <?php
1374
-
1375
- else:
1376
- ?>
1377
- <?php echo esc_html($post_author); ?>
1378
- <?php
1379
- endif;
1380
- ?>
1381
-
1382
- </div>
1383
- <?php
1384
- }
1385
-
1386
- add_action('post_grid_layout_element_css_author_link', 'post_grid_layout_element_css_author_link', 10);
1387
- function post_grid_layout_element_css_author_link($args){
1388
-
1389
-
1390
- $index = isset($args['index']) ? $args['index'] : '';
1391
- $element = isset($args['element']) ? $args['element'] : array();
1392
- $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
1393
-
1394
- $color = isset($element['color']) ? $element['color'] : '';
1395
- $font_size = isset($element['font_size']) ? $element['font_size'] : '';
1396
- $font_family = isset($element['font_family']) ? $element['font_family'] : '';
1397
- $margin = isset($element['margin']) ? $element['margin'] : '';
1398
- $text_align = isset($element['text_align']) ? $element['text_align'] : 'left';
1399
- $css = isset($element['css']) ? $element['css'] : '';
1400
- $css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
1401
- ?>
1402
- <style type="text/css">
1403
- .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
1404
- <?php if(!empty($color)): ?>
1405
- color: <?php echo $color; ?>;
1406
- <?php endif; ?>
1407
- <?php if(!empty($font_size)): ?>
1408
- font-size: <?php echo $font_size; ?>;
1409
- <?php endif; ?>
1410
- <?php if(!empty($font_family)): ?>
1411
- font-family: <?php echo $font_family; ?>;
1412
- <?php endif; ?>
1413
- <?php if(!empty($margin)): ?>
1414
- margin: <?php echo $margin; ?>;
1415
- <?php endif; ?>
1416
- <?php if(!empty($text_align)): ?>
1417
- text-align: <?php echo $text_align; ?>;
1418
- <?php endif; ?>
1419
- <?php if(!empty($css)): ?>
1420
- <?php echo $css; ?>
1421
- <?php endif; ?>
1422
- }
1423
- <?php if(!empty($css_hover)): ?>
1424
- .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
1425
- <?php echo $css_hover; ?>
1426
- }
1427
- <?php endif; ?>
1428
- .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?> a{
1429
- <?php if(!empty($color)): ?>
1430
- color: <?php echo $color; ?>;
1431
- <?php endif; ?>
1432
- <?php if(!empty($font_size)): ?>
1433
- font-size: <?php echo $font_size; ?>;
1434
- <?php endif; ?>
1435
- <?php if(!empty($font_family)): ?>
1436
- font-family: <?php echo $font_family; ?>;
1437
- <?php endif; ?>
1438
- }
1439
- </style>
1440
- <?php
1441
- }
1442
-
1443
-
1444
-
1445
-
1446
-
1447
- add_action('post_grid_layout_element_categories', 'post_grid_layout_element_categories');
1448
-
1449
- function post_grid_layout_element_categories($args){
1450
-
1451
- $element = isset($args['element']) ? $args['element'] : array();
1452
- $elementIndex = isset($args['index']) ? $args['index'] : '';
1453
- $post_id = isset($args['post_id']) ? $args['post_id'] : '';
1454
-
1455
- if(empty($post_id)) return;
1456
-
1457
- $custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
1458
- $link_target = isset($element['link_target']) ? $element['link_target'] : '';
1459
- $max_count = isset($element['max_count']) ? (int) $element['max_count'] : 3;
1460
- $wrapper_html = !empty($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
1461
- $separator = isset($element['separator']) ? $element['separator'] : ', ';
1462
-
1463
-
1464
- $term_list = wp_get_post_terms( $post_id, 'category', array( 'fields' => 'all' ) );
1465
-
1466
- $categories_html = '';
1467
- $term_total_count = count($term_list);
1468
- $max_term_limit = ($term_total_count < $max_count) ? $term_total_count : $max_count ;
1469
-
1470
- $i = 0;
1471
- foreach ($term_list as $term){
1472
- if($i >= $max_count) continue;
1473
-
1474
- $term_id = isset($term->term_id) ? $term->term_id : '';
1475
- $term_name = isset($term->name) ? $term->name : '';
1476
- $term_link = get_term_link($term_id);
1477
-
1478
- $categories_html .= '<a target="'.esc_attr($link_target).'" href="'.esc_url_raw($term_link).'">'.esc_html($term_name).'</a>';
1479
- if( $i+1 < $max_term_limit){ $categories_html .= $separator;}
1480
-
1481
- $i++;
1482
- }
1483
-
1484
- //var_dump($categories_html);
1485
-
1486
- ?>
1487
- <div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> categories ">
1488
- <?php echo sprintf($wrapper_html, $categories_html); ?>
1489
- </div>
1490
- <?php
1491
- }
1492
-
1493
-
1494
- add_action('post_grid_layout_element_css_categories', 'post_grid_layout_element_css_categories', 10);
1495
- function post_grid_layout_element_css_categories($args){
1496
-
1497
-
1498
- $index = isset($args['index']) ? $args['index'] : '';
1499
- $element = isset($args['element']) ? $args['element'] : array();
1500
- $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
1501
-
1502
- $link_color = isset($element['link_color']) ? $element['link_color'] : '';
1503
- $text_color = isset($element['text_color']) ? $element['text_color'] : '';
1504
-
1505
- $font_size = isset($element['font_size']) ? $element['font_size'] : '';
1506
- $font_family = isset($element['font_family']) ? $element['font_family'] : '';
1507
- $margin = isset($element['margin']) ? $element['margin'] : '';
1508
- $text_align = isset($element['text_align']) ? $element['text_align'] : '';
1509
- $css = isset($element['css']) ? $element['css'] : '';
1510
- $css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
1511
- ?>
1512
- <style type="text/css">
1513
- .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
1514
- <?php if(!empty($text_color)): ?>
1515
- color: <?php echo $text_color; ?>;
1516
- <?php endif; ?>
1517
- <?php if(!empty($font_size)): ?>
1518
- font-size: <?php echo $font_size; ?>;
1519
- <?php endif; ?>
1520
- <?php if(!empty($font_family)): ?>
1521
- font-family: <?php echo $font_family; ?>;
1522
- <?php endif; ?>
1523
- <?php if(!empty($margin)): ?>
1524
- margin: <?php echo $margin; ?>;
1525
- <?php endif; ?>
1526
- <?php if(!empty($text_align)): ?>
1527
- text-align: <?php echo $text_align; ?>;
1528
- <?php endif; ?>
1529
- <?php if(!empty($css)): ?>
1530
- <?php echo $css; ?>
1531
- <?php endif; ?>
1532
- }
1533
- .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?> a{
1534
- <?php if(!empty($link_color)): ?>
1535
- color: <?php echo $link_color; ?>;
1536
- <?php endif; ?>
1537
- <?php if(!empty($font_size)): ?>
1538
- font-size: <?php echo $font_size; ?>;
1539
- <?php endif; ?>
1540
- <?php if(!empty($font_family)): ?>
1541
- font-family: <?php echo $font_family; ?>;
1542
- <?php endif; ?>
1543
- }
1544
- <?php if(!empty($css_hover)): ?>
1545
- .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
1546
- <?php echo $css_hover; ?>
1547
- }
1548
- <?php endif; ?>
1549
- </style>
1550
- <?php
1551
- }
1552
-
1553
-
1554
-
1555
-
1556
- add_action('post_grid_layout_element_tags', 'post_grid_layout_element_tags');
1557
-
1558
- function post_grid_layout_element_tags($args){
1559
-
1560
- $element = isset($args['element']) ? $args['element'] : array();
1561
- $elementIndex = isset($args['index']) ? $args['index'] : '';
1562
- $post_id = isset($args['post_id']) ? $args['post_id'] : '';
1563
-
1564
- if(empty($post_id)) return;
1565
-
1566
- $custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
1567
- $link_target = isset($element['link_target']) ? $element['link_target'] : '';
1568
- $max_count = isset($element['max_count']) ? (int) $element['max_count'] : 3;
1569
- $wrapper_html = isset($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
1570
- $separator = isset($element['separator']) ? $element['separator'] : ', ';
1571
-
1572
-
1573
- $term_list = wp_get_post_terms( $post_id, 'post_tag', array( 'fields' => 'all' ) );
1574
-
1575
- $categories_html = '';
1576
- $term_total_count = count($term_list);
1577
- $max_term_limit = ($term_total_count < $max_count) ? $term_total_count : $max_count ;
1578
-
1579
- $i = 0;
1580
- foreach ($term_list as $term){
1581
- if($i >= $max_count) continue;
1582
-
1583
- $term_id = isset($term->term_id) ? $term->term_id : '';
1584
- $term_name = isset($term->name) ? $term->name : '';
1585
- $term_link = get_term_link($term_id);
1586
-
1587
- $categories_html .= '<a target="'.esc_attr($link_target).'" href="'.esc_url_raw($term_link).'">'.esc_html($term_name).'</a>';
1588
- if( $i+1 < $max_term_limit){ $categories_html .= $separator;}
1589
-
1590
- $i++;
1591
- }
1592
-
1593
- ?>
1594
- <div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> tags ">
1595
- <?php echo sprintf($wrapper_html, $categories_html); ?>
1596
- </div>
1597
- <?php
1598
- }
1599
-
1600
-
1601
- add_action('post_grid_layout_element_css_tags', 'post_grid_layout_element_css_tags', 10);
1602
- function post_grid_layout_element_css_tags($args){
1603
-
1604
-
1605
- $index = isset($args['index']) ? $args['index'] : '';
1606
- $element = isset($args['element']) ? $args['element'] : array();
1607
- $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
1608
-
1609
- $link_color = isset($element['link_color']) ? $element['link_color'] : '';
1610
- $text_color = isset($element['text_color']) ? $element['text_color'] : '';
1611
-
1612
- $font_size = isset($element['font_size']) ? $element['font_size'] : '';
1613
- $font_family = isset($element['font_family']) ? $element['font_family'] : '';
1614
- $margin = isset($element['margin']) ? $element['margin'] : '';
1615
- $text_align = isset($element['text_align']) ? $element['text_align'] : '';
1616
-
1617
- $css = isset($element['css']) ? $element['css'] : '';
1618
- $css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
1619
- ?>
1620
- <style type="text/css">
1621
- .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
1622
- <?php if(!empty($text_color)): ?>
1623
- color: <?php echo $text_color; ?>;
1624
- <?php endif; ?>
1625
- <?php if(!empty($font_size)): ?>
1626
- font-size: <?php echo $font_size; ?>;
1627
- <?php endif; ?>
1628
- <?php if(!empty($font_family)): ?>
1629
- font-family: <?php echo $font_family; ?>;
1630
- <?php endif; ?>
1631
- <?php if(!empty($margin)): ?>
1632
- margin: <?php echo $margin; ?>;
1633
- <?php endif; ?>
1634
- <?php if(!empty($text_align)): ?>
1635
- text-align: <?php echo $text_align; ?>;
1636
- <?php endif; ?>
1637
- <?php if(!empty($css)): ?>
1638
- <?php echo $css; ?>
1639
- <?php endif; ?>
1640
- }
1641
- .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?> a{
1642
- <?php if(!empty($link_color)): ?>
1643
- color: <?php echo $link_color; ?>;
1644
- <?php endif; ?>
1645
- <?php if(!empty($font_size)): ?>
1646
- font-size: <?php echo $font_size; ?>;
1647
- <?php endif; ?>
1648
- <?php if(!empty($font_family)): ?>
1649
- font-family: <?php echo $font_family; ?>;
1650
- <?php endif; ?>
1651
- }
1652
- <?php if(!empty($css_hover)): ?>
1653
- .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
1654
- <?php echo $css_hover; ?>
1655
- }
1656
- <?php endif; ?>
1657
- </style>
1658
- <?php
1659
- }
1660
-
1661
-
1662
- add_action('post_grid_layout_element_comments_count', 'post_grid_layout_element_comments_count');
1663
-
1664
- function post_grid_layout_element_comments_count($args){
1665
-
1666
- $element = isset($args['element']) ? $args['element'] : array();
1667
- $elementIndex = isset($args['index']) ? $args['index'] : '';
1668
- $post_id = isset($args['post_id']) ? $args['post_id'] : '';
1669
-
1670
- if(empty($post_id)) return;
1671
-
1672
- $custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
1673
- $wrapper_html = isset($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
1674
-
1675
-
1676
-
1677
- $comments_number = get_comments_number( $post_id );
1678
- $comments_count_html = '';
1679
-
1680
- if(comments_open()){
1681
-
1682
- if ( $comments_number == 0 ) {
1683
- $comments_count_html.= __('No Comments', 'post-grid');
1684
- } elseif ( $comments_number > 1 ) {
1685
- $comments_count_html.= sprintf(__('%s Comments', 'post-grid'), $comments_number);
1686
- } else {
1687
- $comments_count_html.= __('1 Comment', 'post-grid');
1688
- }
1689
-
1690
- ?>
1691
- <div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> tags ">
1692
- <?php echo sprintf($wrapper_html, $comments_count_html); ?>
1693
- </div>
1694
- <?php
1695
-
1696
- }
1697
-
1698
-
1699
- }
1700
-
1701
-
1702
- add_action('post_grid_layout_element_css_comments_count', 'post_grid_layout_element_css_comments_count', 10);
1703
- function post_grid_layout_element_css_comments_count($args){
1704
-
1705
-
1706
- $index = isset($args['index']) ? $args['index'] : '';
1707
- $element = isset($args['element']) ? $args['element'] : array();
1708
- $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
1709
-
1710
- $color = isset($element['color']) ? $element['color'] : '';
1711
-
1712
- $font_size = isset($element['font_size']) ? $element['font_size'] : '';
1713
- $font_family = isset($element['font_family']) ? $element['font_family'] : '';
1714
- $margin = isset($element['margin']) ? $element['margin'] : '';
1715
- $text_align = isset($element['text_align']) ? $element['text_align'] : '';
1716
-
1717
- $css = isset($element['css']) ? $element['css'] : '';
1718
- $css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
1719
- ?>
1720
- <style type="text/css">
1721
- .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
1722
- <?php if(!empty($color)): ?>
1723
- color: <?php echo $color; ?>;
1724
- <?php endif; ?>
1725
- <?php if(!empty($font_size)): ?>
1726
- font-size: <?php echo $font_size; ?>;
1727
- <?php endif; ?>
1728
- <?php if(!empty($font_family)): ?>
1729
- font-family: <?php echo $font_family; ?>;
1730
- <?php endif; ?>
1731
- <?php if(!empty($margin)): ?>
1732
- margin: <?php echo $margin; ?>;
1733
- <?php endif; ?>
1734
- <?php if(!empty($text_align)): ?>
1735
- text-align: <?php echo $text_align; ?>;
1736
- <?php endif; ?>
1737
- <?php if(!empty($css)): ?>
1738
- <?php echo $css; ?>
1739
- <?php endif; ?>
1740
- }
1741
- <?php if(!empty($css_hover)): ?>
1742
- .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
1743
- <?php echo $css_hover; ?>
1744
- }
1745
- <?php endif; ?>
1746
- </style>
1747
- <?php
1748
- }
1749
-
1750
-
1751
-
1752
-
1753
-
1754
-
1755
-
1756
-
1757
-
1758
-
1759
-
1760
-
1761
-
1762
- add_action('post_grid_layout_element_share_button', 'post_grid_layout_element_share_button');
1763
-
1764
- function post_grid_layout_element_share_button($args){
1765
-
1766
- $element = isset($args['element']) ? $args['element'] : array();
1767
- $elementIndex = isset($args['index']) ? $args['index'] : '';
1768
- $post_id = isset($args['post_id']) ? $args['post_id'] : '';
1769
-
1770
- if(empty($post_id)) return;
1771
-
1772
- $custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
1773
- $link_target = isset($element['link_target']) ? $element['link_target'] : '';
1774
- $wrapper_html = isset($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
1775
- $font_size = isset($element['font_size']) ? $element['font_size'] : '';
1776
- $font_color = isset($element['color']) ? $element['color'] : '';
1777
-
1778
-
1779
- $post_title = get_the_title($post_id);
1780
- $post_link = get_permalink($post_id);
1781
-
1782
- $share_button_html = '';
1783
-
1784
- $share_button_html.= '
1785
- <span class="fb">
1786
- <a target="'.$link_target.'" href="https://www.facebook.com/sharer/sharer.php?u='.$post_link.'"><i class="fab fa-facebook-square"></i></a>
1787
- </span>
1788
- <span class="twitter">
1789
- <a target="'.$link_target.'" href="https://twitter.com/intent/tweet?url='.$post_link.'&text='.$post_title.'"><i class="fab fa-twitter-square"></i></a>
1790
- </span>';
1791
-
1792
- $share_button_html = apply_filters('post_grid_filter_share_buttons', $share_button_html);
1793
-
1794
- ?>
1795
- <div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> share_button ">
1796
- <?php echo sprintf($wrapper_html, $share_button_html); ?>
1797
- </div>
1798
- <?php
1799
- }
1800
-
1801
-
1802
- add_action('post_grid_layout_element_css_share_button', 'post_grid_layout_element_css_share_button', 10);
1803
- function post_grid_layout_element_css_share_button($args){
1804
-
1805
-
1806
- $index = isset($args['index']) ? $args['index'] : '';
1807
- $element = isset($args['element']) ? $args['element'] : array();
1808
- $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
1809
-
1810
- $font_size = isset($element['font_size']) ? $element['font_size'] : '';
1811
-
1812
- $wrapper_margin = isset($element['wrapper_margin']) ? $element['wrapper_margin'] : '';
1813
-
1814
- $text_align = isset($element['text_align']) ? $element['text_align'] : '';
1815
- $icon_margin = isset($element['icon_margin']) ? $element['icon_margin'] : '';
1816
- $icon_color = isset($element['icon_color']) ? $element['icon_color'] : '';
1817
- $font_size = isset($element['font_size']) ? $element['font_size'] : '';
1818
- $css = isset($element['css']) ? $element['css'] : '';
1819
- $css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
1820
-
1821
- ?>
1822
- <style type="text/css">
1823
- .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
1824
- <?php if(!empty($icon_color)): ?>
1825
- color: <?php echo $icon_color; ?>;
1826
- <?php endif; ?>
1827
- <?php if(!empty($font_size)): ?>
1828
- font-size: <?php echo $font_size; ?>;
1829
- <?php endif; ?>
1830
- <?php if(!empty($wrapper_margin)): ?>
1831
- margin: <?php echo $wrapper_margin; ?>;
1832
- <?php endif; ?>
1833
- <?php if(!empty($text_align)): ?>
1834
- text-align: <?php echo $text_align; ?>;
1835
- <?php endif; ?>
1836
- <?php if(!empty($css)): ?>
1837
- <?php echo $css; ?>
1838
- <?php endif; ?>
1839
- }
1840
- .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?> a{
1841
- <?php if(!empty($icon_color)): ?>
1842
- color: <?php echo $icon_color; ?>;
1843
- <?php endif; ?>
1844
- <?php if(!empty($font_size)): ?>
1845
- font-size: <?php echo $font_size; ?>;
1846
- <?php endif; ?>
1847
- <?php if(!empty($icon_margin)): ?>
1848
- margin: <?php echo $icon_margin; ?>;
1849
- <?php endif; ?>
1850
- }
1851
- <?php if(!empty($css_hover)): ?>
1852
- .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
1853
- <?php echo $css_hover; ?>
1854
- }
1855
- <?php endif; ?>
1856
- </style>
1857
- <?php
1858
- }
1859
-
1860
-
1861
-
1862
-
1863
-
1864
- add_action('post_grid_layout_element_hr', 'post_grid_layout_element_hr');
1865
-
1866
- function post_grid_layout_element_hr($args){
1867
-
1868
- $element = isset($args['element']) ? $args['element'] : array();
1869
- $elementIndex = isset($args['index']) ? $args['index'] : '';
1870
- $post_id = isset($args['post_id']) ? $args['post_id'] : '';
1871
-
1872
- if(empty($post_id)) return;
1873
-
1874
- $custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
1875
- $link_target = isset($element['link_target']) ? $element['link_target'] : '';
1876
- $wrapper_html = isset($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
1877
- $height = isset($element['height']) ? $element['height'] : '';
1878
- $background_color = isset($element['background_color']) ? $element['background_color'] : '';
1879
-
1880
-
1881
- ?>
1882
- <hr class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> hr "></hr>
1883
- <?php
1884
- }
1885
-
1886
-
1887
- add_action('post_grid_layout_element_css_hr', 'post_grid_layout_element_css_hr', 10);
1888
- function post_grid_layout_element_css_hr($args){
1889
-
1890
-
1891
- $index = isset($args['index']) ? $args['index'] : '';
1892
- $element = isset($args['element']) ? $args['element'] : array();
1893
- $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
1894
-
1895
- $height = isset($element['height']) ? $element['height'] : '1px';
1896
-
1897
- $margin = isset($element['margin']) ? $element['margin'] : '';
1898
- $background_color = isset($element['background_color']) ? $element['background_color'] : '';
1899
- $css = isset($element['css']) ? $element['css'] : '';
1900
- $css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
1901
- ?>
1902
- <style type="text/css">
1903
- .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
1904
- <?php if(!empty($margin)): ?>
1905
- margin: <?php echo $margin; ?>;
1906
- <?php endif; ?>
1907
- <?php if(!empty($background_color)): ?>
1908
- background-color: <?php echo $background_color; ?>;
1909
- <?php endif; ?>
1910
- <?php if(!empty($height)): ?>
1911
- padding: <?php echo $height; ?>;
1912
- <?php endif; ?>
1913
- <?php if(!empty($css)): ?>
1914
- <?php echo $css; ?>
1915
- <?php endif; ?>
1916
- }
1917
- <?php if(!empty($css_hover)): ?>
1918
- .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
1919
- <?php echo $css_hover; ?>
1920
- }
1921
- <?php endif; ?>
1922
- </style>
1923
- <?php
1924
- }
1925
-
1926
-
1927
-
1928
-
1929
-
1930
- add_action('post_grid_layout_element_five_star', 'post_grid_layout_element_five_star');
1931
-
1932
- function post_grid_layout_element_five_star($args){
1933
-
1934
- $element = isset($args['element']) ? $args['element'] : array();
1935
- $elementIndex = isset($args['index']) ? $args['index'] : '';
1936
- $post_id = isset($args['post_id']) ? $args['post_id'] : '';
1937
-
1938
- if(empty($post_id)) return;
1939
-
1940
- $custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
1941
- $star_count = isset($element['star_count']) ? $element['star_count'] : 5;
1942
- $wrapper_html = isset($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
1943
- $star_icon = isset($element['star_html']) ? $element['star_html'] : '';
1944
-
1945
- $font_size = isset($element['font_size']) ? $element['font_size'] : '';
1946
- $font_color = isset($element['color']) ? $element['color'] : '';
1947
-
1948
-
1949
- if(empty($star_count)) return;
1950
-
1951
- $load_fontawesome = !empty($post_grid_meta_options['load_fontawesome']) ? $post_grid_meta_options['load_fontawesome'] : 'no';
1952
- $post_grid_settings = get_option('post_grid_settings');
1953
- $font_aw_version = isset($post_grid_settings['font_aw_version']) ? $post_grid_settings['font_aw_version'] : '';
1954
-
1955
- if(empty($star_icon)){
1956
- if($font_aw_version == 'v_5'){
1957
- $star_icon = '<i class="fas fa-star"></i>';
1958
- }elseif ($font_aw_version =='v_4'){
1959
- $star_icon = '<i class="fa fa-star"></i>';
1960
- }
1961
- }
1962
-
1963
-
1964
-
1965
- $five_star_html = '';
1966
-
1967
- for($i=1; $i<=$star_count; $i++){
1968
-
1969
- $five_star_html.= $star_icon;
1970
- }
1971
-
1972
- ?>
1973
- <div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> five_star ">
1974
- <?php echo sprintf($wrapper_html, $five_star_html); ?>
1975
- </div>
1976
- <?php
1977
- }
1978
-
1979
-
1980
-
1981
- add_action('post_grid_layout_element_css_five_star', 'post_grid_layout_element_css_five_star', 10);
1982
- function post_grid_layout_element_css_five_star($args){
1983
-
1984
-
1985
- $index = isset($args['index']) ? $args['index'] : '';
1986
- $element = isset($args['element']) ? $args['element'] : array();
1987
- $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
1988
-
1989
-
1990
- $font_size = isset($element['font_size']) ? $element['font_size'] : '';
1991
- $color = isset($element['color']) ? $element['color'] : '';
1992
- $margin = isset($element['margin']) ? $element['margin'] : '';
1993
- $text_align = isset($element['text_align']) ? $element['text_align'] : '';
1994
-
1995
- $css = isset($element['css']) ? $element['css'] : '';
1996
- $css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
1997
-
1998
- ?>
1999
- <style type="text/css">
2000
- .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
2001
- <?php if(!empty($color)): ?>
2002
- color: <?php echo $color; ?>;
2003
- <?php endif; ?>
2004
- <?php if(!empty($font_size)): ?>
2005
- font-size: <?php echo $font_size; ?>;
2006
- <?php endif; ?>
2007
- <?php if(!empty($margin)): ?>
2008
- margin: <?php echo $margin; ?>;
2009
- <?php endif; ?>
2010
- <?php if(!empty($text_align)): ?>
2011
- text-align: <?php echo $text_align; ?>;
2012
- <?php endif; ?>
2013
- <?php if(!empty($css)): ?>
2014
- <?php echo $css; ?>
2015
- <?php endif; ?>
2016
- }
2017
- <?php if(!empty($css_hover)): ?>
2018
- .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
2019
- <?php echo $css_hover; ?>
2020
- }
2021
- <?php endif; ?>
2022
- </style>
2023
- <?php
2024
- }
2025
-
2026
-
2027
-
2028
-
2029
-
2030
-
2031
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/layout-elements/3rd-party.php CHANGED
@@ -45,22 +45,30 @@ if ( is_plugin_active( 'multi-rating/multi-rating.php' ) ) {
45
  }
46
 
47
 
 
48
 
 
 
49
 
 
50
 
 
 
51
 
 
52
 
 
 
53
 
 
54
 
 
 
55
 
 
56
 
57
-
58
-
59
-
60
-
61
-
62
-
63
-
64
 
65
 
66
 
45
  }
46
 
47
 
48
+ if ( is_plugin_active( 'likebtn-like-button/likebtn_like_button.php' ) ) {
49
 
50
+ require_once( post_grid_plugin_dir . 'includes/layout-elements/likebtn-like-button/layout-elements.php');
51
+ }
52
 
53
+ if ( is_plugin_active( 'wp-postviews/wp-postviews.php' ) ) {
54
 
55
+ require_once( post_grid_plugin_dir . 'includes/layout-elements/wp-postviews/layout-elements.php');
56
+ }
57
 
58
+ if ( is_plugin_active( 'post-views-counter/post-views-counter.php' ) ) {
59
 
60
+ require_once( post_grid_plugin_dir . 'includes/layout-elements/post-views-counter/layout-elements.php');
61
+ }
62
 
63
+ if ( is_plugin_active( 'page-views-count/page-views-count.php' ) ) {
64
 
65
+ require_once( post_grid_plugin_dir . 'includes/layout-elements/page-views-count/layout-elements.php');
66
+ }
67
 
68
+ if ( is_plugin_active( 'page-visit-counter/page-visit-counter.php' ) ) {
69
 
70
+ require_once( post_grid_plugin_dir . 'includes/layout-elements/page-visit-counter/layout-elements.php');
71
+ }
 
 
 
 
 
72
 
73
 
74
 
includes/layout-elements/likebtn-like-button/layout-elements.php ADDED
@@ -0,0 +1,236 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined('ABSPATH')) exit; // if direct access
3
+
4
+
5
+ add_filter('post_grid_layout_elements','post_grid_pro_likebtn_like_button_layout_elements');
6
+
7
+ function post_grid_pro_likebtn_like_button_layout_elements($elements_group){
8
+
9
+ $elements_group['star_rating']['items']['likebtn_like_button'] = array('name' =>__('Like Button Rating','post-grid'));
10
+
11
+ return $elements_group;
12
+ }
13
+
14
+
15
+ add_action('post_grid_layout_element_option_likebtn_like_button','post_grid_layout_element_option_likebtn_like_button');
16
+ function post_grid_layout_element_option_likebtn_like_button($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 __('Like Button Rating','post-grid'); ?></span>
43
+ </div>
44
+ <div class="element-options options">
45
+
46
+ <?php
47
+
48
+
49
+ $args = array(
50
+ 'id' => 'color',
51
+ 'css_id' => $element_index.'_color',
52
+ 'parent' => $input_name.'[likebtn_like_button]',
53
+ 'title' => __('Color','post-grid'),
54
+ 'details' => __('Title text color.','post-grid'),
55
+ 'type' => 'colorpicker',
56
+ 'value' => $color,
57
+ 'default' => '',
58
+ );
59
+
60
+ $settings_tabs_field->generate_field($args);
61
+
62
+ $args = array(
63
+ 'id' => 'font_size',
64
+ 'css_id' => $element_index.'_font_size',
65
+ 'parent' => $input_name.'[likebtn_like_button]',
66
+ 'title' => __('Font size','post-grid'),
67
+ 'details' => __('Set font size.','post-grid'),
68
+ 'type' => 'text',
69
+ 'value' => $font_size,
70
+ 'default' => '',
71
+ 'placeholder' => '14px',
72
+ );
73
+
74
+ $settings_tabs_field->generate_field($args);
75
+
76
+
77
+
78
+ $args = array(
79
+ 'id' => 'margin',
80
+ 'css_id' => $element_index.'_margin',
81
+ 'parent' => $input_name.'[likebtn_like_button]',
82
+ 'title' => __('Margin','post-grid'),
83
+ 'details' => __('Set margin.','post-grid'),
84
+ 'type' => 'text',
85
+ 'value' => $margin,
86
+ 'default' => '',
87
+ 'placeholder' => '5px 0',
88
+ );
89
+
90
+ $settings_tabs_field->generate_field($args);
91
+
92
+
93
+ $args = array(
94
+ 'id' => 'text_align',
95
+ 'css_id' => $element_index.'_text_align',
96
+ 'parent' => $input_name.'[likebtn_like_button]',
97
+ 'title' => __('Text align','post-grid'),
98
+ 'details' => __('Choose text align.','post-grid'),
99
+ 'type' => 'select',
100
+ 'value' => $text_align,
101
+ 'default' => 'left',
102
+ 'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
103
+ );
104
+
105
+ $settings_tabs_field->generate_field($args);
106
+
107
+
108
+ $args = array(
109
+ 'id' => 'css',
110
+ 'css_id' => $element_index.'_css',
111
+ 'parent' => $input_name.'[likebtn_like_button]',
112
+ 'title' => __('Custom CSS','post-grid'),
113
+ 'details' => __('Set csutom CSS.','post-grid'),
114
+ 'type' => 'textarea',
115
+ 'value' => $css,
116
+ 'default' => '',
117
+ 'placeholder' => '',
118
+ );
119
+
120
+ $settings_tabs_field->generate_field($args);
121
+
122
+ $args = array(
123
+ 'id' => 'css_hover',
124
+ 'css_id' => $element_index.'_css_hover',
125
+ 'parent' => $input_name.'[likebtn_like_button]',
126
+ 'title' => __('Hover CSS','post-grid'),
127
+ 'details' => __('Set hover custom CSS.','post-grid'),
128
+ 'type' => 'textarea',
129
+ 'value' => $css_hover,
130
+ 'default' => '',
131
+ 'placeholder' => '',
132
+ );
133
+
134
+ $settings_tabs_field->generate_field($args);
135
+
136
+
137
+ ob_start();
138
+ ?>
139
+ <textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}</textarea>
140
+ <?php
141
+
142
+ $html = ob_get_clean();
143
+
144
+ $args = array(
145
+ 'id' => 'use_css',
146
+ 'title' => __('Use of CSS','post-grid'),
147
+ 'details' => __('Use following class selector to add custom CSS for this element.','post-grid'),
148
+ 'type' => 'custom_html',
149
+ 'html' => $html,
150
+
151
+ );
152
+
153
+ $settings_tabs_field->generate_field($args);
154
+
155
+ ?>
156
+
157
+ </div>
158
+ </div>
159
+ <?php
160
+
161
+ }
162
+
163
+
164
+
165
+ add_action('post_grid_layout_element_likebtn_like_button', 'post_grid_layout_element_likebtn_like_button');
166
+ function post_grid_layout_element_likebtn_like_button($args){
167
+
168
+ $element = isset($args['element']) ? $args['element'] : array();
169
+ $elementIndex = isset($args['index']) ? $args['index'] : '';
170
+ $post_id = isset($args['post_id']) ? $args['post_id'] : '';
171
+
172
+ if(empty($post_id)) return;
173
+
174
+ $title = get_the_title($post_id);
175
+
176
+ $custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
177
+ $size = isset($element['size']) ? $element['size'] : '20';
178
+
179
+
180
+ // if(!empty($acf_value)):
181
+
182
+ ?>
183
+ <div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> likebtn_like_button ">
184
+ <?php echo do_shortcode("[likebtn]"); ?>
185
+ </div>
186
+ <?php
187
+ // endif;
188
+
189
+ }
190
+
191
+
192
+
193
+ add_action('post_grid_layout_element_css_likebtn_like_button', 'post_grid_layout_element_css_likebtn_like_button', 10);
194
+ function post_grid_layout_element_css_likebtn_like_button($args){
195
+
196
+
197
+ $index = isset($args['index']) ? $args['index'] : '';
198
+ $element = isset($args['element']) ? $args['element'] : array();
199
+ $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
200
+
201
+ $color = isset($element['color']) ? $element['color'] : '';
202
+ $font_size = isset($element['font_size']) ? $element['font_size'] : '';
203
+ $margin = isset($element['margin']) ? $element['margin'] : '';
204
+ $text_align = isset($element['text_align']) ? $element['text_align'] : 'left';
205
+
206
+ $css = isset($element['css']) ? $element['css'] : '';
207
+ $css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
208
+
209
+ ?>
210
+ <style type="text/css">
211
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
212
+ <?php if(!empty($color)): ?>
213
+ color: <?php echo $color; ?>;
214
+ <?php endif; ?>
215
+ <?php if(!empty($font_size)): ?>
216
+ font-size: <?php echo $font_size; ?>;
217
+ <?php endif; ?>
218
+
219
+ <?php if(!empty($margin)): ?>
220
+ margin: <?php echo $margin; ?>;
221
+ <?php endif; ?>
222
+ <?php if(!empty($text_align)): ?>
223
+ text-align: <?php echo $text_align; ?>;
224
+ <?php endif; ?>
225
+ <?php if(!empty($css)): ?>
226
+ <?php echo $css; ?>
227
+ <?php endif; ?>
228
+ }
229
+ <?php if(!empty($css_hover)): ?>
230
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
231
+ <?php echo $css_hover; ?>
232
+ }
233
+ <?php endif; ?>
234
+ </style>
235
+ <?php
236
+ }
includes/layout-elements/page-views-count/layout-elements.php ADDED
@@ -0,0 +1,252 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined('ABSPATH')) exit; // if direct access
3
+
4
+
5
+ add_filter('post_grid_layout_elements','post_grid_pro_page_views_count_layout_elements');
6
+
7
+ function post_grid_pro_page_views_count_layout_elements($elements_group){
8
+
9
+ $elements_group['star_rating']['items']['page_views_count'] = array('name' =>__('Page Views Count','post-grid'));
10
+
11
+ return $elements_group;
12
+ }
13
+
14
+
15
+ add_action('post_grid_layout_element_option_page_views_count','post_grid_layout_element_option_page_views_count');
16
+ function post_grid_layout_element_option_page_views_count($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
+ $wrapper_html = isset($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '';
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 __('Page Views Count','post-grid'); ?></span>
43
+ </div>
44
+ <div class="element-options options">
45
+
46
+ <?php
47
+
48
+ $args = array(
49
+ 'id' => 'wrapper_html',
50
+ 'css_id' => $element_index.'_wrapper_html',
51
+ 'parent' => $input_name.'[page_views_count]',
52
+ 'title' => __('Wrapper html','post-grid'),
53
+ 'details' => __('Write wrapper html.','post-grid'),
54
+ 'type' => 'text',
55
+ 'value' => $wrapper_html,
56
+ 'default' => '',
57
+ 'placeholder' => 'View Count: %s',
58
+ );
59
+
60
+ $settings_tabs_field->generate_field($args);
61
+
62
+ $args = array(
63
+ 'id' => 'color',
64
+ 'css_id' => $element_index.'_page_views_count',
65
+ 'parent' => $input_name.'[page_views_count]',
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.'[page_views_count]',
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.'[page_views_count]',
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.'[page_views_count]',
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.'[page_views_count]',
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.'[page_views_count]',
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_page_views_count', 'post_grid_layout_element_page_views_count');
179
+ function post_grid_layout_element_page_views_count($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
+ $wrapper_html = !empty($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
192
+
193
+
194
+ // if(!empty($acf_value)):
195
+
196
+ $html = sprintf($wrapper_html, do_shortcode("[pvc_stats postid=$post_id]"));
197
+
198
+ ?>
199
+ <div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> page_views_count ">
200
+ <?php echo $html; ?>
201
+ </div>
202
+ <?php
203
+ // endif;
204
+
205
+ }
206
+
207
+
208
+
209
+ add_action('post_grid_layout_element_css_page_views_count', 'post_grid_layout_element_css_page_views_count', 10);
210
+ function post_grid_layout_element_css_page_views_count($args){
211
+
212
+
213
+ $index = isset($args['index']) ? $args['index'] : '';
214
+ $element = isset($args['element']) ? $args['element'] : array();
215
+ $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
216
+
217
+ $color = isset($element['color']) ? $element['color'] : '';
218
+ $font_size = isset($element['font_size']) ? $element['font_size'] : '';
219
+ $margin = isset($element['margin']) ? $element['margin'] : '';
220
+ $text_align = isset($element['text_align']) ? $element['text_align'] : 'left';
221
+
222
+ $css = isset($element['css']) ? $element['css'] : '';
223
+ $css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
224
+
225
+ ?>
226
+ <style type="text/css">
227
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
228
+ <?php if(!empty($color)): ?>
229
+ color: <?php echo $color; ?>;
230
+ <?php endif; ?>
231
+ <?php if(!empty($font_size)): ?>
232
+ font-size: <?php echo $font_size; ?>;
233
+ <?php endif; ?>
234
+
235
+ <?php if(!empty($margin)): ?>
236
+ margin: <?php echo $margin; ?>;
237
+ <?php endif; ?>
238
+ <?php if(!empty($text_align)): ?>
239
+ text-align: <?php echo $text_align; ?>;
240
+ <?php endif; ?>
241
+ <?php if(!empty($css)): ?>
242
+ <?php echo $css; ?>
243
+ <?php endif; ?>
244
+ }
245
+ <?php if(!empty($css_hover)): ?>
246
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
247
+ <?php echo $css_hover; ?>
248
+ }
249
+ <?php endif; ?>
250
+ </style>
251
+ <?php
252
+ }
includes/layout-elements/page-visit-counter/layout-elements.php ADDED
@@ -0,0 +1,252 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined('ABSPATH')) exit; // if direct access
3
+
4
+
5
+ add_filter('post_grid_layout_elements','post_grid_pro_page_visit_counter_layout_elements');
6
+
7
+ function post_grid_pro_page_visit_counter_layout_elements($elements_group){
8
+
9
+ $elements_group['star_rating']['items']['page_visit_counter'] = array('name' =>__('Page Visit Counter','post-grid'));
10
+
11
+ return $elements_group;
12
+ }
13
+
14
+
15
+ add_action('post_grid_layout_element_option_page_visit_counter','post_grid_layout_element_option_page_visit_counter');
16
+ function post_grid_layout_element_option_page_visit_counter($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
+ $wrapper_html = isset($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '';
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 __('Page Visit Counter','post-grid'); ?></span>
43
+ </div>
44
+ <div class="element-options options">
45
+
46
+ <?php
47
+
48
+ $args = array(
49
+ 'id' => 'wrapper_html',
50
+ 'css_id' => $element_index.'_wrapper_html',
51
+ 'parent' => $input_name.'[page_visit_counter]',
52
+ 'title' => __('Wrapper html','post-grid'),
53
+ 'details' => __('Write wrapper html.','post-grid'),
54
+ 'type' => 'text',
55
+ 'value' => $wrapper_html,
56
+ 'default' => '',
57
+ 'placeholder' => 'View Count: %s',
58
+ );
59
+
60
+ $settings_tabs_field->generate_field($args);
61
+
62
+ $args = array(
63
+ 'id' => 'color',
64
+ 'css_id' => $element_index.'_page_visit_counter',
65
+ 'parent' => $input_name.'[page_visit_counter]',
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.'[page_visit_counter]',
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.'[page_visit_counter]',
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.'[page_visit_counter]',
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.'[page_visit_counter]',
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.'[page_visit_counter]',
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_page_visit_counter', 'post_grid_layout_element_page_visit_counter');
179
+ function post_grid_layout_element_page_visit_counter($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
+ $wrapper_html = !empty($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
192
+
193
+
194
+ // if(!empty($acf_value)):
195
+
196
+ $html = sprintf($wrapper_html, do_shortcode("[pvcp_1 postid=$post_id]"));
197
+
198
+ ?>
199
+ <div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> page_visit_counter ">
200
+ <?php echo $html; ?>
201
+ </div>
202
+ <?php
203
+ // endif;
204
+
205
+ }
206
+
207
+
208
+
209
+ add_action('post_grid_layout_element_css_page_visit_counter', 'post_grid_layout_element_css_page_visit_counter', 10);
210
+ function post_grid_layout_element_css_page_visit_counter($args){
211
+
212
+
213
+ $index = isset($args['index']) ? $args['index'] : '';
214
+ $element = isset($args['element']) ? $args['element'] : array();
215
+ $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
216
+
217
+ $color = isset($element['color']) ? $element['color'] : '';
218
+ $font_size = isset($element['font_size']) ? $element['font_size'] : '';
219
+ $margin = isset($element['margin']) ? $element['margin'] : '';
220
+ $text_align = isset($element['text_align']) ? $element['text_align'] : 'left';
221
+
222
+ $css = isset($element['css']) ? $element['css'] : '';
223
+ $css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
224
+
225
+ ?>
226
+ <style type="text/css">
227
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
228
+ <?php if(!empty($color)): ?>
229
+ color: <?php echo $color; ?>;
230
+ <?php endif; ?>
231
+ <?php if(!empty($font_size)): ?>
232
+ font-size: <?php echo $font_size; ?>;
233
+ <?php endif; ?>
234
+
235
+ <?php if(!empty($margin)): ?>
236
+ margin: <?php echo $margin; ?>;
237
+ <?php endif; ?>
238
+ <?php if(!empty($text_align)): ?>
239
+ text-align: <?php echo $text_align; ?>;
240
+ <?php endif; ?>
241
+ <?php if(!empty($css)): ?>
242
+ <?php echo $css; ?>
243
+ <?php endif; ?>
244
+ }
245
+ <?php if(!empty($css_hover)): ?>
246
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
247
+ <?php echo $css_hover; ?>
248
+ }
249
+ <?php endif; ?>
250
+ </style>
251
+ <?php
252
+ }
includes/layout-elements/post-views-counter/layout-elements.php ADDED
@@ -0,0 +1,252 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined('ABSPATH')) exit; // if direct access
3
+
4
+
5
+ add_filter('post_grid_layout_elements','post_grid_pro_post_views_counter_layout_elements');
6
+
7
+ function post_grid_pro_post_views_counter_layout_elements($elements_group){
8
+
9
+ $elements_group['star_rating']['items']['post_views_counter'] = array('name' =>__('Post Views Counter','post-grid'));
10
+
11
+ return $elements_group;
12
+ }
13
+
14
+
15
+ add_action('post_grid_layout_element_option_post_views_counter','post_grid_layout_element_option_post_views_counter');
16
+ function post_grid_layout_element_option_post_views_counter($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
+ $wrapper_html = isset($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '';
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 __('Post Views Counter','post-grid'); ?></span>
43
+ </div>
44
+ <div class="element-options options">
45
+
46
+ <?php
47
+
48
+ $args = array(
49
+ 'id' => 'wrapper_html',
50
+ 'css_id' => $element_index.'_wrapper_html',
51
+ 'parent' => $input_name.'[post_views_counter]',
52
+ 'title' => __('Wrapper html','post-grid'),
53
+ 'details' => __('Write wrapper html.','post-grid'),
54
+ 'type' => 'text',
55
+ 'value' => $wrapper_html,
56
+ 'default' => '',
57
+ 'placeholder' => 'View Count: %s',
58
+ );
59
+
60
+ $settings_tabs_field->generate_field($args);
61
+
62
+ $args = array(
63
+ 'id' => 'color',
64
+ 'css_id' => $element_index.'_post_views_counter',
65
+ 'parent' => $input_name.'[post_views_counter]',
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.'[post_views_counter]',
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.'[post_views_counter]',
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.'[post_views_counter]',
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.'[post_views_counter]',
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.'[post_views_counter]',
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_post_views_counter', 'post_grid_layout_element_post_views_counter');
179
+ function post_grid_layout_element_post_views_counter($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
+ $wrapper_html = !empty($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
192
+
193
+
194
+ // if(!empty($acf_value)):
195
+
196
+ $html = sprintf($wrapper_html, do_shortcode("[post-views id=$post_id]"));
197
+
198
+ ?>
199
+ <div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> post_views_counter ">
200
+ <?php echo $html; ?>
201
+ </div>
202
+ <?php
203
+ // endif;
204
+
205
+ }
206
+
207
+
208
+
209
+ add_action('post_grid_layout_element_css_post_views_counter', 'post_grid_layout_element_css_post_views_counter', 10);
210
+ function post_grid_layout_element_css_post_views_counter($args){
211
+
212
+
213
+ $index = isset($args['index']) ? $args['index'] : '';
214
+ $element = isset($args['element']) ? $args['element'] : array();
215
+ $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
216
+
217
+ $color = isset($element['color']) ? $element['color'] : '';
218
+ $font_size = isset($element['font_size']) ? $element['font_size'] : '';
219
+ $margin = isset($element['margin']) ? $element['margin'] : '';
220
+ $text_align = isset($element['text_align']) ? $element['text_align'] : 'left';
221
+
222
+ $css = isset($element['css']) ? $element['css'] : '';
223
+ $css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
224
+
225
+ ?>
226
+ <style type="text/css">
227
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
228
+ <?php if(!empty($color)): ?>
229
+ color: <?php echo $color; ?>;
230
+ <?php endif; ?>
231
+ <?php if(!empty($font_size)): ?>
232
+ font-size: <?php echo $font_size; ?>;
233
+ <?php endif; ?>
234
+
235
+ <?php if(!empty($margin)): ?>
236
+ margin: <?php echo $margin; ?>;
237
+ <?php endif; ?>
238
+ <?php if(!empty($text_align)): ?>
239
+ text-align: <?php echo $text_align; ?>;
240
+ <?php endif; ?>
241
+ <?php if(!empty($css)): ?>
242
+ <?php echo $css; ?>
243
+ <?php endif; ?>
244
+ }
245
+ <?php if(!empty($css_hover)): ?>
246
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
247
+ <?php echo $css_hover; ?>
248
+ }
249
+ <?php endif; ?>
250
+ </style>
251
+ <?php
252
+ }
includes/layout-elements/wp-postviews/layout-elements.php ADDED
@@ -0,0 +1,252 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined('ABSPATH')) exit; // if direct access
3
+
4
+
5
+ add_filter('post_grid_layout_elements','post_grid_pro_wp_postviews_layout_elements');
6
+
7
+ function post_grid_pro_wp_postviews_layout_elements($elements_group){
8
+
9
+ $elements_group['star_rating']['items']['wp_postviews'] = array('name' =>__('WP-PostViews','post-grid'));
10
+
11
+ return $elements_group;
12
+ }
13
+
14
+
15
+ add_action('post_grid_layout_element_option_wp_postviews','post_grid_layout_element_option_wp_postviews');
16
+ function post_grid_layout_element_option_wp_postviews($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
+ $wrapper_html = isset($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '';
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-PostViews','post-grid'); ?></span>
43
+ </div>
44
+ <div class="element-options options">
45
+
46
+ <?php
47
+
48
+ $args = array(
49
+ 'id' => 'wrapper_html',
50
+ 'css_id' => $element_index.'_wrapper_html',
51
+ 'parent' => $input_name.'[wp_postviews]',
52
+ 'title' => __('Wrapper html','post-grid'),
53
+ 'details' => __('Write wrapper html.','post-grid'),
54
+ 'type' => 'text',
55
+ 'value' => $wrapper_html,
56
+ 'default' => '',
57
+ 'placeholder' => 'View Count: %s',
58
+ );
59
+
60
+ $settings_tabs_field->generate_field($args);
61
+
62
+ $args = array(
63
+ 'id' => 'color',
64
+ 'css_id' => $element_index.'_wp_postviews',
65
+ 'parent' => $input_name.'[wp_postviews]',
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_postviews]',
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_postviews]',
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_postviews]',
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_postviews]',
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_postviews]',
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_postviews', 'post_grid_layout_element_wp_postviews');
179
+ function post_grid_layout_element_wp_postviews($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
+ $wrapper_html = !empty($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
192
+
193
+
194
+ // if(!empty($acf_value)):
195
+
196
+ $html = sprintf($wrapper_html, do_shortcode("[views id=$post_id]"));
197
+
198
+ ?>
199
+ <div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> wp_postviews ">
200
+ <?php echo $html; ?>
201
+ </div>
202
+ <?php
203
+ // endif;
204
+
205
+ }
206
+
207
+
208
+
209
+ add_action('post_grid_layout_element_css_wp_postviews', 'post_grid_layout_element_css_wp_postviews', 10);
210
+ function post_grid_layout_element_css_wp_postviews($args){
211
+
212
+
213
+ $index = isset($args['index']) ? $args['index'] : '';
214
+ $element = isset($args['element']) ? $args['element'] : array();
215
+ $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
216
+
217
+ $color = isset($element['color']) ? $element['color'] : '';
218
+ $font_size = isset($element['font_size']) ? $element['font_size'] : '';
219
+ $margin = isset($element['margin']) ? $element['margin'] : '';
220
+ $text_align = isset($element['text_align']) ? $element['text_align'] : 'left';
221
+
222
+ $css = isset($element['css']) ? $element['css'] : '';
223
+ $css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
224
+
225
+ ?>
226
+ <style type="text/css">
227
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
228
+ <?php if(!empty($color)): ?>
229
+ color: <?php echo $color; ?>;
230
+ <?php endif; ?>
231
+ <?php if(!empty($font_size)): ?>
232
+ font-size: <?php echo $font_size; ?>;
233
+ <?php endif; ?>
234
+
235
+ <?php if(!empty($margin)): ?>
236
+ margin: <?php echo $margin; ?>;
237
+ <?php endif; ?>
238
+ <?php if(!empty($text_align)): ?>
239
+ text-align: <?php echo $text_align; ?>;
240
+ <?php endif; ?>
241
+ <?php if(!empty($css)): ?>
242
+ <?php echo $css; ?>
243
+ <?php endif; ?>
244
+ }
245
+ <?php if(!empty($css_hover)): ?>
246
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
247
+ <?php echo $css_hover; ?>
248
+ }
249
+ <?php endif; ?>
250
+ </style>
251
+ <?php
252
+ }
includes/{functions/media-source-options.php → media-source-options.php} RENAMED
File without changes
includes/menu/settings.php CHANGED
@@ -13,21 +13,29 @@ $post_grid_settings_tab[] = array(
13
  'active' => ($current_tab == 'general') ? true : false,
14
  );
15
 
16
-
 
 
 
 
 
17
 
18
  $post_grid_settings_tab[] = array(
19
  'id' => 'help_support',
20
  'title' => sprintf(__('%s Help & support','post-grid'),'<i class="fas fa-hands-helping"></i>'),
21
- 'priority' => 3,
22
  'active' => ($current_tab == 'help_support') ? true : false,
23
  );
24
 
25
- //$post_grid_settings_tab[] = array(
26
- // 'id' => 'buy_pro',
27
- // 'title' => sprintf(__('%s Buy Pro','post-grid'),'<i class="fas fa-store"></i>'),
28
- // 'priority' => 9,
29
- // 'active' => ($current_tab == 'buy_pro') ? true : false,
30
- //);
 
 
 
31
 
32
  $post_grid_settings_tab = apply_filters('post_grid_settings_tabs', $post_grid_settings_tab);
33
 
13
  'active' => ($current_tab == 'general') ? true : false,
14
  );
15
 
16
+ //$post_grid_settings_tab[] = array(
17
+ // 'id' => 'templates',
18
+ // 'title' => sprintf(__('%s Templates','post-grid'),'<i class="far fa-newspaper"></i>'),
19
+ // 'priority' => 3,
20
+ // 'active' => ($current_tab == 'templates') ? true : false,
21
+ //);
22
 
23
  $post_grid_settings_tab[] = array(
24
  'id' => 'help_support',
25
  'title' => sprintf(__('%s Help & support','post-grid'),'<i class="fas fa-hands-helping"></i>'),
26
+ 'priority' => 90,
27
  'active' => ($current_tab == 'help_support') ? true : false,
28
  );
29
 
30
+
31
+
32
+
33
+ $post_grid_settings_tab[] = array(
34
+ 'id' => 'buy_pro',
35
+ 'title' => sprintf(__('%s Buy Pro','post-grid'),'<i class="fas fa-store"></i>'),
36
+ 'priority' => 95,
37
+ 'active' => ($current_tab == 'buy_pro') ? true : false,
38
+ );
39
 
40
  $post_grid_settings_tab = apply_filters('post_grid_settings_tabs', $post_grid_settings_tab);
41
 
includes/{functions/functions-post-grid-meta-box.php → metabox-post-grid-hook.php} RENAMED
@@ -74,7 +74,7 @@ function post_grid_metabox_tabs_content_shortcode($tab, $post_id){
74
  $html = ob_get_clean();
75
  $args = array(
76
  'id' => 'post_grid_shortcodes',
77
- 'title' => __('Post Grid Shortcode','post-grid'),
78
  'details' => '',
79
  'type' => 'custom_html',
80
  'html' => $html,
@@ -108,8 +108,8 @@ function post_grid_metabox_tabs_content_general($tab, $post_id){
108
 
109
  ?>
110
  <div class="section">
111
- <div class="section-title"><?php echo __('Lazy load', 'post-grid'); ?></div>
112
- <p class="description section-description"><?php echo __('Choose lazy load options.', 'post-grid'); ?></p>
113
 
114
  <?php
115
 
@@ -117,15 +117,15 @@ function post_grid_metabox_tabs_content_general($tab, $post_id){
117
  $args = array(
118
  'id' => 'lazy_load_enable',
119
  'parent' => 'post_grid_meta_options',
120
- 'title' => __('Enable lazy load','post-grid'),
121
- 'details' => __('Choose enable or disable lazy load.','post-grid'),
122
  'type' => 'radio',
123
  'multiple' => true,
124
  'value' => $lazy_load_enable,
125
  'default' => 'no',
126
  'args' => array(
127
- 'no'=>__('No','post-grid'),
128
- 'yes'=>__('Yes','post-grid'),
129
 
130
  ),
131
  );
@@ -136,8 +136,8 @@ function post_grid_metabox_tabs_content_general($tab, $post_id){
136
  $args = array(
137
  'id' => 'lazy_load_image_src',
138
  'parent' => 'post_grid_meta_options',
139
- 'title' => __('Lazy load image source','post-grid'),
140
- 'details' => __('Set custom lazy load image source.','post-grid'),
141
  'type' => 'media_url',
142
  'value' => $lazy_load_image_src,
143
  'default' => '',
@@ -149,15 +149,15 @@ function post_grid_metabox_tabs_content_general($tab, $post_id){
149
  $args = array(
150
  'id' => 'load_fontawesome',
151
  'parent' => 'post_grid_meta_options',
152
- 'title' => __('Load font awesome','post-grid'),
153
- 'details' => __('Choose enable or disable font-awesome load.','post-grid'),
154
  'type' => 'radio',
155
  'multiple' => true,
156
  'value' => $load_fontawesome,
157
  'default' => 'no',
158
  'args' => array(
159
- 'no'=>__('No','post-grid'),
160
- 'yes'=>__('Yes','post-grid'),
161
 
162
  ),
163
  );
@@ -175,8 +175,8 @@ function post_grid_metabox_tabs_content_general($tab, $post_id){
175
  </div>
176
 
177
  <div class="section">
178
- <div class="section-title"><?php echo __('Container settings', 'post-grid'); ?></div>
179
- <p class="description section-description"><?php echo __('Choose container options.', 'post-grid'); ?></p>
180
 
181
  <?php
182
 
@@ -184,8 +184,8 @@ function post_grid_metabox_tabs_content_general($tab, $post_id){
184
  $args = array(
185
  'id' => 'padding',
186
  'parent' => 'post_grid_meta_options[container]',
187
- 'title' => __('Container padding','post-grid'),
188
- 'details' => __('Set custom padding for grid container, ex: 10px 15px 10px 15px','post-grid'),
189
  'type' => 'text',
190
  'value' => $container_padding,
191
  'default' => '',
@@ -197,8 +197,8 @@ function post_grid_metabox_tabs_content_general($tab, $post_id){
197
  $args = array(
198
  'id' => 'bg_color',
199
  'parent' => 'post_grid_meta_options[container]',
200
- 'title' => __('Container background color','post-grid'),
201
- 'details' => __('Set custom background color for grid container.','post-grid'),
202
  'type' => 'colorpicker',
203
  'value' => $container_bg_color,
204
  'default' => '',
@@ -210,8 +210,8 @@ function post_grid_metabox_tabs_content_general($tab, $post_id){
210
  $args = array(
211
  'id' => 'bg_image',
212
  'parent' => 'post_grid_meta_options[container]',
213
- 'title' => __('Container background color','post-grid'),
214
- 'details' => __('Set custom background color for grid container.','post-grid'),
215
  'type' => 'media_url',
216
  'value' => $container_bg_image,
217
  'default' => '',
@@ -226,23 +226,23 @@ function post_grid_metabox_tabs_content_general($tab, $post_id){
226
  </div>
227
 
228
  <div class="section">
229
- <div class="section-title"><?php echo __('Items wrapper settings', 'post-grid'); ?></div>
230
- <p class="description section-description"><?php echo __('Choose items wrapper options.', 'post-grid'); ?></p>
231
 
232
  <?php
233
 
234
  $args = array(
235
  'id' => 'text_align',
236
  'parent' => 'post_grid_meta_options[items_wrapper]',
237
- 'title' => __('Text align','post-grid'),
238
- 'details' => __('Container text align.','post-grid'),
239
  'type' => 'select',
240
  'value' => $items_wrapper_text_align,
241
  'default' => 'center',
242
  'args' => array(
243
- 'left'=>__('Left','post-grid'),
244
- 'center'=>__('Center','post-grid'),
245
- 'right'=>__('Right','post-grid'),
246
  ),
247
  );
248
 
@@ -261,7 +261,7 @@ add_action('post_grid_metabox_tabs_content_query_post', 'post_grid_metabox_tabs_
261
  function post_grid_metabox_tabs_content_query_post($tab, $post_id){
262
 
263
  $settings_tabs_field = new settings_tabs_field();
264
- $class_post_grid_meta_box = new class_post_grid_meta_box();
265
 
266
 
267
  $post_grid_posttypes_array = post_grid_posttypes_array();
@@ -317,8 +317,8 @@ function post_grid_metabox_tabs_content_query_post($tab, $post_id){
317
  $args = array(
318
  'id' => 'post_types',
319
  'parent' => 'post_grid_meta_options',
320
- 'title' => __('Post types','post-grid'),
321
- 'details' => __('Select your desired post types here you want to display post from, you can choose multiple post type.','post-grid'),
322
  'type' => 'select2',
323
  'multiple' => true,
324
  'value' => $post_types,
@@ -372,8 +372,8 @@ function post_grid_metabox_tabs_content_query_post($tab, $post_id){
372
  'id' => 'terms',
373
  'css_id' => 'terms-'.$taxonomyIndex,
374
  'parent' => 'post_grid_meta_options[taxonomies]['.$taxonomy.']',
375
- 'title' => __('Categories or Terms','post-grid'),
376
- 'details' => __('Select post terms or categories','post-grid'),
377
  'type' => 'select2',
378
  'multiple' => true,
379
  'value' => $terms,
@@ -386,19 +386,19 @@ function post_grid_metabox_tabs_content_query_post($tab, $post_id){
386
  $args = array(
387
  'id' => 'terms_relation',
388
  'parent' => 'post_grid_meta_options[taxonomies]['.$taxonomy.']',
389
- 'title' => __('Terms relation','post-grid'),
390
- 'details' => __('Choose term relation. some option only available in pro','post-grid'),
391
  'type' => 'radio',
392
  'for' => $taxonomy,
393
  'multiple' => true,
394
  'value' => $terms_relation,
395
  'default' => 'IN',
396
  'args' => array(
397
- 'IN'=>__('IN','post-grid'),
398
- 'NOT IN'=>__('NOT IN','post-grid'),
399
- 'AND'=>__('AND','post-grid'),
400
- 'EXISTS'=>__('EXISTS','post-grid'),
401
- 'NOT EXISTS'=>__('NOT EXISTS','post-grid'),
402
  ),
403
  );
404
 
@@ -408,11 +408,11 @@ function post_grid_metabox_tabs_content_query_post($tab, $post_id){
408
  </div>
409
  <?php
410
  }else:
411
- echo __('Please choose at least one post types. save/update post grid','post-grid');
412
  endif;
413
  ?>
414
  </div>
415
- <p class="description"><?php echo __('Select post categories & terms.', 'post-grid'); ?></p>
416
  </div>
417
  </div>
418
 
@@ -420,16 +420,16 @@ function post_grid_metabox_tabs_content_query_post($tab, $post_id){
420
  $args = array(
421
  'id' => 'categories_relation',
422
  'parent' => 'post_grid_meta_options',
423
- 'title' => __('Taxonomies relation','post-grid'),
424
- 'details' => __('Choose Taxonomies relation.','post-grid'),
425
  'type' => 'radio',
426
  //'for' => $taxonomy,
427
  'multiple' => true,
428
  'value' => $categories_relation,
429
  'default' => 'IN',
430
  'args' => array(
431
- 'OR'=>__('OR','post-grid'),
432
- 'AND'=>__('AND','post-grid'),
433
  ),
434
  );
435
 
@@ -438,13 +438,13 @@ function post_grid_metabox_tabs_content_query_post($tab, $post_id){
438
  $args = array(
439
  'id' => 'post_status',
440
  'parent' => 'post_grid_meta_options',
441
- 'title' => __('Post status','post-grid'),
442
- 'details' => __('Display post from following post status.','post-grid'),
443
  'type' => 'select2',
444
  'multiple' => true,
445
  'value' => $post_status,
446
  'default' => array('publish'),
447
- 'args' => $class_post_grid_meta_box->get_post_status(),
448
  );
449
 
450
  $settings_tabs_field->generate_field($args, $post_id);
@@ -453,16 +453,16 @@ function post_grid_metabox_tabs_content_query_post($tab, $post_id){
453
  $args = array(
454
  'id' => 'query_order',
455
  'parent' => 'post_grid_meta_options',
456
- 'title' => __('Post query order','post-grid'),
457
- 'details' => __('Query order ascending or descending.','post-grid'),
458
  'type' => 'select',
459
  //'for' => $taxonomy,
460
  //'multiple' => true,
461
  'value' => $query_order,
462
  'default' => 'DESC',
463
  'args' => array(
464
- 'ASC'=>__('Ascending','post-grid'),
465
- 'DESC'=>__('Descending','post-grid'),
466
  ),
467
  );
468
 
@@ -472,13 +472,13 @@ function post_grid_metabox_tabs_content_query_post($tab, $post_id){
472
  $args = array(
473
  'id' => 'query_orderby',
474
  'parent' => 'post_grid_meta_options',
475
- 'title' => __('Post query orderby','post-grid'),
476
- 'details' => __('Select post query orderby','post-grid'),
477
  'type' => 'select2',
478
  'multiple' => true,
479
  'value' => $query_orderby,
480
  'default' => array('date'),
481
- 'args' => $class_post_grid_meta_box->get_query_orderby(),
482
  );
483
 
484
  $settings_tabs_field->generate_field($args, $post_id);
@@ -487,8 +487,8 @@ function post_grid_metabox_tabs_content_query_post($tab, $post_id){
487
  $args = array(
488
  'id' => 'query_orderby_meta_key',
489
  'parent' => 'post_grid_meta_options',
490
- 'title' => __('Query orderby meta key','post-grid'),
491
- 'details' => __('You can use custom meta field key for orderby meta key','post-grid'),
492
  'type' => 'text',
493
  'value' => $query_orderby_meta_key,
494
  'default' => '',
@@ -500,8 +500,8 @@ function post_grid_metabox_tabs_content_query_post($tab, $post_id){
500
  $args = array(
501
  'id' => 'posts_per_page',
502
  'parent' => 'post_grid_meta_options',
503
- 'title' => __('Posts per page','post-grid'),
504
- 'details' => __('Number of post each pagination. -1 to display all. default is 10 if you left empty.','post-grid'),
505
  'type' => 'text',
506
  'value' => $posts_per_page,
507
  'default' => '',
@@ -513,8 +513,8 @@ function post_grid_metabox_tabs_content_query_post($tab, $post_id){
513
  $args = array(
514
  'id' => 'offset',
515
  'parent' => 'post_grid_meta_options',
516
- 'title' => __('Offset','post-grid'),
517
- 'details' => __('Display posts from the n\'th, if you set Posts per page to -1 will not work offset.','post-grid'),
518
  'type' => 'text',
519
  'value' => $offset,
520
  'default' => '',
@@ -527,8 +527,8 @@ function post_grid_metabox_tabs_content_query_post($tab, $post_id){
527
  $args = array(
528
  'id' => 'exclude_post_id',
529
  'parent' => 'post_grid_meta_options',
530
- 'title' => __('Exclude by post ID','post-grid'),
531
- 'details' => __('You can exclude any post by ids here, use comma separate post id value, ex: 45,48','post-grid'),
532
  'type' => 'text',
533
  'value' => $exclude_post_id,
534
  'default' => '',
@@ -541,8 +541,8 @@ function post_grid_metabox_tabs_content_query_post($tab, $post_id){
541
  $args = array(
542
  'id' => 'include_post_id',
543
  'parent' => 'post_grid_meta_options',
544
- 'title' => __('Include by post ID','post-grid'),
545
- 'details' => __('You can include any post by ids here, use comma separate post id value, ex: 45,48','post-grid'),
546
  'type' => 'text',
547
  'value' => $include_post_id,
548
  'default' => '',
@@ -554,8 +554,8 @@ function post_grid_metabox_tabs_content_query_post($tab, $post_id){
554
  $args = array(
555
  'id' => 'keyword',
556
  'parent' => 'post_grid_meta_options',
557
- 'title' => __('Search parameter','post-grid'),
558
- 'details' => __('Query post by search keyword, please follow the reference https://codex.wordpress.org/Class_Reference/WP_Query#Search_Parameter','post-grid'),
559
  'type' => 'text',
560
  'value' => $keyword,
561
  'default' => '',
@@ -568,8 +568,8 @@ function post_grid_metabox_tabs_content_query_post($tab, $post_id){
568
  $args = array(
569
  'id' => 'no_post_text',
570
  'parent' => 'post_grid_meta_options',
571
- 'title' => __('No post found text','post-grid'),
572
- 'details' => __('Custom text for no post found. default: No post found','post-grid'),
573
  'type' => 'text',
574
  'value' => $no_post_text,
575
  'default' => '',
@@ -606,8 +606,8 @@ function post_grid_metabox_tabs_content_layouts($tab, $post_id){
606
 
607
  ?>
608
  <div class="section">
609
- <div class="section-title"><?php echo __('Layouts', 'post-grid'); ?></div>
610
- <p class="description section-description"><?php echo __('Choose item layouts.', 'post-grid'); ?></p>
611
 
612
 
613
  <?php
@@ -619,15 +619,15 @@ function post_grid_metabox_tabs_content_layouts($tab, $post_id){
619
  ob_start();
620
 
621
  ?>
622
- <p><a target="_blank" class="button" href="<?php echo admin_url().'post-new.php?post_type=post_grid_layout'; ?>"><?php echo __('Create layout','post-grid'); ?></a> </p>
623
- <p><a target="_blank" class="button" href="<?php echo admin_url().'edit.php?post_type=post_grid_layout'; ?>"><?php echo __('Manage layouts','post-grid'); ?></a> </p>
624
- <p><a target="_blank" class="button" href="<?php echo $layout_convert_url; ?>"><?php echo __('Covert old layout to new layout','post-grid'); ?></a> for this post grid.</p>
625
  <?php
626
  if($import_layouts != 'done'):
627
 
628
 
629
  ?>
630
- <p><a href="<?php echo admin_url().'edit.php?post_type=post_grid&page=import_layouts'; ?>" class="button import-default-layouts"><?php echo __('Import default layouts','post-grid'); ?></a> </p>
631
  <?php
632
  endif;
633
 
@@ -881,17 +881,17 @@ function post_grid_metabox_tabs_content_skin_layout($tab, $post_id){
881
 
882
  </div>
883
  <style type="text/css">
884
- #post_grid_metabox .layout-list .idle, #post_grid_metabox .layout-list .hover {
885
  display: inline-block;
886
  height: auto;
887
  margin: 0 10px;
888
  vertical-align: top;
889
  width: 400px;
890
  }
891
- #post_grid_metabox .layout-list .hover {
892
  display: none;
893
  }
894
- #post_grid_metabox .layout-list .idle .name, #post_grid_metabox .layout-list .hover .name {
895
  background: rgb(240, 240, 240) none repeat scroll 0 0;
896
  border-bottom: 1px solid rgb(153, 153, 153);
897
  font-size: 20px;
@@ -899,7 +899,7 @@ function post_grid_metabox_tabs_content_skin_layout($tab, $post_id){
899
  padding: 5px 0;
900
  text-align: center;
901
  }
902
- #post_grid_metabox .layout-list .idle .name .edit-layout {
903
  background: #ddd none repeat scroll 0 0;
904
  padding: 2px 10px;
905
  text-decoration: none;
@@ -982,10 +982,12 @@ function post_grid_metabox_tabs_content_skin_layout($tab, $post_id){
982
  </div>
983
 
984
  <style type="text/css">
985
- #post_grid_metabox .skin-list{
986
  text-align: center;
987
  }
988
- #post_grid_metabox .skin-list .skin-container {
 
 
989
  display: inline-block;
990
  margin: 10px;
991
  width: 310px;
@@ -993,44 +995,44 @@ function post_grid_metabox_tabs_content_skin_layout($tab, $post_id){
993
  vertical-align: top;
994
  padding: 15px;
995
  }
996
- #post_grid_metabox .skin-list .skin-container .header {
997
  background: rgb(252, 110, 60) none repeat scroll 0 0;
998
  padding: 3px 10px;
999
  text-align: left;
1000
  }
1001
- #post_grid_metabox .skin-list .skin-container .header.selected {
1002
  background: rgb(58, 212, 127) none repeat scroll 0 0;
1003
  }
1004
- #post_grid_metabox .skin-list .edit-link {
1005
  float: right;
1006
  }
1007
- #post_grid_metabox .skin-list .edit-link a{
1008
  color: #fff;
1009
  text-decoration: none;
1010
  }
1011
- #post_grid_metabox .skin-list .skin-container label {
1012
  color: rgb(255, 255, 255);
1013
  }
1014
- #post_grid_metabox .skin-list .skin {
1015
  display: inline-block;
1016
  overflow: hidden;
1017
  vertical-align: top;
1018
  }
1019
- #post_grid_metabox .skin-list .skin .thumb img {
1020
  height: auto;
1021
  width: 100%;
1022
  }
1023
- #post_grid_metabox .skin-list .skin .title {
1024
  font-size: 16px;
1025
  line-height: normal;
1026
  padding: 5px 0;
1027
  }
1028
- #post_grid_metabox .skin-list .skin .content {
1029
  font-size: 13px;
1030
  line-height: normal;
1031
  padding: 5px 0;
1032
  }
1033
- #post_grid_metabox .skin-list .layer-content > div {
1034
  padding: 5px 15px !important;
1035
  }
1036
  </style>
@@ -1669,7 +1671,7 @@ add_action('post_grid_metabox_tabs_content_search', 'post_grid_metabox_tabs_cont
1669
 
1670
  function post_grid_metabox_tabs_content_search($tab, $post_id){
1671
 
1672
- $class_post_grid_meta_box = new class_post_grid_meta_box();
1673
 
1674
  $settings_tabs_field = new settings_tabs_field();
1675
  $post_grid_meta_options = get_post_meta($post_id, 'post_grid_meta_options', true);
@@ -1776,7 +1778,7 @@ function post_grid_metabox_tabs_content_search($tab, $post_id){
1776
  'multiple' => true,
1777
  'value' => $query_orderby,
1778
  'default' => array('date'),
1779
- 'args' => $class_post_grid_meta_box->get_query_orderby(),
1780
  );
1781
 
1782
  $settings_tabs_field->generate_field($args, $post_id);
74
  $html = ob_get_clean();
75
  $args = array(
76
  'id' => 'post_grid_shortcodes',
77
+ 'title' => __('Post Grid Shortcode','woocommerce-products-slider'),
78
  'details' => '',
79
  'type' => 'custom_html',
80
  'html' => $html,
108
 
109
  ?>
110
  <div class="section">
111
+ <div class="section-title"><?php echo __('Lazy load', 'woocommerce-products-slider'); ?></div>
112
+ <p class="description section-description"><?php echo __('Choose lazy load options.', 'woocommerce-products-slider'); ?></p>
113
 
114
  <?php
115
 
117
  $args = array(
118
  'id' => 'lazy_load_enable',
119
  'parent' => 'post_grid_meta_options',
120
+ 'title' => __('Enable lazy load','woocommerce-products-slider'),
121
+ 'details' => __('Choose enable or disable lazy load.','woocommerce-products-slider'),
122
  'type' => 'radio',
123
  'multiple' => true,
124
  'value' => $lazy_load_enable,
125
  'default' => 'no',
126
  'args' => array(
127
+ 'no'=>__('No','woocommerce-products-slider'),
128
+ 'yes'=>__('Yes','woocommerce-products-slider'),
129
 
130
  ),
131
  );
136
  $args = array(
137
  'id' => 'lazy_load_image_src',
138
  'parent' => 'post_grid_meta_options',
139
+ 'title' => __('Lazy load image source','woocommerce-products-slider'),
140
+ 'details' => __('Set custom lazy load image source.','woocommerce-products-slider'),
141
  'type' => 'media_url',
142
  'value' => $lazy_load_image_src,
143
  'default' => '',
149
  $args = array(
150
  'id' => 'load_fontawesome',
151
  'parent' => 'post_grid_meta_options',
152
+ 'title' => __('Load font awesome','woocommerce-products-slider'),
153
+ 'details' => __('Choose enable or disable font-awesome load.','woocommerce-products-slider'),
154
  'type' => 'radio',
155
  'multiple' => true,
156
  'value' => $load_fontawesome,
157
  'default' => 'no',
158
  'args' => array(
159
+ 'no'=>__('No','woocommerce-products-slider'),
160
+ 'yes'=>__('Yes','woocommerce-products-slider'),
161
 
162
  ),
163
  );
175
  </div>
176
 
177
  <div class="section">
178
+ <div class="section-title"><?php echo __('Container settings', 'woocommerce-products-slider'); ?></div>
179
+ <p class="description section-description"><?php echo __('Choose container options.', 'woocommerce-products-slider'); ?></p>
180
 
181
  <?php
182
 
184
  $args = array(
185
  'id' => 'padding',
186
  'parent' => 'post_grid_meta_options[container]',
187
+ 'title' => __('Container padding','woocommerce-products-slider'),
188
+ 'details' => __('Set custom padding for grid container, ex: 10px 15px 10px 15px','woocommerce-products-slider'),
189
  'type' => 'text',
190
  'value' => $container_padding,
191
  'default' => '',
197
  $args = array(
198
  'id' => 'bg_color',
199
  'parent' => 'post_grid_meta_options[container]',
200
+ 'title' => __('Container background color','woocommerce-products-slider'),
201
+ 'details' => __('Set custom background color for grid container.','woocommerce-products-slider'),
202
  'type' => 'colorpicker',
203
  'value' => $container_bg_color,
204
  'default' => '',
210
  $args = array(
211
  'id' => 'bg_image',
212
  'parent' => 'post_grid_meta_options[container]',
213
+ 'title' => __('Container background color','woocommerce-products-slider'),
214
+ 'details' => __('Set custom background color for grid container.','woocommerce-products-slider'),
215
  'type' => 'media_url',
216
  'value' => $container_bg_image,
217
  'default' => '',
226
  </div>
227
 
228
  <div class="section">
229
+ <div class="section-title"><?php echo __('Items wrapper settings', 'woocommerce-products-slider'); ?></div>
230
+ <p class="description section-description"><?php echo __('Choose items wrapper options.', 'woocommerce-products-slider'); ?></p>
231
 
232
  <?php
233
 
234
  $args = array(
235
  'id' => 'text_align',
236
  'parent' => 'post_grid_meta_options[items_wrapper]',
237
+ 'title' => __('Text align','woocommerce-products-slider'),
238
+ 'details' => __('Container text align.','woocommerce-products-slider'),
239
  'type' => 'select',
240
  'value' => $items_wrapper_text_align,
241
  'default' => 'center',
242
  'args' => array(
243
+ 'left'=>__('Left','woocommerce-products-slider'),
244
+ 'center'=>__('Center','woocommerce-products-slider'),
245
+ 'right'=>__('Right','woocommerce-products-slider'),
246
  ),
247
  );
248
 
261
  function post_grid_metabox_tabs_content_query_post($tab, $post_id){
262
 
263
  $settings_tabs_field = new settings_tabs_field();
264
+ $class_post_grid_functions = new class_post_grid_functions();
265
 
266
 
267
  $post_grid_posttypes_array = post_grid_posttypes_array();
317
  $args = array(
318
  'id' => 'post_types',
319
  'parent' => 'post_grid_meta_options',
320
+ 'title' => __('Post types','woocommerce-products-slider'),
321
+ 'details' => __('Select your desired post types here you want to display post from, you can choose multiple post type.','woocommerce-products-slider'),
322
  'type' => 'select2',
323
  'multiple' => true,
324
  'value' => $post_types,
372
  'id' => 'terms',
373
  'css_id' => 'terms-'.$taxonomyIndex,
374
  'parent' => 'post_grid_meta_options[taxonomies]['.$taxonomy.']',
375
+ 'title' => __('Categories or Terms','woocommerce-products-slider'),
376
+ 'details' => __('Select post terms or categories','woocommerce-products-slider'),
377
  'type' => 'select2',
378
  'multiple' => true,
379
  'value' => $terms,
386
  $args = array(
387
  'id' => 'terms_relation',
388
  'parent' => 'post_grid_meta_options[taxonomies]['.$taxonomy.']',
389
+ 'title' => __('Terms relation','woocommerce-products-slider'),
390
+ 'details' => __('Choose term relation. some option only available in pro','woocommerce-products-slider'),
391
  'type' => 'radio',
392
  'for' => $taxonomy,
393
  'multiple' => true,
394
  'value' => $terms_relation,
395
  'default' => 'IN',
396
  'args' => array(
397
+ 'IN'=>__('IN','woocommerce-products-slider'),
398
+ 'NOT IN'=>__('NOT IN','woocommerce-products-slider'),
399
+ 'AND'=>__('AND','woocommerce-products-slider'),
400
+ 'EXISTS'=>__('EXISTS','woocommerce-products-slider'),
401
+ 'NOT EXISTS'=>__('NOT EXISTS','woocommerce-products-slider'),
402
  ),
403
  );
404
 
408
  </div>
409
  <?php
410
  }else:
411
+ echo __('Please choose at least one post types. save/update post grid','woocommerce-products-slider');
412
  endif;
413
  ?>
414
  </div>
415
+ <p class="description"><?php echo __('Select post categories & terms.', 'woocommerce-products-slider'); ?></p>
416
  </div>
417
  </div>
418
 
420
  $args = array(
421
  'id' => 'categories_relation',
422
  'parent' => 'post_grid_meta_options',
423
+ 'title' => __('Taxonomies relation','woocommerce-products-slider'),
424
+ 'details' => __('Choose Taxonomies relation.','woocommerce-products-slider'),
425
  'type' => 'radio',
426
  //'for' => $taxonomy,
427
  'multiple' => true,
428
  'value' => $categories_relation,
429
  'default' => 'IN',
430
  'args' => array(
431
+ 'OR'=>__('OR','woocommerce-products-slider'),
432
+ 'AND'=>__('AND','woocommerce-products-slider'),
433
  ),
434
  );
435
 
438
  $args = array(
439
  'id' => 'post_status',
440
  'parent' => 'post_grid_meta_options',
441
+ 'title' => __('Post status','woocommerce-products-slider'),
442
+ 'details' => __('Display post from following post status.','woocommerce-products-slider'),
443
  'type' => 'select2',
444
  'multiple' => true,
445
  'value' => $post_status,
446
  'default' => array('publish'),
447
+ 'args' => $class_post_grid_functions->get_post_status(),
448
  );
449
 
450
  $settings_tabs_field->generate_field($args, $post_id);
453
  $args = array(
454
  'id' => 'query_order',
455
  'parent' => 'post_grid_meta_options',
456
+ 'title' => __('Post query order','woocommerce-products-slider'),
457
+ 'details' => __('Query order ascending or descending.','woocommerce-products-slider'),
458
  'type' => 'select',
459
  //'for' => $taxonomy,
460
  //'multiple' => true,
461
  'value' => $query_order,
462
  'default' => 'DESC',
463
  'args' => array(
464
+ 'ASC'=>__('Ascending','woocommerce-products-slider'),
465
+ 'DESC'=>__('Descending','woocommerce-products-slider'),
466
  ),
467
  );
468
 
472
  $args = array(
473
  'id' => 'query_orderby',
474
  'parent' => 'post_grid_meta_options',
475
+ 'title' => __('Post query orderby','woocommerce-products-slider'),
476
+ 'details' => __('Select post query orderby','woocommerce-products-slider'),
477
  'type' => 'select2',
478
  'multiple' => true,
479
  'value' => $query_orderby,
480
  'default' => array('date'),
481
+ 'args' => $class_post_grid_functions->get_query_orderby(),
482
  );
483
 
484
  $settings_tabs_field->generate_field($args, $post_id);
487
  $args = array(
488
  'id' => 'query_orderby_meta_key',
489
  'parent' => 'post_grid_meta_options',
490
+ 'title' => __('Query orderby meta key','woocommerce-products-slider'),
491
+ 'details' => __('You can use custom meta field key for orderby meta key','woocommerce-products-slider'),
492
  'type' => 'text',
493
  'value' => $query_orderby_meta_key,
494
  'default' => '',
500
  $args = array(
501
  'id' => 'posts_per_page',
502
  'parent' => 'post_grid_meta_options',
503
+ 'title' => __('Posts per page','woocommerce-products-slider'),
504
+ 'details' => __('Number of post each pagination. -1 to display all. default is 10 if you left empty.','woocommerce-products-slider'),
505
  'type' => 'text',
506
  'value' => $posts_per_page,
507
  'default' => '',
513
  $args = array(
514
  'id' => 'offset',
515
  'parent' => 'post_grid_meta_options',
516
+ 'title' => __('Offset','woocommerce-products-slider'),
517
+ 'details' => __('Display posts from the n\'th, if you set Posts per page to -1 will not work offset.','woocommerce-products-slider'),
518
  'type' => 'text',
519
  'value' => $offset,
520
  'default' => '',
527
  $args = array(
528
  'id' => 'exclude_post_id',
529
  'parent' => 'post_grid_meta_options',
530
+ 'title' => __('Exclude by post ID','woocommerce-products-slider'),
531
+ 'details' => __('You can exclude any post by ids here, use comma separate post id value, ex: 45,48','woocommerce-products-slider'),
532
  'type' => 'text',
533
  'value' => $exclude_post_id,
534
  'default' => '',
541
  $args = array(
542
  'id' => 'include_post_id',
543
  'parent' => 'post_grid_meta_options',
544
+ 'title' => __('Include by post ID','woocommerce-products-slider'),
545
+ 'details' => __('You can include any post by ids here, use comma separate post id value, ex: 45,48','woocommerce-products-slider'),
546
  'type' => 'text',
547
  'value' => $include_post_id,
548
  'default' => '',
554
  $args = array(
555
  'id' => 'keyword',
556
  'parent' => 'post_grid_meta_options',
557
+ 'title' => __('Search parameter','woocommerce-products-slider'),
558
+ 'details' => __('Query post by search keyword, please follow the reference https://codex.wordpress.org/Class_Reference/WP_Query#Search_Parameter','woocommerce-products-slider'),
559
  'type' => 'text',
560
  'value' => $keyword,
561
  'default' => '',
568
  $args = array(
569
  'id' => 'no_post_text',
570
  'parent' => 'post_grid_meta_options',
571
+ 'title' => __('No post found text','woocommerce-products-slider'),
572
+ 'details' => __('Custom text for no post found. default: No post found','woocommerce-products-slider'),
573
  'type' => 'text',
574
  'value' => $no_post_text,
575
  'default' => '',
606
 
607
  ?>
608
  <div class="section">
609
+ <div class="section-title"><?php echo __('Layouts', 'woocommerce-products-slider'); ?></div>
610
+ <p class="description section-description"><?php echo __('Choose item layouts.', 'woocommerce-products-slider'); ?></p>
611
 
612
 
613
  <?php
619
  ob_start();
620
 
621
  ?>
622
+ <p><a target="_blank" class="button" href="<?php echo admin_url().'post-new.php?post_type=post_grid_layout'; ?>"><?php echo __('Create layout','woocommerce-products-slider'); ?></a> </p>
623
+ <p><a target="_blank" class="button" href="<?php echo admin_url().'edit.php?post_type=post_grid_layout'; ?>"><?php echo __('Manage layouts','woocommerce-products-slider'); ?></a> </p>
624
+ <p><a target="_blank" class="button" href="<?php echo $layout_convert_url; ?>"><?php echo __('Covert old layout to new layout','woocommerce-products-slider'); ?></a> for this post grid.</p>
625
  <?php
626
  if($import_layouts != 'done'):
627
 
628
 
629
  ?>
630
+ <p><a href="<?php echo admin_url().'edit.php?post_type=post_grid&page=import_layouts'; ?>" class="button import-default-layouts"><?php echo __('Import default layouts','woocommerce-products-slider'); ?></a> </p>
631
  <?php
632
  endif;
633
 
881
 
882
  </div>
883
  <style type="text/css">
884
+ #post-grid .layout-list .idle, #post-grid .layout-list .hover {
885
  display: inline-block;
886
  height: auto;
887
  margin: 0 10px;
888
  vertical-align: top;
889
  width: 400px;
890
  }
891
+ #post-grid .layout-list .hover {
892
  display: none;
893
  }
894
+ #post-grid .layout-list .idle .name, #post-grid .layout-list .hover .name {
895
  background: rgb(240, 240, 240) none repeat scroll 0 0;
896
  border-bottom: 1px solid rgb(153, 153, 153);
897
  font-size: 20px;
899
  padding: 5px 0;
900
  text-align: center;
901
  }
902
+ #post-grid .layout-list .idle .name .edit-layout {
903
  background: #ddd none repeat scroll 0 0;
904
  padding: 2px 10px;
905
  text-decoration: none;
982
  </div>
983
 
984
  <style type="text/css">
985
+ #post-grid .skin-list{
986
  text-align: center;
987
  }
988
+
989
+
990
+ #post-grid .skin-list .skin-container {
991
  display: inline-block;
992
  margin: 10px;
993
  width: 310px;
995
  vertical-align: top;
996
  padding: 15px;
997
  }
998
+ #post-grid .skin-list .skin-container .header {
999
  background: rgb(252, 110, 60) none repeat scroll 0 0;
1000
  padding: 3px 10px;
1001
  text-align: left;
1002
  }
1003
+ #post-grid .skin-list .skin-container .header.selected {
1004
  background: rgb(58, 212, 127) none repeat scroll 0 0;
1005
  }
1006
+ #post-grid .skin-list .edit-link {
1007
  float: right;
1008
  }
1009
+ #post-grid .skin-list .edit-link a{
1010
  color: #fff;
1011
  text-decoration: none;
1012
  }
1013
+ #post-grid .skin-list .skin-container label {
1014
  color: rgb(255, 255, 255);
1015
  }
1016
+ #post-grid .skin-list .skin {
1017
  display: inline-block;
1018
  overflow: hidden;
1019
  vertical-align: top;
1020
  }
1021
+ #post-grid .skin-list .skin .thumb img {
1022
  height: auto;
1023
  width: 100%;
1024
  }
1025
+ #post-grid .skin-list .skin .title {
1026
  font-size: 16px;
1027
  line-height: normal;
1028
  padding: 5px 0;
1029
  }
1030
+ #post-grid .skin-list .skin .content {
1031
  font-size: 13px;
1032
  line-height: normal;
1033
  padding: 5px 0;
1034
  }
1035
+ #post-grid .skin-list .layer-content > div {
1036
  padding: 5px 15px !important;
1037
  }
1038
  </style>
1671
 
1672
  function post_grid_metabox_tabs_content_search($tab, $post_id){
1673
 
1674
+ $class_post_grid_functions = new class_post_grid_functions();
1675
 
1676
  $settings_tabs_field = new settings_tabs_field();
1677
  $post_grid_meta_options = get_post_meta($post_id, 'post_grid_meta_options', true);
1778
  'multiple' => true,
1779
  'value' => $query_orderby,
1780
  'default' => array('date'),
1781
+ 'args' => $class_post_grid_functions->get_query_orderby(),
1782
  );
1783
 
1784
  $settings_tabs_field->generate_field($args, $post_id);
includes/{class-metabox-post-grid-layout-hook.php → metabox-post-grid-layout-hook.php} RENAMED
File without changes
includes/metabox-post-options-hook.php ADDED
@@ -0,0 +1,242 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * @Author PickPlugins
5
+ */
6
+
7
+ if ( ! defined('ABSPATH')) exit; // if direct access
8
+
9
+
10
+
11
+
12
+ add_action('post_grid_post_options_content_options', 'post_grid_post_options_content_options',10, 2);
13
+
14
+ function post_grid_post_options_content_options($tab, $post_id){
15
+
16
+ $settings_tabs_field = new settings_tabs_field();
17
+
18
+ $class_post_grid_functions = new class_post_grid_functions();
19
+ $post_grid_skins = $class_post_grid_functions->skins();
20
+
21
+ $skin_list = array();
22
+
23
+ foreach($post_grid_skins as $skin_key=>$skin_data){
24
+
25
+ $skin_list[$skin_key] = $skin_data['name'];
26
+ }
27
+
28
+
29
+ $post_grid_post_settings = get_post_meta($post_id, 'post_grid_post_settings', true);
30
+
31
+ $post_skin = !empty($post_grid_post_settings['post_skin']) ? $post_grid_post_settings['post_skin'] : 'flat';
32
+ $custom_thumb_source = !empty($post_grid_post_settings['custom_thumb_source']) ? $post_grid_post_settings['custom_thumb_source'] : post_grid_plugin_url.'assets/frontend/images/placeholder.png';
33
+ $thumb_custom_url = !empty($post_grid_post_settings['thumb_custom_url']) ? $post_grid_post_settings['thumb_custom_url'] : '';
34
+
35
+
36
+
37
+ ?>
38
+ <div class="section">
39
+ <div class="section-title">Options</div>
40
+ <p class="description section-description">Change post option here.</p>
41
+
42
+
43
+ <?php
44
+
45
+ $args = array(
46
+ 'id' => 'custom_thumb_source',
47
+ 'parent' => 'post_grid_post_settings',
48
+ 'title' => __('Custom thumbnail image source','post-grid'),
49
+ 'details' => __('You can use custom thumbnail image source.','post-grid'),
50
+ 'type' => 'media_url',
51
+ 'value' => $custom_thumb_source,
52
+ 'default' => '',
53
+ );
54
+
55
+ $settings_tabs_field->generate_field($args, $post_id);
56
+
57
+ $args = array(
58
+ 'id' => 'thumb_custom_url',
59
+ 'parent' => 'post_grid_post_settings',
60
+ 'title' => __('Custom link to this post','post-grid'),
61
+ 'details' => __('You can use custom link to this post.','post-grid'),
62
+ 'type' => 'text',
63
+ 'value' => $thumb_custom_url,
64
+ 'default' => '',
65
+ );
66
+
67
+ $settings_tabs_field->generate_field($args, $post_id);
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+ ?>
77
+ </div>
78
+ <?php
79
+ }
80
+
81
+
82
+
83
+
84
+
85
+ add_action('post_grid_post_options_content_post_template', 'post_grid_post_options_content_post_template',10, 2);
86
+
87
+ function post_grid_post_options_content_post_template($tab, $post_id){
88
+
89
+ $settings_tabs_field = new settings_tabs_field();
90
+
91
+ $post_grid_post_settings = get_post_meta($post_id, 'post_grid_post_settings', true);
92
+
93
+ $remove_post_title = !empty($post_grid_post_settings['remove_post_title']) ? $post_grid_post_settings['remove_post_title'] : '';
94
+ $remove_post_thumbnail = !empty($post_grid_post_settings['remove_post_thumbnail']) ? $post_grid_post_settings['remove_post_thumbnail'] : '';
95
+
96
+
97
+ ?>
98
+ <div class="section">
99
+ <div class="section-title">Post template</div>
100
+ <p class="description section-description">Customize post template settings, will applied to single post template for this post.</p>
101
+
102
+
103
+ <?php
104
+
105
+
106
+
107
+ $args = array(
108
+ 'id' => 'remove_post_title',
109
+ 'parent' => 'post_grid_post_settings',
110
+ 'title' => __('Remove post title','post-grid'),
111
+ 'details' => __('Remove default post title from single post template.','post-grid'),
112
+ 'type' => 'radio',
113
+ 'value' => $remove_post_title,
114
+ 'default' => 'no',
115
+ 'args' => array(
116
+ 'yes'=>__('Yes','post-grid'),
117
+ 'no'=>__('No','post-grid'),
118
+ ),
119
+ );
120
+
121
+ $settings_tabs_field->generate_field($args, $post_id);
122
+
123
+ $args = array(
124
+ 'id' => 'remove_post_thumbnail',
125
+ 'parent' => 'post_grid_post_settings',
126
+ 'title' => __('Remove post thumbnail','post-grid'),
127
+ 'details' => __('Remove default post thumbnail from single post template.','post-grid'),
128
+ 'type' => 'radio',
129
+ 'value' => $remove_post_thumbnail,
130
+ 'default' => 'no',
131
+ 'args' => array(
132
+ 'yes'=>__('Yes','post-grid'),
133
+ 'no'=>__('No','post-grid'),
134
+ ),
135
+ );
136
+
137
+ $settings_tabs_field->generate_field($args, $post_id);
138
+
139
+
140
+
141
+
142
+ ?>
143
+ </div>
144
+ <?php
145
+
146
+
147
+ //var_dump($post_id);
148
+ $settings_tabs_field = new settings_tabs_field();
149
+ $post_grid_post_settings = get_post_meta($post_id,'post_grid_post_settings', true);
150
+ $layout_id = !empty($post_grid_post_settings['layout_id']) ? $post_grid_post_settings['layout_id'] : ''; //post_grid_get_first_post('post_grid_layout')
151
+
152
+
153
+ ?>
154
+ <div class="section">
155
+
156
+ <?php
157
+
158
+
159
+
160
+ ob_start();
161
+
162
+ ?>
163
+ <p><a target="_blank" class="button" href="<?php echo admin_url().'post-new.php?post_type=post_grid_layout'; ?>"><?php echo __('Create layout','post-grid'); ?></a> </p>
164
+ <p><a target="_blank" class="button" href="<?php echo admin_url().'edit.php?post_type=post_grid_layout'; ?>"><?php echo __('Manage layouts','post-grid'); ?></a> </p>
165
+ <?php
166
+
167
+
168
+
169
+ $html = ob_get_clean();
170
+
171
+ $args = array(
172
+ 'id' => 'post_grid_layout_create',
173
+ //'parent' => 'post_grid_post_settings',
174
+ 'title' => __('Create layout','post-grid'),
175
+ 'details' => __('Please follow the links to create layouts or manage.','post-grid'),
176
+ 'type' => 'custom_html',
177
+ 'html' => $html,
178
+ );
179
+
180
+ $settings_tabs_field->generate_field($args);
181
+
182
+
183
+ $item_layout_args = array();
184
+
185
+ $query_args['post_type'] = array('post_grid_layout');
186
+ $query_args['post_status'] = array('publish');
187
+ $query_args['orderby'] = 'date';
188
+ $query_args['order'] = 'DESC';
189
+ $query_args['posts_per_page'] = -1;
190
+ $wp_query = new WP_Query($query_args);
191
+
192
+ $item_layout_args[''] = array('name'=>'Empty layout', 'thumb'=> 'https://i.imgur.com/JyurCtY.jpg', );
193
+
194
+
195
+ if ( $wp_query->have_posts() ) :
196
+
197
+
198
+ while ( $wp_query->have_posts() ) : $wp_query->the_post();
199
+
200
+ $post_id = get_the_id();
201
+ $layout_name = get_the_title();
202
+ $product_thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post_id), 'full' );
203
+ $product_thumb_url = isset($product_thumb['0']) ? esc_url_raw($product_thumb['0']) : '';
204
+
205
+ $layout_options = get_post_meta($post_id,'layout_options', true);
206
+ $layout_preview_img = !empty($layout_options['layout_preview_img']) ? $layout_options['layout_preview_img'] : 'https://i.imgur.com/JyurCtY.jpg';
207
+
208
+ $product_thumb_url = !empty( $product_thumb_url ) ? $product_thumb_url : $layout_preview_img;
209
+
210
+ $item_layout_args[$post_id] = array('name'=>$layout_name, 'link_text'=>'Edit', 'link'=> get_edit_post_link($post_id), 'thumb'=> $product_thumb_url, );
211
+
212
+ endwhile;
213
+ endif;
214
+
215
+
216
+
217
+
218
+
219
+ $args = array(
220
+ 'id' => 'layout_id',
221
+ 'parent' => 'post_grid_post_settings',
222
+ 'title' => __('Post template layouts','post-grid'),
223
+ 'details' => __('Choose layout for post template.','post-grid'),
224
+ 'type' => 'radio_image',
225
+ 'value' => $layout_id,
226
+ 'default' => '',
227
+ 'width' => '250px',
228
+ 'args' => $item_layout_args,
229
+ );
230
+
231
+ $settings_tabs_field->generate_field($args);
232
+
233
+
234
+
235
+ ?>
236
+ </div>
237
+ <?php
238
+
239
+
240
+
241
+ }
242
+
includes/{functions-layout-hook.php → post-grid-layout-elements.php} RENAMED
@@ -1,6 +1,279 @@
1
  <?php
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
 
@@ -178,6 +451,79 @@ function post_grid_layout_element_option_custom_text($parameters){
178
  }
179
 
180
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
181
  add_action('post_grid_layout_element_option_title','post_grid_layout_element_option_title');
182
  function post_grid_layout_element_option_title($parameters){
183
 
@@ -403,19 +749,124 @@ function post_grid_layout_element_option_title($parameters){
403
  }
404
 
405
 
 
406
 
 
407
 
 
 
408
 
409
- add_action('post_grid_layout_element_option_title_link','post_grid_layout_element_option_title_link');
410
 
 
411
 
412
- function post_grid_layout_element_option_title_link($parameters){
413
 
414
- $settings_tabs_field = new settings_tabs_field();
415
 
416
- $input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
417
- $element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
418
- $element_index = isset($parameters['index']) ? $parameters['index'] : '';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
419
 
420
 
421
  $color = isset($element_data['color']) ? $element_data['color'] : '';
@@ -634,11 +1085,113 @@ function post_grid_layout_element_option_title_link($parameters){
634
  }
635
 
636
 
 
637
 
 
638
 
 
 
639
 
640
- add_action('post_grid_layout_element_option_excerpt_read_more','post_grid_layout_element_option_excerpt_read_more');
641
- function post_grid_layout_element_option_excerpt_read_more($parameters){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
642
 
643
  $settings_tabs_field = new settings_tabs_field();
644
 
@@ -646,16 +1199,7 @@ function post_grid_layout_element_option_excerpt_read_more($parameters){
646
  $element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
647
  $element_index = isset($parameters['index']) ? $parameters['index'] : '';
648
 
649
- $excerpt_source = isset($element_data['excerpt_source']) ? $element_data['excerpt_source'] : '';
650
-
651
- $link_target = isset($element_data['link_target']) ? $element_data['link_target'] : '';
652
- $char_limit = isset($element_data['char_limit']) ? $element_data['char_limit'] : 0;
653
- $read_more_text = isset($element_data['read_more_text']) ? $element_data['read_more_text'] : __('Read more', 'post-grid');
654
-
655
- $wrapper_html = isset($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '';
656
- $color = isset($element_data['color']) ? $element_data['color'] : '';
657
 
658
- $font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
659
  $font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
660
  $margin = isset($element_data['margin']) ? $element_data['margin'] : '';
661
  $text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
@@ -669,101 +1213,46 @@ function post_grid_layout_element_option_excerpt_read_more($parameters){
669
  <span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
670
  <span class="sort"><i class="fas fa-sort"></i></span>
671
 
672
- <span class="expand"><?php echo __('Excerpt read more','post-grid'); ?></span>
673
  </div>
674
  <div class="element-options options">
675
 
676
  <?php
677
 
678
- $args = array(
679
- 'id' => 'excerpt_source',
680
- 'css_id' => $element_index.'_excerpt_source',
681
- 'parent' => $input_name.'[excerpt]',
682
- 'title' => __('Excerpt source','post-grid'),
683
- 'details' => __('Choose excerpt source.','post-grid'),
684
- 'type' => 'select',
685
- 'value' => $excerpt_source,
686
- 'default' => 'post_link',
687
- 'args' => array(
688
- 'excerpt_field'=> __('Excerpt field', 'post-grid'),
689
- 'content'=> __('Content', 'post-grid'),
690
- 'excerpt_content'=> __('Excerpt first then Content', 'post-grid'),
691
-
692
-
693
- ),
694
- );
695
-
696
- $settings_tabs_field->generate_field($args);
697
 
698
  $args = array(
699
- 'id' => 'char_limit',
700
- 'css_id' => $element_index.'_char_limit',
701
- 'parent' => $input_name.'[excerpt_read_more]',
702
- 'title' => __('Word limit','post-grid'),
703
- 'details' => __('Set word limit.','post-grid'),
704
  'type' => 'text',
705
- 'value' => $char_limit,
706
  'default' => '',
707
- 'placeholder' => '20',
708
  );
709
 
710
  $settings_tabs_field->generate_field($args);
711
 
712
  $args = array(
713
- 'id' => 'read_more_text',
714
- 'css_id' => $element_index.'_read_more_text',
715
- 'parent' => $input_name.'[excerpt_read_more]',
716
- 'title' => __('Read more text','post-grid'),
717
- 'details' => __('Custom read more text.','post-grid'),
718
- 'type' => 'text',
719
- 'value' => $read_more_text,
720
- 'default' => '',
721
- 'placeholder' => 'Read more',
722
- );
723
-
724
- $settings_tabs_field->generate_field($args);
725
- $args = array(
726
- 'id' => 'link_target',
727
- 'css_id' => $element_index.'_link_target',
728
- 'parent' => $input_name.'[excerpt_read_more]',
729
- 'title' => __('Link target','post-grid'),
730
- 'details' => __('Choose option link target.','post-grid'),
731
  'type' => 'select',
732
- 'value' => $link_target,
733
- 'default' => 'post_link',
734
- 'args' => array(
735
- '_blank'=> __('_blank', 'post-grid'),
736
- '_parent'=> __('_parent', 'post-grid'),
737
- '_self'=> __('_self', 'post-grid'),
738
- '_top'=> __('_top', 'post-grid'),
739
-
740
- ),
741
  );
742
 
743
  $settings_tabs_field->generate_field($args);
744
 
745
 
746
-
747
-
748
-
749
-
750
- $args = array(
751
- 'id' => 'color',
752
- 'css_id' => $element_index.'_color',
753
- 'parent' => $input_name.'[excerpt_read_more]',
754
- 'title' => __('Text Color','post-grid'),
755
- 'details' => __('Choose text color.','post-grid'),
756
- 'type' => 'colorpicker',
757
- 'value' => $color,
758
- 'default' => '',
759
- );
760
-
761
- $settings_tabs_field->generate_field($args);
762
-
763
  $args = array(
764
  'id' => 'margin',
765
  'css_id' => $element_index.'_margin',
766
- 'parent' => $input_name.'[excerpt_read_more]',
767
  'title' => __('Margin','post-grid'),
768
  'details' => __('Set margin.','post-grid'),
769
  'type' => 'text',
@@ -774,38 +1263,11 @@ function post_grid_layout_element_option_excerpt_read_more($parameters){
774
 
775
  $settings_tabs_field->generate_field($args);
776
 
777
- $args = array(
778
- 'id' => 'font_size',
779
- 'css_id' => $element_index.'_font_size',
780
- 'parent' => $input_name.'[excerpt_read_more]',
781
- 'title' => __('Font size','post-grid'),
782
- 'details' => __('Set font size.','post-grid'),
783
- 'type' => 'text',
784
- 'value' => $font_size,
785
- 'default' => '',
786
- 'placeholder' => '16px',
787
- );
788
-
789
- $settings_tabs_field->generate_field($args);
790
-
791
- $args = array(
792
- 'id' => 'text_align',
793
- 'css_id' => $element_index.'_text_align',
794
- 'parent' => $input_name.'[excerpt_read_more]',
795
- 'title' => __('Text align','post-grid'),
796
- 'details' => __('Choose text align.','post-grid'),
797
- 'type' => 'select',
798
- 'value' => $text_align,
799
- 'default' => 'left',
800
- 'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
801
- );
802
-
803
- $settings_tabs_field->generate_field($args);
804
 
805
  $args = array(
806
  'id' => 'css',
807
  'css_id' => $element_index.'_css',
808
- 'parent' => $input_name.'[excerpt_read_more]',
809
  'title' => __('Custom CSS','post-grid'),
810
  'details' => __('Set csutom CSS.','post-grid'),
811
  'type' => 'textarea',
@@ -819,7 +1281,7 @@ function post_grid_layout_element_option_excerpt_read_more($parameters){
819
  $args = array(
820
  'id' => 'css_hover',
821
  'css_id' => $element_index.'_css_hover',
822
- 'parent' => $input_name.'[excerpt_read_more]',
823
  'title' => __('Hover CSS','post-grid'),
824
  'details' => __('Set hover custom CSS.','post-grid'),
825
  'type' => 'textarea',
@@ -850,6 +1312,7 @@ function post_grid_layout_element_option_excerpt_read_more($parameters){
850
 
851
  $settings_tabs_field->generate_field($args);
852
 
 
853
  ?>
854
 
855
  </div>
@@ -859,8 +1322,44 @@ function post_grid_layout_element_option_excerpt_read_more($parameters){
859
  }
860
 
861
 
862
- add_action('post_grid_layout_element_option_read_more','post_grid_layout_element_option_read_more');
863
- function post_grid_layout_element_option_read_more($parameters){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
864
 
865
  $settings_tabs_field = new settings_tabs_field();
866
 
@@ -868,73 +1367,85 @@ function post_grid_layout_element_option_read_more($parameters){
868
  $element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
869
  $element_index = isset($parameters['index']) ? $parameters['index'] : '';
870
 
871
- $link_to = isset($element_data['link_to']) ? $element_data['link_to'] : '';
872
- $link_target = isset($element_data['link_target']) ? $element_data['link_target'] : '';
873
- $wrapper_html = isset($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '';
874
- $read_more_text = isset($element_data['read_more_text']) ? $element_data['read_more_text'] : __('Read more', 'post-grid');
875
-
876
- $color = isset($element_data['color']) ? $element_data['color'] : '';
877
-
878
  $font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
879
  $font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
880
  $margin = isset($element_data['margin']) ? $element_data['margin'] : '';
 
881
  $text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
882
 
 
 
 
 
 
 
883
  $css = isset($element_data['css']) ? $element_data['css'] : '';
884
  $css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
885
 
886
 
887
-
888
  ?>
889
  <div class="item">
890
  <div class="element-title header ">
891
  <span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
892
  <span class="sort"><i class="fas fa-sort"></i></span>
893
 
894
- <span class="expand"><?php echo __('Read more','post-grid'); ?></span>
895
  </div>
896
  <div class="element-options options">
897
 
898
  <?php
899
 
900
  $args = array(
901
- 'id' => 'read_more_text',
902
- 'css_id' => $element_index.'_read_more_text',
903
- 'parent' => $input_name.'[read_more]',
904
- 'title' => __('Read more text','post-grid'),
905
- 'details' => __('Custom read more text.','post-grid'),
906
- 'type' => 'text',
907
- 'value' => $read_more_text,
908
- 'default' => '',
909
- 'placeholder' => 'Read more',
 
 
 
 
 
 
910
  );
911
 
912
  $settings_tabs_field->generate_field($args);
913
 
914
-
915
  $args = array(
916
- 'id' => 'link_to',
917
- 'css_id' => $element_index.'_link_to',
918
- 'parent' => $input_name.'[read_more]',
919
- 'title' => __('Link to','post-grid'),
920
- 'details' => __('Choose option to link title.','post-grid'),
921
- 'type' => 'select',
922
- 'value' => $link_to,
923
- 'default' => 'none',
924
- 'args' => array(
925
- 'post_link'=> __('Post link', 'post-grid'),
926
- //'meta_value'=> __('Meta value', 'post-grid'),
927
- 'none'=> __('None', 'post-grid'),
928
- ),
929
  );
930
 
931
  $settings_tabs_field->generate_field($args);
932
 
 
 
 
 
 
 
 
 
 
 
 
933
 
 
934
  $args = array(
935
  'id' => 'link_target',
936
  'css_id' => $element_index.'_link_target',
937
- 'parent' => $input_name.'[read_more]',
938
  'title' => __('Link target','post-grid'),
939
  'details' => __('Choose option link target.','post-grid'),
940
  'type' => 'select',
@@ -952,51 +1463,42 @@ function post_grid_layout_element_option_read_more($parameters){
952
  $settings_tabs_field->generate_field($args);
953
 
954
 
955
- $args = array(
956
- 'id' => 'color',
957
- 'css_id' => $element_index.'_color',
958
- 'parent' => $input_name.'[read_more]',
959
- 'title' => __('Text Color','post-grid'),
960
- 'details' => __('Choose text color.','post-grid'),
961
- 'type' => 'colorpicker',
962
- 'value' => $color,
963
- 'default' => '',
964
- );
965
 
966
- $settings_tabs_field->generate_field($args);
 
967
 
968
  $args = array(
969
  'id' => 'margin',
970
  'css_id' => $element_index.'_margin',
971
- 'parent' => $input_name.'[read_more]',
972
  'title' => __('Margin','post-grid'),
973
  'details' => __('Set margin.','post-grid'),
974
  'type' => 'text',
975
  'value' => $margin,
976
- 'default' => '',
977
  'placeholder' => '5px 0',
978
  );
979
 
980
  $settings_tabs_field->generate_field($args);
981
 
982
  $args = array(
983
- 'id' => 'font_size',
984
- 'css_id' => $element_index.'_font_size',
985
- 'parent' => $input_name.'[read_more]',
986
- 'title' => __('Font size','post-grid'),
987
- 'details' => __('Set font size.','post-grid'),
988
- 'type' => 'text',
989
- 'value' => $font_size,
990
  'default' => '',
991
- 'placeholder' => '16px',
992
  );
993
 
994
  $settings_tabs_field->generate_field($args);
995
 
 
996
  $args = array(
997
  'id' => 'text_align',
998
  'css_id' => $element_index.'_text_align',
999
- 'parent' => $input_name.'[read_more]',
1000
  'title' => __('Text align','post-grid'),
1001
  'details' => __('Choose text align.','post-grid'),
1002
  'type' => 'select',
@@ -1007,10 +1509,26 @@ function post_grid_layout_element_option_read_more($parameters){
1007
 
1008
  $settings_tabs_field->generate_field($args);
1009
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1010
  $args = array(
1011
  'id' => 'css',
1012
  'css_id' => $element_index.'_css',
1013
- 'parent' => $input_name.'[read_more]',
1014
  'title' => __('Custom CSS','post-grid'),
1015
  'details' => __('Set csutom CSS.','post-grid'),
1016
  'type' => 'textarea',
@@ -1024,7 +1542,7 @@ function post_grid_layout_element_option_read_more($parameters){
1024
  $args = array(
1025
  'id' => 'css_hover',
1026
  'css_id' => $element_index.'_css_hover',
1027
- 'parent' => $input_name.'[read_more]',
1028
  'title' => __('Hover CSS','post-grid'),
1029
  'details' => __('Set hover custom CSS.','post-grid'),
1030
  'type' => 'textarea',
@@ -1035,7 +1553,6 @@ function post_grid_layout_element_option_read_more($parameters){
1035
 
1036
  $settings_tabs_field->generate_field($args);
1037
 
1038
-
1039
  ob_start();
1040
  ?>
1041
  <textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}
@@ -1065,212 +1582,275 @@ function post_grid_layout_element_option_read_more($parameters){
1065
 
1066
 
1067
 
 
1068
 
1069
- add_action('post_grid_layout_element_option_media','post_grid_layout_element_option_media');
1070
 
 
 
1071
 
1072
- function post_grid_layout_element_option_media($parameters){
1073
 
1074
- $settings_tabs_field = new settings_tabs_field();
1075
 
1076
- $input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
1077
- $element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
1078
- $element_index = isset($parameters['index']) ? $parameters['index'] : '';
1079
 
1080
- $media_source = isset($element_data['media_source']) ? $element_data['media_source'] : array();
1081
- $padding = isset($element_data['padding']) ? $element_data['padding'] : '';
1082
- $margin = isset($element_data['margin']) ? $element_data['margin'] : '';
1083
 
1084
- $css = isset($element_data['css']) ? $element_data['css'] : '';
1085
- $css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
1086
 
1087
 
1088
- $media_sources_list = apply_filters('post_grid_media_source_list',
1089
- array(
1090
- 'featured_image'=>__('Featured Image','post-grid'),
1091
- 'first_image'=>__('First images from content','post-grid'),
1092
- 'empty_thumb'=>__('Empty thumbnail','post-grid'),
1093
- 'siteorigin_first_image'=>__('SiteOrigin first image','post-grid'),
1094
 
1095
- )
1096
- );
1097
 
 
 
1098
 
1099
- ?>
1100
- <div class="item">
1101
- <div class="element-title header ">
1102
- <span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
1103
- <span class="sort"><i class="fas fa-sort"></i></span>
1104
- <span class="expand"><?php echo __('Media','post-grid'); ?></span>
1105
- </div>
1106
- <div class="element-options options">
1107
- <?php
1108
 
1109
- ob_start();
1110
 
1111
- if(!empty($media_sources_list)){
1112
- $media_source_new = array();
1113
 
1114
- if(!empty($media_source))
1115
- foreach ($media_source as $elementIndex => $argData){
1116
- $enable = isset($argData['enable']) ? $argData['enable'] :'';
 
1117
 
1118
- if($enable == 'yes')
1119
- $media_source_new[$elementIndex] = array('enable'=> $enable);
1120
 
1121
- }
1122
- $media_sources_new = array_replace($media_source_new, $media_sources_list);
1123
- $media_sources_new = (!empty($media_sources_new)) ? $media_sources_new : $media_sources_list;
1124
- ?>
1125
- <div class="expandable sortable">
1126
- <?php
1127
 
1128
- if(!empty($media_sources_new))
1129
- foreach ($media_sources_new as $source_id => $source_name ) {
1130
 
1131
- if(is_array($source_name)) continue;
 
 
 
1132
 
1133
- $media_source_options = array();
1134
- $source_data = isset($media_source[$source_id]) ? $media_source[$source_id] : array();
1135
- $source_enable = isset($media_source[$source_id]['enable']) ? $media_source[$source_id]['enable'] : '';
1136
 
1137
- $media_source_options['index'] = $element_index;
1138
- $media_source_options['input_name'] = $input_name;
1139
- $media_source_options['source_data'] = $source_data;
1140
 
1141
- ?>
1142
- <div class="item">
1143
- <div class="element-title header ">
1144
- <span class="sort"><i class="fas fa-sort"></i></span>
1145
- <?php
1146
- if($source_enable == 'yes'):
1147
- ?><i class="fas fa-check"></i><?php
1148
- else:
1149
- ?><i class="fas fa-times"></i><?php
1150
- endif;?>
1151
- <span class="expand"><?php echo $source_name; ?></span>
1152
- </div>
1153
- <div class="element-options options">
1154
- <?php
1155
- do_action('media_source_options_'.$source_id, $media_source_options);
1156
- ?>
1157
- </div>
1158
- </div>
1159
- <?php
1160
- }
1161
- ?>
1162
- </div>
1163
- <?php
1164
- }
1165
 
1166
- $html = ob_get_clean();
1167
 
1168
- $args = array(
1169
- 'id' => 'media_source',
1170
- 'title' => __('Media source', 'post-grid'),
1171
- 'details' => __('Choose media sources.', 'post-grid'),
1172
- 'type' => 'custom_html',
1173
- 'html' => $html,
1174
- );
1175
 
1176
- $settings_tabs_field->generate_field($args);
1177
 
1178
 
 
 
 
1179
 
1180
- $media_height = isset($element_data['media_height']) ? $element_data['media_height'] : '';
1181
 
1182
- $media_height_large = isset($media_height['large']) ? $media_height['large'] : '';
1183
- $media_height_large_type = isset($media_height['large_type']) ? $media_height['large_type'] : '';
1184
 
1185
- $media_height_medium = isset($media_height['medium']) ? $media_height['medium'] : '';
1186
- $media_height_medium_type = isset($media_height['medium_type']) ? $media_height['medium_type'] : '';
 
 
 
 
 
 
 
 
 
 
 
1187
 
1188
- $media_height_small = isset($media_height['small']) ? $media_height['small'] : '';
1189
- $media_height_small_type = isset($media_height['small_type']) ? $media_height['small_type'] : '';
1190
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1191
 
1192
- $args = array(
1193
- 'id' => 'media_height',
1194
- 'title' => __('Media height','post-grid'),
1195
- 'details' => __('Set media height.','post-grid'),
1196
- 'type' => 'option_group',
1197
- 'options' => array(
1198
 
1199
- array(
1200
- 'id' => 'large_type',
1201
- 'css_id' => $element_index.'_text_align',
1202
- 'parent' => $input_name.'[media][media_height]',
1203
- 'title' => __('In desktop','post-grid'),
1204
- 'details' => __('min-width: 1200px, ex: 280px','post-grid'),
1205
- 'type' => 'select',
1206
- 'value' => $media_height_large_type,
1207
- 'default' => 'left',
1208
- 'args' => array('auto_height'=> __('Auto height', 'post-grid'),'fixed_height'=> __('Fixed height', 'post-grid'),'max_height'=> __('Max height', 'post-grid') ),
1209
- ),
1210
- array(
1211
- 'id' => 'large',
1212
- 'parent' => $input_name.'[media][media_height]',
1213
- 'title' => __('Height value','post-grid'),
1214
- //'details' => __('','post-grid'),
1215
- 'type' => 'text',
1216
- 'value' => $media_height_large,
1217
- 'default' => '',
1218
- 'placeholder' => '280px',
1219
- ),
1220
- array(
1221
- 'id' => 'medium_type',
1222
- 'css_id' => $element_index.'_text_align',
1223
- 'parent' => $input_name.'[media][media_height]',
1224
- 'title' => __('In tablet & small desktop','post-grid'),
1225
- 'details' => __('min-width: 992px, ex: 280px','post-grid'),
1226
- 'type' => 'select',
1227
- 'value' => $media_height_medium_type,
1228
- 'default' => 'left',
1229
- 'args' => array('auto_height'=> __('Auto height', 'post-grid'),'fixed_height'=> __('Fixed height', 'post-grid'),'max_height'=> __('Max height', 'post-grid') ),
1230
- ),
1231
- array(
1232
- 'id' => 'medium',
1233
- 'parent' => $input_name.'[media][media_height]',
1234
- 'title' => __('Height value','post-grid'),
1235
- //'details' => __('','post-grid'),
1236
- 'type' => 'text',
1237
- 'value' => $media_height_medium,
1238
- 'default' => '',
1239
- 'placeholder' => '280px',
1240
- ),
1241
- array(
1242
- 'id' => 'small_type',
1243
- 'css_id' => $element_index.'_text_align',
1244
- 'parent' => $input_name.'[media][media_height]',
1245
- 'title' => __('In mobile','post-grid'),
1246
- 'details' => __('max-width: 768px, ex: 280px','post-grid'),
1247
- 'type' => 'select',
1248
- 'value' => $media_height_small_type,
1249
- 'default' => 'left',
1250
- 'args' => array('auto_height'=> __('Auto height', 'post-grid'),'fixed_height'=> __('Fixed height', 'post-grid'),'max_height'=> __('Max height', 'post-grid') ),
1251
- ),
1252
- array(
1253
- 'id' => 'small',
1254
- 'parent' => $input_name.'[media][media_height]',
1255
- 'title' => __('Height value','post-grid'),
1256
- //'details' => __('','post-grid'),
1257
- 'type' => 'text',
1258
- 'value' => $media_height_small,
1259
- 'default' => '',
1260
- 'placeholder' => '280px',
1261
- ),
1262
  ),
 
1263
 
 
 
 
 
 
 
 
 
 
 
 
 
1264
  );
1265
 
1266
  $settings_tabs_field->generate_field($args);
1267
 
 
 
 
 
 
 
 
 
 
 
 
1268
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1269
 
1270
  $args = array(
1271
  'id' => 'margin',
1272
  'css_id' => $element_index.'_margin',
1273
- 'parent' => $input_name.'[media]',
1274
  'title' => __('Margin','post-grid'),
1275
  'details' => __('Set margin.','post-grid'),
1276
  'type' => 'text',
@@ -1281,26 +1861,38 @@ function post_grid_layout_element_option_media($parameters){
1281
 
1282
  $settings_tabs_field->generate_field($args);
1283
 
1284
-
1285
  $args = array(
1286
- 'id' => 'padding',
1287
- 'css_id' => $element_index.'_margin',
1288
- 'parent' => $input_name.'[media]',
1289
- 'title' => __('Padding','post-grid'),
1290
- 'details' => __('Set padding.','post-grid'),
1291
  'type' => 'text',
1292
- 'value' => $padding,
1293
  'default' => '',
1294
- 'placeholder' => '5px 0',
1295
  );
1296
 
1297
  $settings_tabs_field->generate_field($args);
1298
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1299
 
1300
  $args = array(
1301
  'id' => 'css',
1302
  'css_id' => $element_index.'_css',
1303
- 'parent' => $input_name.'[media]',
1304
  'title' => __('Custom CSS','post-grid'),
1305
  'details' => __('Set csutom CSS.','post-grid'),
1306
  'type' => 'textarea',
@@ -1314,7 +1906,7 @@ function post_grid_layout_element_option_media($parameters){
1314
  $args = array(
1315
  'id' => 'css_hover',
1316
  'css_id' => $element_index.'_css_hover',
1317
- 'parent' => $input_name.'[media]',
1318
  'title' => __('Hover CSS','post-grid'),
1319
  'details' => __('Set hover custom CSS.','post-grid'),
1320
  'type' => 'textarea',
@@ -1325,6 +1917,7 @@ function post_grid_layout_element_option_media($parameters){
1325
 
1326
  $settings_tabs_field->generate_field($args);
1327
 
 
1328
  ob_start();
1329
  ?>
1330
  <textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}
@@ -1344,7 +1937,6 @@ function post_grid_layout_element_option_media($parameters){
1344
 
1345
  $settings_tabs_field->generate_field($args);
1346
 
1347
-
1348
  ?>
1349
 
1350
  </div>
@@ -1354,11 +1946,139 @@ function post_grid_layout_element_option_media($parameters){
1354
  }
1355
 
1356
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1357
 
1358
- add_action('post_grid_layout_element_option_thumb_link','post_grid_layout_element_option_thumb_link');
1359
 
1360
 
1361
- function post_grid_layout_element_option_thumb_link($parameters){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1362
 
1363
  $settings_tabs_field = new settings_tabs_field();
1364
 
@@ -1366,17 +2086,17 @@ function post_grid_layout_element_option_thumb_link($parameters){
1366
  $element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
1367
  $element_index = isset($parameters['index']) ? $parameters['index'] : '';
1368
 
1369
- $thumb_size = isset($element_data['thumb_size']) ? $element_data['thumb_size'] : '';
1370
- $default_thumb_src = isset($element_data['default_thumb_src']) ? $element_data['default_thumb_src'] : '';
1371
  $link_target = isset($element_data['link_target']) ? $element_data['link_target'] : '';
 
 
1372
 
1373
- $thumb_height = isset($element_data['thumb_height']) ? $element_data['thumb_height'] : '';
1374
- $margin = isset($element_data['margin']) ? $element_data['margin'] : '';
1375
- $link_to = isset($element_data['link_to']) ? $element_data['link_to'] : '';
1376
 
1377
- $thumb_height_large = isset($thumb_height['large']) ? $thumb_height['large'] : '';
1378
- $thumb_height_medium = isset($thumb_height['medium']) ? $thumb_height['medium'] : '';
1379
- $thumb_height_small = isset($thumb_height['small']) ? $thumb_height['small'] : '';
 
1380
 
1381
  $css = isset($element_data['css']) ? $element_data['css'] : '';
1382
  $css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
@@ -1389,44 +2109,31 @@ function post_grid_layout_element_option_thumb_link($parameters){
1389
  <span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
1390
  <span class="sort"><i class="fas fa-sort"></i></span>
1391
 
1392
- <span class="expand"><?php echo __('Thumbnail with link','post-grid'); ?></span>
1393
  </div>
1394
  <div class="element-options options">
1395
 
1396
  <?php
1397
 
1398
- $thumbnail_sizes = array();
1399
- $thumbnail_sizes['full'] = __('Full', '');
1400
- $get_intermediate_image_sizes = get_intermediate_image_sizes();
1401
-
1402
- if(!empty($get_intermediate_image_sizes))
1403
- foreach($get_intermediate_image_sizes as $size_key){
1404
- $size_name = str_replace('_', ' ',$size_key);
1405
- $size_name = str_replace('-', ' ',$size_name);
1406
-
1407
- $thumbnail_sizes[$size_key] = ucfirst($size_name);
1408
- }
1409
- //echo '<pre>'.var_export($thumbnail_sizes, true).'</pre>';
1410
-
1411
  $args = array(
1412
- 'id' => 'thumb_size',
1413
- 'parent' => $input_name.'[thumb_link]',
1414
- 'title' => __('Thumbnail size','post-grid'),
1415
- 'details' => __('Choose thumbnail size.','post-grid'),
1416
- 'type' => 'select',
1417
- 'value' => $thumb_size,
1418
- 'default' => 'large',
1419
- 'args' => $thumbnail_sizes,
 
1420
  );
1421
 
1422
  $settings_tabs_field->generate_field($args);
1423
 
1424
 
1425
-
1426
  $args = array(
1427
  'id' => 'link_to',
1428
  'css_id' => $element_index.'_link_to',
1429
- 'parent' => $input_name.'[thumb_link]',
1430
  'title' => __('Link to','post-grid'),
1431
  'details' => __('Choose option to link title.','post-grid'),
1432
  'type' => 'select',
@@ -1445,7 +2152,7 @@ function post_grid_layout_element_option_thumb_link($parameters){
1445
  $args = array(
1446
  'id' => 'link_target',
1447
  'css_id' => $element_index.'_link_target',
1448
- 'parent' => $input_name.'[thumb_link]',
1449
  'title' => __('Link target','post-grid'),
1450
  'details' => __('Choose option link target.','post-grid'),
1451
  'type' => 'select',
@@ -1463,66 +2170,23 @@ function post_grid_layout_element_option_thumb_link($parameters){
1463
  $settings_tabs_field->generate_field($args);
1464
 
1465
 
1466
-
1467
- $args = array(
1468
- 'id' => 'thumb_height',
1469
- 'title' => __('Thumbnail height','post-grid'),
1470
- 'details' => __('Set thumbnail height.','post-grid'),
1471
- 'type' => 'option_group',
1472
- 'options' => array(
1473
- array(
1474
- 'id' => 'large',
1475
- 'parent' => $input_name.'[thumb_link][thumb_height]',
1476
- 'title' => __('In desktop','post-grid'),
1477
- 'details' => __('min-width: 1200px, ex: 280px','post-grid'),
1478
- 'type' => 'text',
1479
- 'value' => $thumb_height_large,
1480
- 'default' => '',
1481
- 'placeholder' => '280px',
1482
- ),
1483
- array(
1484
- 'id' => 'medium',
1485
- 'parent' => $input_name.'[thumb_link][thumb_height]',
1486
- 'title' => __('In tablet & small desktop','post-grid'),
1487
- 'details' => __('min-width: 992px, ex: 280px','post-grid'),
1488
- 'type' => 'text',
1489
- 'value' => $thumb_height_medium,
1490
- 'default' => '',
1491
- 'placeholder' => '280px',
1492
- ),
1493
- array(
1494
- 'id' => 'small',
1495
- 'parent' => $input_name.'[thumb_link][thumb_height]',
1496
- 'title' => __('In mobile','post-grid'),
1497
- 'details' => __('max-width: 768px, ex: 280px','post-grid'),
1498
- 'type' => 'text',
1499
- 'value' => $thumb_height_small,
1500
- 'default' => '',
1501
- 'placeholder' => '280px',
1502
- ),
1503
- ),
1504
-
1505
- );
1506
-
1507
- $settings_tabs_field->generate_field($args);
1508
-
1509
  $args = array(
1510
- 'id' => 'default_thumb_src',
1511
- 'parent' => $input_name.'[thumb_link]',
1512
- 'title' => __('Default thumbnail','post-grid'),
1513
- 'details' => __('Choose default thumbnail.','post-grid'),
1514
- 'type' => 'media_url',
1515
- 'value' => $default_thumb_src,
 
1516
  'default' => '',
1517
  );
1518
 
1519
  $settings_tabs_field->generate_field($args);
1520
 
1521
-
1522
  $args = array(
1523
  'id' => 'margin',
1524
  'css_id' => $element_index.'_margin',
1525
- 'parent' => $input_name.'[thumb_link]',
1526
  'title' => __('Margin','post-grid'),
1527
  'details' => __('Set margin.','post-grid'),
1528
  'type' => 'text',
@@ -1533,10 +2197,38 @@ function post_grid_layout_element_option_thumb_link($parameters){
1533
 
1534
  $settings_tabs_field->generate_field($args);
1535
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1536
  $args = array(
1537
  'id' => 'css',
1538
  'css_id' => $element_index.'_css',
1539
- 'parent' => $input_name.'[thumb_link]',
1540
  'title' => __('Custom CSS','post-grid'),
1541
  'details' => __('Set csutom CSS.','post-grid'),
1542
  'type' => 'textarea',
@@ -1550,7 +2242,7 @@ function post_grid_layout_element_option_thumb_link($parameters){
1550
  $args = array(
1551
  'id' => 'css_hover',
1552
  'css_id' => $element_index.'_css_hover',
1553
- 'parent' => $input_name.'[thumb_link]',
1554
  'title' => __('Hover CSS','post-grid'),
1555
  'details' => __('Set hover custom CSS.','post-grid'),
1556
  'type' => 'textarea',
@@ -1581,7 +2273,6 @@ function post_grid_layout_element_option_thumb_link($parameters){
1581
 
1582
  $settings_tabs_field->generate_field($args);
1583
 
1584
-
1585
  ?>
1586
 
1587
  </div>
@@ -1592,10 +2283,104 @@ function post_grid_layout_element_option_thumb_link($parameters){
1592
 
1593
 
1594
 
1595
- add_action('post_grid_layout_element_option_thumb','post_grid_layout_element_option_thumb');
1596
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1597
 
1598
- function post_grid_layout_element_option_thumb($parameters){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1599
 
1600
  $settings_tabs_field = new settings_tabs_field();
1601
 
@@ -1603,137 +2388,185 @@ function post_grid_layout_element_option_thumb($parameters){
1603
  $element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
1604
  $element_index = isset($parameters['index']) ? $parameters['index'] : '';
1605
 
1606
- $thumb_size = isset($element_data['thumb_size']) ? $element_data['thumb_size'] : '';
1607
- $default_thumb_src = isset($element_data['default_thumb_src']) ? $element_data['default_thumb_src'] : '';
1608
-
1609
- $thumb_height = isset($element_data['thumb_height']) ? $element_data['thumb_height'] : '';
1610
  $margin = isset($element_data['margin']) ? $element_data['margin'] : '';
1611
- $link_to = isset($element_data['link_to']) ? $element_data['link_to'] : '';
1612
- $link_target = isset($element_data['link_target']) ? $element_data['link_target'] : '';
1613
-
1614
- $thumb_height_large = isset($thumb_height['large']) ? $thumb_height['large'] : '';
1615
- $thumb_height_medium = isset($thumb_height['medium']) ? $thumb_height['medium'] : '';
1616
- $thumb_height_small = isset($thumb_height['small']) ? $thumb_height['small'] : '';
1617
-
1618
 
1619
  $css = isset($element_data['css']) ? $element_data['css'] : '';
1620
  $css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
1621
 
1622
 
 
 
 
 
 
 
 
 
 
 
 
1623
  ?>
1624
  <div class="item">
1625
  <div class="element-title header ">
1626
  <span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
1627
  <span class="sort"><i class="fas fa-sort"></i></span>
1628
-
1629
- <span class="expand"><?php echo __('Thumbnail','post-grid'); ?></span>
1630
  </div>
1631
  <div class="element-options options">
1632
-
1633
  <?php
1634
 
1635
- $thumbnail_sizes = array();
1636
- $thumbnail_sizes['full'] = __('Full', '');
1637
- $get_intermediate_image_sizes = get_intermediate_image_sizes();
1638
 
1639
- if(!empty($get_intermediate_image_sizes))
1640
- foreach($get_intermediate_image_sizes as $size_key){
1641
- $size_name = str_replace('_', ' ',$size_key);
1642
- $size_name = str_replace('-', ' ',$size_name);
1643
 
1644
- $thumbnail_sizes[$size_key] = ucfirst($size_name);
1645
- }
1646
- //echo '<pre>'.var_export($thumbnail_sizes, true).'</pre>';
1647
 
1648
- $args = array(
1649
- 'id' => 'thumb_size',
1650
- 'parent' => $input_name.'[thumb]',
1651
- 'title' => __('Thumbnail size','post-grid'),
1652
- 'details' => __('Choose thumbnail size.','post-grid'),
1653
- 'type' => 'select',
1654
- 'value' => $thumb_size,
1655
- 'default' => 'large',
1656
- 'args' => $thumbnail_sizes,
1657
- );
1658
 
1659
- $settings_tabs_field->generate_field($args);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1660
 
 
 
 
1661
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1662
 
 
1663
 
1664
  $args = array(
1665
- 'id' => 'link_to',
1666
- 'css_id' => $element_index.'_link_to',
1667
- 'parent' => $input_name.'[thumb]',
1668
- 'title' => __('Link to','post-grid'),
1669
- 'details' => __('Choose option to link title.','post-grid'),
1670
- 'type' => 'select',
1671
- 'value' => $link_to,
1672
- 'default' => 'none',
1673
- 'args' => array(
1674
- 'post_link'=> __('Post link', 'post-grid'),
1675
- 'none'=> __('None', 'post-grid'),
1676
- ),
1677
  );
1678
 
1679
  $settings_tabs_field->generate_field($args);
1680
 
1681
 
1682
- $args = array(
1683
- 'id' => 'link_target',
1684
- 'css_id' => $element_index.'_link_target',
1685
- 'parent' => $input_name.'[thumb]',
1686
- 'title' => __('Link target','post-grid'),
1687
- 'details' => __('Choose option link target.','post-grid'),
1688
- 'type' => 'select',
1689
- 'value' => $link_target,
1690
- 'default' => 'post_link',
1691
- 'args' => array(
1692
- '_blank'=> __('_blank', 'post-grid'),
1693
- '_parent'=> __('_parent', 'post-grid'),
1694
- '_self'=> __('_self', 'post-grid'),
1695
- '_top'=> __('_top', 'post-grid'),
1696
 
1697
- ),
1698
- );
1699
 
1700
- $settings_tabs_field->generate_field($args);
 
 
 
 
1701
 
 
 
1702
 
1703
 
1704
  $args = array(
1705
- 'id' => 'thumb_height',
1706
- 'title' => __('Thumbnail height','post-grid'),
1707
- 'details' => __('Set thumbnail height.','post-grid'),
1708
  'type' => 'option_group',
1709
  'options' => array(
 
1710
  array(
1711
- 'id' => 'large',
1712
- 'parent' => $input_name.'[thumb][thumb_height]',
 
1713
  'title' => __('In desktop','post-grid'),
1714
  'details' => __('min-width: 1200px, ex: 280px','post-grid'),
 
 
 
 
 
 
 
 
 
 
1715
  'type' => 'text',
1716
- 'value' => $thumb_height_large,
1717
  'default' => '',
1718
  'placeholder' => '280px',
1719
  ),
1720
  array(
1721
- 'id' => 'medium',
1722
- 'parent' => $input_name.'[thumb][thumb_height]',
 
1723
  'title' => __('In tablet & small desktop','post-grid'),
1724
  'details' => __('min-width: 992px, ex: 280px','post-grid'),
 
 
 
 
 
 
 
 
 
 
1725
  'type' => 'text',
1726
- 'value' => $thumb_height_medium,
1727
  'default' => '',
1728
  'placeholder' => '280px',
1729
  ),
1730
  array(
1731
- 'id' => 'small',
1732
- 'parent' => $input_name.'[thumb][thumb_height]',
 
1733
  'title' => __('In mobile','post-grid'),
1734
  'details' => __('max-width: 768px, ex: 280px','post-grid'),
 
 
 
 
 
 
 
 
 
 
1735
  'type' => 'text',
1736
- 'value' => $thumb_height_small,
1737
  'default' => '',
1738
  'placeholder' => '280px',
1739
  ),
@@ -1743,37 +2576,42 @@ function post_grid_layout_element_option_thumb($parameters){
1743
 
1744
  $settings_tabs_field->generate_field($args);
1745
 
 
 
1746
  $args = array(
1747
- 'id' => 'default_thumb_src',
1748
- 'parent' => $input_name.'[thumb]',
1749
- 'title' => __('Default thumbnail','post-grid'),
1750
- 'details' => __('Choose default thumbnail.','post-grid'),
1751
- 'type' => 'media_url',
1752
- 'value' => $default_thumb_src,
 
1753
  'default' => '',
 
1754
  );
1755
 
1756
  $settings_tabs_field->generate_field($args);
1757
 
1758
 
1759
  $args = array(
1760
- 'id' => 'margin',
1761
  'css_id' => $element_index.'_margin',
1762
- 'parent' => $input_name.'[thumb]',
1763
- 'title' => __('Margin','post-grid'),
1764
- 'details' => __('Set margin.','post-grid'),
1765
  'type' => 'text',
1766
- 'value' => $margin,
1767
  'default' => '',
1768
  'placeholder' => '5px 0',
1769
  );
1770
 
1771
  $settings_tabs_field->generate_field($args);
1772
 
 
1773
  $args = array(
1774
  'id' => 'css',
1775
  'css_id' => $element_index.'_css',
1776
- 'parent' => $input_name.'[thumb]',
1777
  'title' => __('Custom CSS','post-grid'),
1778
  'details' => __('Set csutom CSS.','post-grid'),
1779
  'type' => 'textarea',
@@ -1787,7 +2625,7 @@ function post_grid_layout_element_option_thumb($parameters){
1787
  $args = array(
1788
  'id' => 'css_hover',
1789
  'css_id' => $element_index.'_css_hover',
1790
- 'parent' => $input_name.'[thumb]',
1791
  'title' => __('Hover CSS','post-grid'),
1792
  'details' => __('Set hover custom CSS.','post-grid'),
1793
  'type' => 'textarea',
@@ -1798,7 +2636,6 @@ function post_grid_layout_element_option_thumb($parameters){
1798
 
1799
  $settings_tabs_field->generate_field($args);
1800
 
1801
-
1802
  ob_start();
1803
  ?>
1804
  <textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}
@@ -1828,10 +2665,170 @@ function post_grid_layout_element_option_thumb($parameters){
1828
  }
1829
 
1830
 
1831
- add_action('post_grid_layout_element_option_content','post_grid_layout_element_option_content');
1832
 
 
1833
 
1834
- function post_grid_layout_element_option_content($parameters){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1835
 
1836
  $settings_tabs_field = new settings_tabs_field();
1837
 
@@ -1839,132 +2836,154 @@ function post_grid_layout_element_option_content($parameters){
1839
  $element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
1840
  $element_index = isset($parameters['index']) ? $parameters['index'] : '';
1841
 
1842
- $word_count = isset($element_data['word_count']) ? $element_data['word_count'] : 15;
1843
- $read_more_text = isset($element_data['read_more_text']) ? $element_data['read_more_text'] : __('Read more','post-grid');
1844
- $read_more_color = isset($element_data['read_more_color']) ? $element_data['read_more_color'] : '';
1845
 
1846
- $color = isset($element_data['color']) ? $element_data['color'] : '';
1847
- $font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
1848
- $font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
1849
  $margin = isset($element_data['margin']) ? $element_data['margin'] : '';
1850
  $link_to = isset($element_data['link_to']) ? $element_data['link_to'] : '';
1851
- $text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
 
 
 
 
 
1852
 
1853
  $css = isset($element_data['css']) ? $element_data['css'] : '';
1854
  $css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
1855
 
 
1856
  ?>
1857
  <div class="item">
1858
  <div class="element-title header ">
1859
  <span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
1860
  <span class="sort"><i class="fas fa-sort"></i></span>
1861
 
1862
- <span class="expand"><?php echo __('Content','post-grid'); ?></span>
1863
  </div>
1864
  <div class="element-options options">
1865
 
1866
  <?php
1867
 
 
 
 
1868
 
 
 
 
 
1869
 
1870
- $args = array(
1871
- 'id' => 'word_count',
1872
- 'css_id' => $element_index.'_word_count',
1873
- 'parent' => $input_name.'[content]',
1874
- 'title' => __('Word count','post-grid'),
1875
- 'details' => __('Set word count.','post-grid'),
1876
- 'type' => 'text',
1877
- 'value' => $word_count,
1878
- 'default' => '',
1879
- 'placeholder' => '',
1880
- );
1881
-
1882
- $settings_tabs_field->generate_field($args);
1883
-
1884
-
1885
- $args = array(
1886
- 'id' => 'read_more_text',
1887
- 'css_id' => $element_index.'_read_more_text',
1888
- 'parent' => $input_name.'[content]',
1889
- 'title' => __('Read more text','post-grid'),
1890
- 'details' => __('Set custom read more text.','post-grid'),
1891
- 'type' => 'text',
1892
- 'value' => $read_more_text,
1893
- 'default' => '',
1894
- 'placeholder' => '',
1895
- );
1896
-
1897
- $settings_tabs_field->generate_field($args);
1898
-
1899
 
1900
  $args = array(
1901
- 'id' => 'read_more_color',
1902
- 'css_id' => $element_index.'_read_more_color',
1903
- 'parent' => $input_name.'[content]',
1904
- 'title' => __('Read more color','post-grid'),
1905
- 'details' => __('Set custom read more color.','post-grid'),
1906
- 'type' => 'colorpicker',
1907
- 'value' => $read_more_color,
1908
- 'default' => '',
1909
- 'placeholder' => '',
1910
  );
1911
 
1912
  $settings_tabs_field->generate_field($args);
1913
 
1914
 
1915
 
 
1916
  $args = array(
1917
- 'id' => 'color',
1918
- 'css_id' => $element_index.'_content_color',
1919
- 'parent' => $input_name.'[content]',
1920
- 'title' => __('Color','post-grid'),
1921
- 'details' => __('Title text color.','post-grid'),
1922
- 'type' => 'colorpicker',
1923
- 'value' => $color,
1924
- 'default' => '',
 
 
 
 
1925
  );
1926
 
1927
  $settings_tabs_field->generate_field($args);
1928
 
 
1929
  $args = array(
1930
- 'id' => 'font_size',
1931
- 'css_id' => $element_index.'_font_size',
1932
- 'parent' => $input_name.'[content]',
1933
- 'title' => __('Font size','post-grid'),
1934
- 'details' => __('Set font size.','post-grid'),
1935
- 'type' => 'text',
1936
- 'value' => $font_size,
1937
- 'default' => '',
1938
- 'placeholder' => '14px',
 
 
 
 
 
 
1939
  );
1940
 
1941
  $settings_tabs_field->generate_field($args);
1942
 
1943
 
 
1944
  $args = array(
1945
- 'id' => 'font_family',
1946
- 'css_id' => $element_index.'_font_family',
1947
- 'parent' => $input_name.'[content]',
1948
- 'title' => __('Font family','post-grid'),
1949
- 'details' => __('Set font family.','post-grid'),
1950
- 'type' => 'text',
1951
- 'value' => $font_family,
1952
- 'default' => '',
1953
- 'placeholder' => 'Open Sans',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1954
  );
1955
 
1956
  $settings_tabs_field->generate_field($args);
1957
 
1958
  $args = array(
1959
- 'id' => 'text_align',
1960
- 'css_id' => $element_index.'_text_align',
1961
- 'parent' => $input_name.'[content]',
1962
- 'title' => __('Text align','post-grid'),
1963
- 'details' => __('Choose text align.','post-grid'),
1964
- 'type' => 'select',
1965
- 'value' => $text_align,
1966
- 'default' => 'left',
1967
- 'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
1968
  );
1969
 
1970
  $settings_tabs_field->generate_field($args);
@@ -1973,7 +2992,7 @@ function post_grid_layout_element_option_content($parameters){
1973
  $args = array(
1974
  'id' => 'margin',
1975
  'css_id' => $element_index.'_margin',
1976
- 'parent' => $input_name.'[content]',
1977
  'title' => __('Margin','post-grid'),
1978
  'details' => __('Set margin.','post-grid'),
1979
  'type' => 'text',
@@ -1984,32 +3003,10 @@ function post_grid_layout_element_option_content($parameters){
1984
 
1985
  $settings_tabs_field->generate_field($args);
1986
 
1987
-
1988
-
1989
- $args = array(
1990
- 'id' => 'link_to',
1991
- 'css_id' => $element_index.'_link_to',
1992
- 'parent' => $input_name.'[content]',
1993
- 'title' => __('Link to','post-grid'),
1994
- 'details' => __('Choose option to product link.','post-grid'),
1995
- 'type' => 'select',
1996
- 'value' => $link_to,
1997
- 'default' => 'product_link',
1998
- 'args' => array(
1999
- 'none'=> __('None', 'post-grid'),
2000
- 'product_link'=> __('Product link', 'post-grid'),
2001
- 'external_product_url'=> __('External product', 'post-grid'),
2002
- // 'popup_box'=> __('Popup box', 'post-grid'),
2003
- // 'custom_link'=> __('Custom link', 'post-grid')
2004
- ),
2005
- );
2006
-
2007
- $settings_tabs_field->generate_field($args);
2008
-
2009
  $args = array(
2010
  'id' => 'css',
2011
  'css_id' => $element_index.'_css',
2012
- 'parent' => $input_name.'[content]',
2013
  'title' => __('Custom CSS','post-grid'),
2014
  'details' => __('Set csutom CSS.','post-grid'),
2015
  'type' => 'textarea',
@@ -2023,7 +3020,7 @@ function post_grid_layout_element_option_content($parameters){
2023
  $args = array(
2024
  'id' => 'css_hover',
2025
  'css_id' => $element_index.'_css_hover',
2026
- 'parent' => $input_name.'[content]',
2027
  'title' => __('Hover CSS','post-grid'),
2028
  'details' => __('Set hover custom CSS.','post-grid'),
2029
  'type' => 'textarea',
@@ -2065,9 +3062,114 @@ function post_grid_layout_element_option_content($parameters){
2065
 
2066
 
2067
 
 
2068
 
2069
- add_action('post_grid_layout_element_option_excerpt','post_grid_layout_element_option_excerpt');
2070
- function post_grid_layout_element_option_excerpt($parameters){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2071
 
2072
  $settings_tabs_field = new settings_tabs_field();
2073
 
@@ -2075,85 +3177,86 @@ function post_grid_layout_element_option_excerpt($parameters){
2075
  $element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
2076
  $element_index = isset($parameters['index']) ? $parameters['index'] : '';
2077
 
2078
- $font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
2079
- $font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
2080
- $margin = isset($element_data['margin']) ? $element_data['margin'] : '';
2081
- $color = isset($element_data['color']) ? $element_data['color'] : '';
2082
- $text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
2083
 
2084
- $excerpt_source = isset($element_data['excerpt_source']) ? $element_data['excerpt_source'] : '';
 
 
2085
 
2086
- $link_target = isset($element_data['link_target']) ? $element_data['link_target'] : '';
2087
- $char_limit = isset($element_data['char_limit']) ? $element_data['char_limit'] : 0;
2088
- $read_more_text = isset($element_data['read_more_text']) ? $element_data['read_more_text'] : '';
2089
 
2090
  $css = isset($element_data['css']) ? $element_data['css'] : '';
2091
  $css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
2092
 
2093
 
 
2094
  ?>
2095
  <div class="item">
2096
  <div class="element-title header ">
2097
  <span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
2098
  <span class="sort"><i class="fas fa-sort"></i></span>
2099
 
2100
- <span class="expand"><?php echo __('Post excerpt','post-grid'); ?></span>
2101
  </div>
2102
  <div class="element-options options">
2103
 
2104
  <?php
2105
 
2106
- $args = array(
2107
- 'id' => 'excerpt_source',
2108
- 'css_id' => $element_index.'_excerpt_source',
2109
- 'parent' => $input_name.'[excerpt]',
2110
- 'title' => __('Excerpt source','post-grid'),
2111
- 'details' => __('Choose excerpt source.','post-grid'),
2112
- 'type' => 'select',
2113
- 'value' => $excerpt_source,
2114
- 'default' => 'post_link',
2115
- 'args' => array(
2116
- 'excerpt_field'=> __('Excerpt field', 'post-grid'),
2117
- 'content'=> __('Content', 'post-grid'),
2118
- 'excerpt_content'=> __('Excerpt first then Content', 'post-grid'),
2119
-
2120
 
2121
- ),
2122
- );
 
 
2123
 
2124
- $settings_tabs_field->generate_field($args);
 
 
2125
 
2126
  $args = array(
2127
- 'id' => 'char_limit',
2128
- 'css_id' => $element_index.'_char_limit',
2129
- 'parent' => $input_name.'[excerpt]',
2130
- 'title' => __('Word limit','post-grid'),
2131
- 'details' => __('Set word limit.','post-grid'),
2132
- 'type' => 'text',
2133
- 'value' => $char_limit,
2134
- 'default' => '',
2135
- 'placeholder' => '20',
2136
  );
2137
 
2138
  $settings_tabs_field->generate_field($args);
2139
 
 
 
2140
  $args = array(
2141
- 'id' => 'read_more_text',
2142
- 'css_id' => $element_index.'_read_more_text',
2143
- 'parent' => $input_name.'[excerpt]',
2144
- 'title' => __('Read more text','post-grid'),
2145
- 'details' => __('Custom read more text.','post-grid'),
2146
- 'type' => 'text',
2147
- 'value' => $read_more_text,
2148
- 'default' => '',
2149
- 'placeholder' => 'Read more',
 
 
 
 
2150
  );
2151
 
2152
  $settings_tabs_field->generate_field($args);
 
 
2153
  $args = array(
2154
  'id' => 'link_target',
2155
  'css_id' => $element_index.'_link_target',
2156
- 'parent' => $input_name.'[excerpt]',
2157
  'title' => __('Link target','post-grid'),
2158
  'details' => __('Choose option link target.','post-grid'),
2159
  'type' => 'select',
@@ -2172,71 +3275,79 @@ function post_grid_layout_element_option_excerpt($parameters){
2172
 
2173
 
2174
 
2175
-
2176
-
2177
-
2178
  $args = array(
2179
- 'id' => 'margin',
2180
- 'css_id' => $element_index.'_margin',
2181
- 'parent' => $input_name.'[excerpt]',
2182
- 'title' => __('Margin','post-grid'),
2183
- 'details' => __('Set margin.','post-grid'),
2184
- 'type' => 'text',
2185
- 'value' => $margin,
2186
- 'default' => '10px 0',
2187
- 'placeholder' => '5px 0',
2188
- );
2189
-
2190
- $settings_tabs_field->generate_field($args);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2191
 
2192
- $args = array(
2193
- 'id' => 'color',
2194
- 'css_id' => $element_index.'_color',
2195
- 'parent' => $input_name.'[excerpt]',
2196
- 'title' => __('Text Color','post-grid'),
2197
- 'details' => __('Choose text color.','post-grid'),
2198
- 'type' => 'colorpicker',
2199
- 'value' => $color,
2200
- 'default' => '',
2201
  );
2202
 
2203
  $settings_tabs_field->generate_field($args);
2204
 
2205
-
2206
  $args = array(
2207
- 'id' => 'text_align',
2208
- 'css_id' => $element_index.'_text_align',
2209
- 'parent' => $input_name.'[excerpt]',
2210
- 'title' => __('Text align','post-grid'),
2211
- 'details' => __('Choose text align.','post-grid'),
2212
- 'type' => 'select',
2213
- 'value' => $text_align,
2214
- 'default' => 'left',
2215
- 'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
2216
  );
2217
 
2218
  $settings_tabs_field->generate_field($args);
2219
 
2220
 
2221
  $args = array(
2222
- 'id' => 'font_size',
2223
- 'css_id' => $element_index.'_font_size',
2224
- 'parent' => $input_name.'[excerpt]',
2225
- 'title' => __('Font size','post-grid'),
2226
- 'details' => __('Set font size.','post-grid'),
2227
  'type' => 'text',
2228
- 'value' => $font_size,
2229
- 'default' => '15px',
2230
- 'placeholder' => '14px',
2231
  );
2232
 
2233
  $settings_tabs_field->generate_field($args);
2234
 
2235
-
2236
  $args = array(
2237
  'id' => 'css',
2238
  'css_id' => $element_index.'_css',
2239
- 'parent' => $input_name.'[excerpt]',
2240
  'title' => __('Custom CSS','post-grid'),
2241
  'details' => __('Set csutom CSS.','post-grid'),
2242
  'type' => 'textarea',
@@ -2250,7 +3361,7 @@ function post_grid_layout_element_option_excerpt($parameters){
2250
  $args = array(
2251
  'id' => 'css_hover',
2252
  'css_id' => $element_index.'_css_hover',
2253
- 'parent' => $input_name.'[excerpt]',
2254
  'title' => __('Hover CSS','post-grid'),
2255
  'details' => __('Set hover custom CSS.','post-grid'),
2256
  'type' => 'textarea',
@@ -2261,6 +3372,7 @@ function post_grid_layout_element_option_excerpt($parameters){
2261
 
2262
  $settings_tabs_field->generate_field($args);
2263
 
 
2264
  ob_start();
2265
  ?>
2266
  <textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}
@@ -2280,6 +3392,7 @@ function post_grid_layout_element_option_excerpt($parameters){
2280
 
2281
  $settings_tabs_field->generate_field($args);
2282
 
 
2283
  ?>
2284
 
2285
  </div>
@@ -2289,13 +3402,117 @@ function post_grid_layout_element_option_excerpt($parameters){
2289
  }
2290
 
2291
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2292
 
2293
 
2294
 
2295
- add_action('post_grid_layout_element_option_wrapper_start','post_grid_layout_element_option_wrapper_start');
2296
 
2297
 
2298
- function post_grid_layout_element_option_wrapper_start($parameters){
 
 
 
 
 
 
2299
 
2300
  $settings_tabs_field = new settings_tabs_field();
2301
 
@@ -2303,61 +3520,128 @@ function post_grid_layout_element_option_wrapper_start($parameters){
2303
  $element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
2304
  $element_index = isset($parameters['index']) ? $parameters['index'] : '';
2305
 
2306
- $wrapper_id = isset($element_data['wrapper_id']) ? $element_data['wrapper_id'] : '';
2307
- $wrapper_class = isset($element_data['wrapper_class']) ? $element_data['wrapper_class'] : '';
 
 
 
 
2308
  $margin = isset($element_data['margin']) ? $element_data['margin'] : '';
 
2309
 
 
 
2310
 
2311
  $css = isset($element_data['css']) ? $element_data['css'] : '';
2312
  $css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
2313
 
2314
-
2315
  ?>
2316
- <div class="item wrapper_start">
2317
  <div class="element-title header ">
2318
  <span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
2319
  <span class="sort"><i class="fas fa-sort"></i></span>
2320
 
2321
- <span class="expand"><?php echo __('Wrapper start','post-grid'); ?></span>
2322
-
2323
- <span class="handle-start"><i class="fas fa-level-up-alt"></i></span>
2324
-
2325
  </div>
2326
  <div class="element-options options">
2327
 
2328
- <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2329
 
2330
  $args = array(
2331
- 'id' => 'wrapper_id',
2332
- 'parent' => $input_name.'[wrapper_start]',
2333
- 'title' => __('Wrapper id','post-grid'),
2334
- 'details' => __('Write wrapper id, ex: my-unique-id.','post-grid'),
 
2335
  'type' => 'text',
2336
- 'value' => $wrapper_id,
2337
  'default' => '',
 
2338
  );
2339
 
2340
  $settings_tabs_field->generate_field($args);
2341
 
2342
 
2343
  $args = array(
2344
- 'id' => 'wrapper_class',
2345
- 'parent' => $input_name.'[wrapper_start]',
2346
- 'title' => __('Wrapper class','post-grid'),
2347
- 'details' => __('Write wrapper class, ex: layer-thumbnail','post-grid'),
 
2348
  'type' => 'text',
2349
- 'value' => $wrapper_class,
2350
  'default' => '',
 
2351
  );
2352
 
2353
  $settings_tabs_field->generate_field($args);
2354
 
2355
 
2356
-
2357
  $args = array(
2358
  'id' => 'margin',
2359
  'css_id' => $element_index.'_margin',
2360
- 'parent' => $input_name.'[wrapper_start]',
2361
  'title' => __('Margin','post-grid'),
2362
  'details' => __('Set margin.','post-grid'),
2363
  'type' => 'text',
@@ -2368,10 +3652,25 @@ function post_grid_layout_element_option_wrapper_start($parameters){
2368
 
2369
  $settings_tabs_field->generate_field($args);
2370
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2371
  $args = array(
2372
  'id' => 'css',
2373
  'css_id' => $element_index.'_css',
2374
- 'parent' => $input_name.'[wrapper_start]',
2375
  'title' => __('Custom CSS','post-grid'),
2376
  'details' => __('Set csutom CSS.','post-grid'),
2377
  'type' => 'textarea',
@@ -2385,7 +3684,7 @@ function post_grid_layout_element_option_wrapper_start($parameters){
2385
  $args = array(
2386
  'id' => 'css_hover',
2387
  'css_id' => $element_index.'_css_hover',
2388
- 'parent' => $input_name.'[wrapper_start]',
2389
  'title' => __('Hover CSS','post-grid'),
2390
  'details' => __('Set hover custom CSS.','post-grid'),
2391
  'type' => 'textarea',
@@ -2398,7 +3697,8 @@ function post_grid_layout_element_option_wrapper_start($parameters){
2398
 
2399
  ob_start();
2400
  ?>
2401
- <textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}</textarea>
 
2402
  <?php
2403
 
2404
  $html = ob_get_clean();
@@ -2419,69 +3719,115 @@ function post_grid_layout_element_option_wrapper_start($parameters){
2419
  </div>
2420
  </div>
2421
  <?php
2422
-
2423
  }
2424
 
2425
 
2426
 
 
2427
 
2428
- add_action('post_grid_layout_element_option_wrapper_end','post_grid_layout_element_option_wrapper_end');
2429
-
2430
 
2431
- function post_grid_layout_element_option_wrapper_end($parameters){
 
 
2432
 
2433
- $settings_tabs_field = new settings_tabs_field();
2434
 
2435
- $input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
2436
- $element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
 
 
 
2437
 
2438
- $wrapper_id = isset($element_data['wrapper_id']) ? $element_data['wrapper_id'] : '';
2439
 
2440
- ?>
2441
- <div class="item wrapper_end">
2442
- <div class="element-title header ">
2443
- <span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
2444
- <span class="sort"><i class="fas fa-sort"></i></span>
2445
 
2446
- <span class="expand"><?php echo __('Wrapper end','post-grid'); ?></span>
2447
- <span class="handle-end"><i class="fas fa-level-down-alt"></i></span>
2448
- </div>
2449
- <div class="element-options options">
2450
 
 
 
 
 
 
 
2451
  <?php
 
 
 
 
 
 
2452
 
2453
- $args = array(
2454
- 'id' => 'wrapper_id',
2455
- 'wraper_class' => 'hidden',
2456
-
2457
- 'parent' => $input_name.'[wrapper_end]',
2458
- 'title' => __('Wrapper id','post-grid'),
2459
- 'details' => __('Write wrapper id, ex: div, p, span.','post-grid'),
2460
- 'type' => 'hidden',
2461
- 'value' => $wrapper_id,
2462
- 'default' => '',
2463
- );
2464
-
2465
- $settings_tabs_field->generate_field($args);
2466
-
2467
 
2468
 
 
 
2469
 
2470
 
2471
- ?>
 
 
2472
 
2473
- </div>
2474
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2475
  <?php
2476
-
2477
  }
2478
 
2479
 
2480
 
2481
 
2482
 
2483
- add_action('post_grid_layout_element_option_categories','post_grid_layout_element_option_categories');
2484
- function post_grid_layout_element_option_categories($parameters){
 
2485
 
2486
  $settings_tabs_field = new settings_tabs_field();
2487
 
@@ -2489,57 +3835,44 @@ function post_grid_layout_element_option_categories($parameters){
2489
  $element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
2490
  $element_index = isset($parameters['index']) ? $parameters['index'] : '';
2491
 
2492
- $max_count = isset($element_data['max_count']) ? $element_data['max_count'] : '';
2493
- $font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
2494
- $font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
2495
  $wrapper_html = isset($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '';
2496
- $wrapper_margin = isset($element_data['wrapper_margin']) ? $element_data['wrapper_margin'] : '';
2497
- $link_color = isset($element_data['link_color']) ? $element_data['link_color'] : '';
2498
- $text_color = isset($element_data['text_color']) ? $element_data['text_color'] : '';
2499
 
2500
- $separator = isset($element_data['separator']) ? $element_data['separator'] : '';
 
 
2501
  $text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
2502
 
2503
  $css = isset($element_data['css']) ? $element_data['css'] : '';
2504
  $css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
2505
 
2506
-
2507
  ?>
2508
  <div class="item">
2509
  <div class="element-title header ">
2510
  <span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
2511
  <span class="sort"><i class="fas fa-sort"></i></span>
2512
 
2513
- <span class="expand"><?php echo __('Post categories','post-grid'); ?></span>
2514
  </div>
2515
  <div class="element-options options">
2516
 
2517
  <?php
2518
 
2519
- $args = array(
2520
- 'id' => 'max_count',
2521
- 'parent' => $input_name.'[categories]',
2522
- 'title' => __('Max count','post-grid'),
2523
- 'details' => __('Write max count','post-grid'),
2524
- 'type' => 'text',
2525
- 'value' => $max_count,
2526
- 'default' => 3,
2527
- 'placeholder' => '3',
2528
- );
2529
-
2530
- $settings_tabs_field->generate_field($args);
2531
 
2532
  $args = array(
2533
- 'id' => 'separator',
2534
- 'css_id' => $element_index.'_position_color',
2535
- 'parent' => $input_name.'[categories]',
2536
- 'title' => __('Link separator','post-grid'),
2537
- 'details' => __('Choose link separator.','post-grid'),
2538
- 'type' => 'text',
2539
- 'value' => $separator,
2540
- 'default' => '',
2541
- 'placeholder' => ', ',
2542
-
 
 
 
2543
  );
2544
 
2545
  $settings_tabs_field->generate_field($args);
@@ -2547,79 +3880,66 @@ function post_grid_layout_element_option_categories($parameters){
2547
  $args = array(
2548
  'id' => 'wrapper_html',
2549
  'css_id' => $element_index.'_wrapper_html',
2550
- 'parent' => $input_name.'[categories]',
2551
  'title' => __('Wrapper html','post-grid'),
2552
- 'details' => __('Write wrapper html, use <code>%s</code> to replace category output.','post-grid'),
2553
  'type' => 'text',
2554
  'value' => $wrapper_html,
2555
  'default' => '',
2556
- 'placeholder' => 'Categories: %s',
2557
  );
2558
 
2559
  $settings_tabs_field->generate_field($args);
2560
 
 
 
2561
  $args = array(
2562
- 'id' => 'wrapper_margin',
2563
- 'css_id' => $element_index.'_margin',
2564
- 'parent' => $input_name.'[categories]',
2565
- 'title' => __('Margin','post-grid'),
2566
- 'details' => __('Set margin.','post-grid'),
2567
- 'type' => 'text',
2568
- 'value' => $wrapper_margin,
2569
  'default' => '',
2570
- 'placeholder' => '5px 0',
2571
  );
2572
 
2573
  $settings_tabs_field->generate_field($args);
2574
 
2575
 
 
2576
  $args = array(
2577
  'id' => 'font_size',
2578
  'css_id' => $element_index.'_font_size',
2579
- 'parent' => $input_name.'[categories]',
2580
  'title' => __('Font size','post-grid'),
2581
- 'details' => __('Choose font size.','post-grid'),
2582
  'type' => 'text',
2583
  'value' => $font_size,
2584
  'default' => '',
2585
  'placeholder' => '16px',
2586
-
2587
- );
2588
-
2589
- $settings_tabs_field->generate_field($args);
2590
-
2591
-
2592
- $args = array(
2593
- 'id' => 'link_color',
2594
- 'css_id' => $element_index.'_link_color',
2595
- 'parent' => $input_name.'[categories]',
2596
- 'title' => __('Link color','post-grid'),
2597
- 'details' => __('Choose link color.','post-grid'),
2598
- 'type' => 'colorpicker',
2599
- 'value' => $link_color,
2600
- 'default' => '',
2601
  );
2602
 
2603
  $settings_tabs_field->generate_field($args);
2604
 
2605
  $args = array(
2606
- 'id' => 'text_color',
2607
- 'css_id' => $element_index.'_text_color',
2608
- 'parent' => $input_name.'[categories]',
2609
- 'title' => __('Text color','post-grid'),
2610
- 'details' => __('Choose text color.','post-grid'),
2611
- 'type' => 'colorpicker',
2612
- 'value' => $text_color,
2613
  'default' => '',
 
2614
  );
2615
 
2616
  $settings_tabs_field->generate_field($args);
2617
 
2618
-
2619
  $args = array(
2620
  'id' => 'text_align',
2621
  'css_id' => $element_index.'_text_align',
2622
- 'parent' => $input_name.'[categories]',
2623
  'title' => __('Text align','post-grid'),
2624
  'details' => __('Choose text align.','post-grid'),
2625
  'type' => 'select',
@@ -2633,7 +3953,7 @@ function post_grid_layout_element_option_categories($parameters){
2633
  $args = array(
2634
  'id' => 'css',
2635
  'css_id' => $element_index.'_css',
2636
- 'parent' => $input_name.'[categories]',
2637
  'title' => __('Custom CSS','post-grid'),
2638
  'details' => __('Set csutom CSS.','post-grid'),
2639
  'type' => 'textarea',
@@ -2647,7 +3967,7 @@ function post_grid_layout_element_option_categories($parameters){
2647
  $args = array(
2648
  'id' => 'css_hover',
2649
  'css_id' => $element_index.'_css_hover',
2650
- 'parent' => $input_name.'[categories]',
2651
  'title' => __('Hover CSS','post-grid'),
2652
  'details' => __('Set hover custom CSS.','post-grid'),
2653
  'type' => 'textarea',
@@ -2682,12 +4002,125 @@ function post_grid_layout_element_option_categories($parameters){
2682
  </div>
2683
  </div>
2684
  <?php
2685
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2686
  }
2687
 
2688
 
2689
- add_action('post_grid_layout_element_option_tags','post_grid_layout_element_option_tags');
2690
- function post_grid_layout_element_option_tags($parameters){
 
 
2691
 
2692
  $settings_tabs_field = new settings_tabs_field();
2693
 
@@ -2695,107 +4128,111 @@ function post_grid_layout_element_option_tags($parameters){
2695
  $element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
2696
  $element_index = isset($parameters['index']) ? $parameters['index'] : '';
2697
 
2698
- $max_count = isset($element_data['max_count']) ? $element_data['max_count'] : '';
2699
- $font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
2700
- $font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
2701
  $wrapper_html = isset($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '';
2702
- $wrapper_margin = isset($element_data['wrapper_margin']) ? $element_data['wrapper_margin'] : '';
2703
- $link_color = isset($element_data['link_color']) ? $element_data['link_color'] : '';
 
 
 
 
2704
  $text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
2705
- $separator = isset($element_data['separator']) ? $element_data['separator'] : '';
2706
 
2707
  $css = isset($element_data['css']) ? $element_data['css'] : '';
2708
  $css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
2709
 
2710
-
2711
  ?>
2712
  <div class="item">
2713
  <div class="element-title header ">
2714
  <span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
2715
  <span class="sort"><i class="fas fa-sort"></i></span>
2716
 
2717
- <span class="expand"><?php echo __('Post tag','post-grid'); ?></span>
2718
  </div>
2719
  <div class="element-options options">
2720
 
2721
  <?php
2722
 
2723
-
2724
  $args = array(
2725
- 'id' => 'max_count',
2726
- 'parent' => $input_name.'[tags]',
2727
- 'title' => __('Max count','post-grid'),
2728
- 'details' => __('Write max count','post-grid'),
2729
- 'type' => 'text',
2730
- 'value' => $max_count,
2731
- 'default' => 3,
2732
- 'placeholder' => '3',
 
 
 
 
 
2733
  );
2734
 
2735
  $settings_tabs_field->generate_field($args);
2736
 
 
2737
  $args = array(
2738
- 'id' => 'separator',
2739
- 'css_id' => $element_index.'_position_color',
2740
- 'parent' => $input_name.'[tags]',
2741
- 'title' => __('Link separator','post-grid'),
2742
- 'details' => __('Choose link separator.','post-grid'),
2743
  'type' => 'text',
2744
- 'value' => $separator,
2745
  'default' => '',
2746
- 'placeholder' => ', ',
2747
-
2748
  );
2749
 
2750
  $settings_tabs_field->generate_field($args);
2751
 
2752
 
2753
  $args = array(
2754
- 'id' => 'wrapper_html',
2755
- 'css_id' => $element_index.'_wrapper_html',
2756
- 'parent' => $input_name.'[tags]',
2757
- 'title' => __('Wrapper html','post-grid'),
2758
- 'details' => __('Write wrapper html, use <code>%s</code> to replace tags output.','post-grid'),
2759
- 'type' => 'text',
2760
- 'value' => $wrapper_html,
2761
  'default' => '',
2762
- 'placeholder' => 'Tags: %s',
2763
  );
2764
 
2765
  $settings_tabs_field->generate_field($args);
2766
 
 
 
2767
  $args = array(
2768
- 'id' => 'wrapper_margin',
2769
- 'css_id' => $element_index.'_margin',
2770
- 'parent' => $input_name.'[tags]',
2771
- 'title' => __('Margin','post-grid'),
2772
- 'details' => __('Set margin.','post-grid'),
2773
  'type' => 'text',
2774
- 'value' => $wrapper_margin,
2775
  'default' => '',
2776
- 'placeholder' => '5px 0',
2777
  );
2778
 
2779
  $settings_tabs_field->generate_field($args);
2780
 
2781
  $args = array(
2782
- 'id' => 'link_color',
2783
- 'css_id' => $element_index.'_link_color',
2784
- 'parent' => $input_name.'[tags]',
2785
- 'title' => __('Link color','post-grid'),
2786
- 'details' => __('Choose link color.','post-grid'),
2787
- 'type' => 'colorpicker',
2788
- 'value' => $link_color,
2789
  'default' => '',
 
2790
  );
2791
 
2792
  $settings_tabs_field->generate_field($args);
2793
 
2794
-
2795
  $args = array(
2796
  'id' => 'text_align',
2797
  'css_id' => $element_index.'_text_align',
2798
- 'parent' => $input_name.'[tags]',
2799
  'title' => __('Text align','post-grid'),
2800
  'details' => __('Choose text align.','post-grid'),
2801
  'type' => 'select',
@@ -2809,7 +4246,7 @@ function post_grid_layout_element_option_tags($parameters){
2809
  $args = array(
2810
  'id' => 'css',
2811
  'css_id' => $element_index.'_css',
2812
- 'parent' => $input_name.'[tags]',
2813
  'title' => __('Custom CSS','post-grid'),
2814
  'details' => __('Set csutom CSS.','post-grid'),
2815
  'type' => 'textarea',
@@ -2823,7 +4260,7 @@ function post_grid_layout_element_option_tags($parameters){
2823
  $args = array(
2824
  'id' => 'css_hover',
2825
  'css_id' => $element_index.'_css_hover',
2826
- 'parent' => $input_name.'[tags]',
2827
  'title' => __('Hover CSS','post-grid'),
2828
  'details' => __('Set hover custom CSS.','post-grid'),
2829
  'type' => 'textarea',
@@ -2852,7 +4289,6 @@ function post_grid_layout_element_option_tags($parameters){
2852
  );
2853
 
2854
  $settings_tabs_field->generate_field($args);
2855
-
2856
  ?>
2857
 
2858
  </div>
@@ -2861,8 +4297,116 @@ function post_grid_layout_element_option_tags($parameters){
2861
 
2862
  }
2863
 
2864
- add_action('post_grid_layout_element_option_comments_count','post_grid_layout_element_option_comments_count');
2865
- function post_grid_layout_element_option_comments_count($parameters){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2866
 
2867
  $settings_tabs_field = new settings_tabs_field();
2868
 
@@ -2870,98 +4414,128 @@ function post_grid_layout_element_option_comments_count($parameters){
2870
  $element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
2871
  $element_index = isset($parameters['index']) ? $parameters['index'] : '';
2872
 
2873
- $wrapper_html = isset($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '';
2874
  $font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
2875
  $font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
2876
- $margin = isset($element_data['margin']) ? $element_data['margin'] : '';
2877
- $color = isset($element_data['color']) ? $element_data['color'] : '';
 
 
 
 
2878
  $text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
2879
 
2880
  $css = isset($element_data['css']) ? $element_data['css'] : '';
2881
  $css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
2882
 
 
2883
  ?>
2884
  <div class="item">
2885
  <div class="element-title header ">
2886
  <span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
2887
  <span class="sort"><i class="fas fa-sort"></i></span>
2888
 
2889
- <span class="expand"><?php echo __('Comment count','post-grid'); ?></span>
2890
  </div>
2891
  <div class="element-options options">
2892
 
2893
  <?php
2894
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2895
  $args = array(
2896
  'id' => 'wrapper_html',
2897
  'css_id' => $element_index.'_wrapper_html',
2898
- 'parent' => $input_name.'[comments_count]',
2899
  'title' => __('Wrapper html','post-grid'),
2900
- 'details' => __('Write wrapper html, use <code>%s</code> to replace comment count output.','post-grid'),
2901
  'type' => 'text',
2902
  'value' => $wrapper_html,
2903
  'default' => '',
2904
- 'placeholder' => 'Total comments: %s',
2905
  );
2906
 
2907
  $settings_tabs_field->generate_field($args);
2908
 
2909
-
2910
-
2911
-
2912
  $args = array(
2913
- 'id' => 'color',
2914
- 'css_id' => $element_index.'_color',
2915
- 'parent' => $input_name.'[comments_count]',
2916
- 'title' => __('Color','post-grid'),
2917
- 'details' => __('Title text color.','post-grid'),
2918
- 'type' => 'colorpicker',
2919
- 'value' => $color,
2920
  'default' => '',
 
2921
  );
2922
 
2923
  $settings_tabs_field->generate_field($args);
2924
 
 
2925
  $args = array(
2926
  'id' => 'font_size',
2927
  'css_id' => $element_index.'_font_size',
2928
- 'parent' => $input_name.'[comments_count]',
2929
  'title' => __('Font size','post-grid'),
2930
- 'details' => __('Set font size.','post-grid'),
2931
  'type' => 'text',
2932
  'value' => $font_size,
2933
  'default' => '',
2934
- 'placeholder' => '14px',
 
2935
  );
2936
 
2937
  $settings_tabs_field->generate_field($args);
2938
 
2939
 
2940
  $args = array(
2941
- 'id' => 'font_family',
2942
- 'css_id' => $element_index.'_font_family',
2943
- 'parent' => $input_name.'[comments_count]',
2944
- 'title' => __('Font family','post-grid'),
2945
- 'details' => __('Set font family.','post-grid'),
2946
- 'type' => 'text',
2947
- 'value' => $font_family,
2948
  'default' => '',
2949
- 'placeholder' => 'Open Sans',
2950
  );
2951
 
2952
  $settings_tabs_field->generate_field($args);
2953
 
2954
-
2955
  $args = array(
2956
- 'id' => 'margin',
2957
- 'css_id' => $element_index.'_margin',
2958
- 'parent' => $input_name.'[comments_count]',
2959
- 'title' => __('Margin','post-grid'),
2960
- 'details' => __('Set margin.','post-grid'),
2961
- 'type' => 'text',
2962
- 'value' => $margin,
2963
  'default' => '',
2964
- 'placeholder' => '5px 0',
2965
  );
2966
 
2967
  $settings_tabs_field->generate_field($args);
@@ -2970,7 +4544,7 @@ function post_grid_layout_element_option_comments_count($parameters){
2970
  $args = array(
2971
  'id' => 'text_align',
2972
  'css_id' => $element_index.'_text_align',
2973
- 'parent' => $input_name.'[comments_count]',
2974
  'title' => __('Text align','post-grid'),
2975
  'details' => __('Choose text align.','post-grid'),
2976
  'type' => 'select',
@@ -2984,7 +4558,7 @@ function post_grid_layout_element_option_comments_count($parameters){
2984
  $args = array(
2985
  'id' => 'css',
2986
  'css_id' => $element_index.'_css',
2987
- 'parent' => $input_name.'[comments_count]',
2988
  'title' => __('Custom CSS','post-grid'),
2989
  'details' => __('Set csutom CSS.','post-grid'),
2990
  'type' => 'textarea',
@@ -2998,7 +4572,7 @@ function post_grid_layout_element_option_comments_count($parameters){
2998
  $args = array(
2999
  'id' => 'css_hover',
3000
  'css_id' => $element_index.'_css_hover',
3001
- 'parent' => $input_name.'[comments_count]',
3002
  'title' => __('Hover CSS','post-grid'),
3003
  'details' => __('Set hover custom CSS.','post-grid'),
3004
  'type' => 'textarea',
@@ -3011,7 +4585,8 @@ function post_grid_layout_element_option_comments_count($parameters){
3011
 
3012
  ob_start();
3013
  ?>
3014
- <textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}</textarea>
 
3015
  <?php
3016
 
3017
  $html = ob_get_clean();
@@ -3027,7 +4602,6 @@ function post_grid_layout_element_option_comments_count($parameters){
3027
 
3028
  $settings_tabs_field->generate_field($args);
3029
 
3030
-
3031
  ?>
3032
 
3033
  </div>
@@ -3037,9 +4611,118 @@ function post_grid_layout_element_option_comments_count($parameters){
3037
  }
3038
 
3039
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3040
 
3041
- add_action('post_grid_layout_element_option_five_star','post_grid_layout_element_option_five_star');
3042
- function post_grid_layout_element_option_five_star($parameters){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3043
 
3044
  $settings_tabs_field = new settings_tabs_field();
3045
 
@@ -3047,11 +4730,14 @@ function post_grid_layout_element_option_five_star($parameters){
3047
  $element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
3048
  $element_index = isset($parameters['index']) ? $parameters['index'] : '';
3049
 
3050
-
3051
  $font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
3052
- $color = isset($element_data['color']) ? $element_data['color'] : '';
3053
- $margin = isset($element_data['margin']) ? $element_data['margin'] : '';
 
 
3054
  $text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
 
3055
 
3056
  $css = isset($element_data['css']) ? $element_data['css'] : '';
3057
  $css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
@@ -3063,60 +4749,88 @@ function post_grid_layout_element_option_five_star($parameters){
3063
  <span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
3064
  <span class="sort"><i class="fas fa-sort"></i></span>
3065
 
3066
- <span class="expand"><?php echo __('Five star','post-grid'); ?></span>
3067
  </div>
3068
  <div class="element-options options">
3069
 
3070
  <?php
3071
 
3072
 
 
 
 
 
 
 
 
 
 
 
 
 
3073
 
3074
  $args = array(
3075
- 'id' => 'color',
3076
- 'css_id' => $element_index.'_color',
3077
- 'parent' => $input_name.'[five_star]',
3078
- 'title' => __('Text color','post-grid'),
3079
- 'details' => __('Choose text color.','post-grid'),
3080
- 'type' => 'colorpicker',
3081
- 'value' => $color,
3082
  'default' => '',
 
 
3083
  );
3084
 
3085
  $settings_tabs_field->generate_field($args);
3086
 
3087
 
3088
  $args = array(
3089
- 'id' => 'font_size',
3090
- 'css_id' => $element_index.'_font_size',
3091
- 'parent' => $input_name.'[five_star]',
3092
- 'title' => __('Font size','post-grid'),
3093
- 'details' => __('Choose text font size.','post-grid'),
3094
  'type' => 'text',
3095
- 'value' => $font_size,
3096
  'default' => '',
3097
- 'placeholder' => '16px',
3098
  );
3099
 
3100
  $settings_tabs_field->generate_field($args);
3101
 
3102
  $args = array(
3103
- 'id' => 'margin',
3104
  'css_id' => $element_index.'_margin',
3105
- 'parent' => $input_name.'[five_star]',
3106
  'title' => __('Margin','post-grid'),
3107
- 'details' => __('Choose margin.','post-grid'),
3108
  'type' => 'text',
3109
- 'value' => $margin,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3110
  'default' => '',
3111
- 'placeholder' => '5px 10px',
3112
  );
3113
 
3114
  $settings_tabs_field->generate_field($args);
3115
 
 
3116
  $args = array(
3117
  'id' => 'text_align',
3118
  'css_id' => $element_index.'_text_align',
3119
- 'parent' => $input_name.'[five_star]',
3120
  'title' => __('Text align','post-grid'),
3121
  'details' => __('Choose text align.','post-grid'),
3122
  'type' => 'select',
@@ -3130,7 +4844,7 @@ function post_grid_layout_element_option_five_star($parameters){
3130
  $args = array(
3131
  'id' => 'css',
3132
  'css_id' => $element_index.'_css',
3133
- 'parent' => $input_name.'[five_star]',
3134
  'title' => __('Custom CSS','post-grid'),
3135
  'details' => __('Set csutom CSS.','post-grid'),
3136
  'type' => 'textarea',
@@ -3144,7 +4858,7 @@ function post_grid_layout_element_option_five_star($parameters){
3144
  $args = array(
3145
  'id' => 'css_hover',
3146
  'css_id' => $element_index.'_css_hover',
3147
- 'parent' => $input_name.'[five_star]',
3148
  'title' => __('Hover CSS','post-grid'),
3149
  'details' => __('Set hover custom CSS.','post-grid'),
3150
  'type' => 'textarea',
@@ -3155,10 +4869,10 @@ function post_grid_layout_element_option_five_star($parameters){
3155
 
3156
  $settings_tabs_field->generate_field($args);
3157
 
3158
-
3159
  ob_start();
3160
  ?>
3161
- <textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}</textarea>
 
3162
  <?php
3163
 
3164
  $html = ob_get_clean();
@@ -3181,9 +4895,116 @@ function post_grid_layout_element_option_five_star($parameters){
3181
  <?php
3182
 
3183
  }
 
3184
 
3185
- add_action('post_grid_layout_element_option_hr','post_grid_layout_element_option_hr');
3186
- function post_grid_layout_element_option_hr($parameters){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3187
 
3188
  $settings_tabs_field = new settings_tabs_field();
3189
 
@@ -3191,9 +5012,12 @@ function post_grid_layout_element_option_hr($parameters){
3191
  $element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
3192
  $element_index = isset($parameters['index']) ? $parameters['index'] : '';
3193
 
3194
- $background_color = isset($element_data['background_color']) ? $element_data['background_color'] : '';
 
 
3195
  $margin = isset($element_data['margin']) ? $element_data['margin'] : '';
3196
- $height = isset($element_data['height']) ? $element_data['height'] : '';
 
3197
 
3198
  $css = isset($element_data['css']) ? $element_data['css'] : '';
3199
  $css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
@@ -3204,53 +5028,97 @@ function post_grid_layout_element_option_hr($parameters){
3204
  <span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
3205
  <span class="sort"><i class="fas fa-sort"></i></span>
3206
 
3207
- <span class="expand"><?php echo __('Horizontal line','post-grid'); ?></span>
3208
  </div>
3209
  <div class="element-options options">
3210
 
3211
  <?php
3212
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3213
 
3214
 
3215
 
3216
  $args = array(
3217
- 'id' => 'background_color',
3218
- 'css_id' => $element_index.'_background_coloradd_to_cart',
3219
- 'parent' => $input_name.'[hr]',
3220
- 'title' => __('Background color','post-grid'),
3221
- 'details' => __('Choose background color.','post-grid'),
3222
  'type' => 'colorpicker',
3223
- 'value' => $background_color,
3224
  'default' => '',
3225
  );
3226
 
3227
  $settings_tabs_field->generate_field($args);
3228
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3229
 
3230
  $args = array(
3231
- 'id' => 'height',
3232
- 'css_id' => $element_index.'_height',
3233
- 'parent' => $input_name.'[hr]',
3234
- 'title' => __('Height','post-grid'),
3235
- 'details' => __('Choose height.','post-grid'),
3236
  'type' => 'text',
3237
- 'value' => $height,
3238
  'default' => '',
3239
- 'placeholder' => '5px',
3240
  );
3241
 
3242
  $settings_tabs_field->generate_field($args);
3243
 
 
3244
  $args = array(
3245
  'id' => 'margin',
3246
- 'css_id' => $element_index.'_padding',
3247
- 'parent' => $input_name.'[hr]',
3248
  'title' => __('Margin','post-grid'),
3249
- 'details' => __('Choose margin.','post-grid'),
3250
  'type' => 'text',
3251
  'value' => $margin,
3252
  'default' => '',
3253
- 'placeholder' => '5px 10px',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3254
  );
3255
 
3256
  $settings_tabs_field->generate_field($args);
@@ -3258,7 +5126,7 @@ function post_grid_layout_element_option_hr($parameters){
3258
  $args = array(
3259
  'id' => 'css',
3260
  'css_id' => $element_index.'_css',
3261
- 'parent' => $input_name.'[hr]',
3262
  'title' => __('Custom CSS','post-grid'),
3263
  'details' => __('Set csutom CSS.','post-grid'),
3264
  'type' => 'textarea',
@@ -3272,7 +5140,7 @@ function post_grid_layout_element_option_hr($parameters){
3272
  $args = array(
3273
  'id' => 'css_hover',
3274
  'css_id' => $element_index.'_css_hover',
3275
- 'parent' => $input_name.'[hr]',
3276
  'title' => __('Hover CSS','post-grid'),
3277
  'details' => __('Set hover custom CSS.','post-grid'),
3278
  'type' => 'textarea',
@@ -3310,6 +5178,105 @@ function post_grid_layout_element_option_hr($parameters){
3310
 
3311
  }
3312
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3313
  add_action('post_grid_layout_element_option_share_button','post_grid_layout_element_option_share_button');
3314
  function post_grid_layout_element_option_share_button($parameters){
3315
 
@@ -3441,189 +5408,111 @@ function post_grid_layout_element_option_share_button($parameters){
3441
  }
3442
 
3443
 
3444
- add_action('post_grid_layout_element_option_author','post_grid_layout_element_option_author');
3445
- function post_grid_layout_element_option_author($parameters){
3446
-
3447
- $settings_tabs_field = new settings_tabs_field();
3448
-
3449
- $input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
3450
- $element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
3451
- $element_index = isset($parameters['index']) ? $parameters['index'] : '';
3452
-
3453
- $wrapper_html = isset($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '';
3454
- $link_to = isset($element_data['link_to']) ? $element_data['link_to'] : '';
3455
-
3456
- $font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
3457
- $color = isset($element_data['color']) ? $element_data['color'] : '';
3458
- $margin = isset($element_data['margin']) ? $element_data['margin'] : '';
3459
- $text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
3460
-
3461
- $css = isset($element_data['css']) ? $element_data['css'] : '';
3462
- $css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
3463
-
3464
- ?>
3465
- <div class="item">
3466
- <div class="element-title header ">
3467
- <span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
3468
- <span class="sort"><i class="fas fa-sort"></i></span>
3469
-
3470
- <span class="expand"><?php echo __('Author name','post-grid'); ?></span>
3471
- </div>
3472
- <div class="element-options options">
3473
-
3474
- <?php
3475
-
3476
-
3477
- $args = array(
3478
- 'id' => 'link_to',
3479
- 'css_id' => $element_index.'_link_to',
3480
- 'parent' => $input_name.'[author]',
3481
- 'title' => __('Link to','post-grid'),
3482
- 'details' => __('Choose option to link title.','post-grid'),
3483
- 'type' => 'select',
3484
- 'value' => $link_to,
3485
- 'default' => 'none',
3486
- 'args' => array(
3487
- 'post_link'=> __('Post link', 'post-grid'),
3488
- 'author_posts_link'=> __('Author posts link', 'post-grid'),
3489
- 'none'=> __('None', 'post-grid'),
3490
- ),
3491
- );
3492
-
3493
- $settings_tabs_field->generate_field($args);
3494
-
3495
- $args = array(
3496
- 'id' => 'wrapper_html',
3497
- 'css_id' => $element_index.'_wrapper_html',
3498
- 'parent' => $input_name.'[author]',
3499
- 'title' => __('Wrapper html','post-grid'),
3500
- 'details' => __('Write wrapper html.','post-grid'),
3501
- 'type' => 'text',
3502
- 'value' => $wrapper_html,
3503
- 'default' => '',
3504
- 'placeholder' => 'Author: %s',
3505
- );
3506
-
3507
- $settings_tabs_field->generate_field($args);
3508
-
3509
-
3510
-
3511
- $args = array(
3512
- 'id' => 'color',
3513
- 'css_id' => $element_index.'_color',
3514
- 'parent' => $input_name.'[author]',
3515
- 'title' => __('Text color','post-grid'),
3516
- 'details' => __('Choose text color.','post-grid'),
3517
- 'type' => 'colorpicker',
3518
- 'value' => $color,
3519
- 'default' => '',
3520
- );
3521
 
3522
- $settings_tabs_field->generate_field($args);
3523
 
 
3524
 
 
3525
 
3526
- $args = array(
3527
- 'id' => 'font_size',
3528
- 'css_id' => $element_index.'_font_size',
3529
- 'parent' => $input_name.'[author]',
3530
- 'title' => __('Font size','post-grid'),
3531
- 'details' => __('Choose text font size.','post-grid'),
3532
- 'type' => 'text',
3533
- 'value' => $font_size,
3534
- 'default' => '',
3535
- 'placeholder' => '16px',
3536
- );
3537
 
3538
- $settings_tabs_field->generate_field($args);
3539
 
3540
- $args = array(
3541
- 'id' => 'margin',
3542
- 'css_id' => $element_index.'_padding',
3543
- 'parent' => $input_name.'[author]',
3544
- 'title' => __('Margin','post-grid'),
3545
- 'details' => __('Choose padding.','post-grid'),
3546
- 'type' => 'text',
3547
- 'value' => $margin,
3548
- 'default' => '',
3549
- 'placeholder' => '5px 10px',
3550
- );
3551
 
3552
- $settings_tabs_field->generate_field($args);
3553
 
3554
- $args = array(
3555
- 'id' => 'text_align',
3556
- 'css_id' => $element_index.'_text_align',
3557
- 'parent' => $input_name.'[author]',
3558
- 'title' => __('Text align','post-grid'),
3559
- 'details' => __('Choose text align.','post-grid'),
3560
- 'type' => 'select',
3561
- 'value' => $text_align,
3562
- 'default' => 'left',
3563
- 'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
3564
- );
3565
 
3566
- $settings_tabs_field->generate_field($args);
3567
 
3568
- $args = array(
3569
- 'id' => 'css',
3570
- 'css_id' => $element_index.'_css',
3571
- 'parent' => $input_name.'[author]',
3572
- 'title' => __('Custom CSS','post-grid'),
3573
- 'details' => __('Set csutom CSS.','post-grid'),
3574
- 'type' => 'textarea',
3575
- 'value' => $css,
3576
- 'default' => '',
3577
- 'placeholder' => '',
3578
- );
3579
 
3580
- $settings_tabs_field->generate_field($args);
3581
 
3582
- $args = array(
3583
- 'id' => 'css_hover',
3584
- 'css_id' => $element_index.'_css_hover',
3585
- 'parent' => $input_name.'[author]',
3586
- 'title' => __('Hover CSS','post-grid'),
3587
- 'details' => __('Set hover custom CSS.','post-grid'),
3588
- 'type' => 'textarea',
3589
- 'value' => $css_hover,
3590
- 'default' => '',
3591
- 'placeholder' => '',
3592
- );
3593
 
3594
- $settings_tabs_field->generate_field($args);
3595
 
3596
- ob_start();
3597
- ?>
3598
- <textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}
3599
- .element_<?php echo $element_index?> a{}</textarea>
3600
- <?php
3601
 
3602
- $html = ob_get_clean();
3603
 
3604
- $args = array(
3605
- 'id' => 'use_css',
3606
- 'title' => __('Use of CSS','post-grid'),
3607
- 'details' => __('Use following class selector to add custom CSS for this element.','post-grid'),
3608
- 'type' => 'custom_html',
3609
- 'html' => $html,
3610
 
3611
- );
3612
 
3613
- $settings_tabs_field->generate_field($args);
3614
 
3615
- ?>
 
 
 
 
 
3616
 
3617
- </div>
3618
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3619
  <?php
3620
-
3621
  }
3622
 
3623
 
3624
 
3625
- add_action('post_grid_layout_element_option_author_link','post_grid_layout_element_option_author_link');
3626
- function post_grid_layout_element_option_author_link($parameters){
 
3627
 
3628
  $settings_tabs_field = new settings_tabs_field();
3629
 
@@ -3631,89 +5520,52 @@ function post_grid_layout_element_option_author_link($parameters){
3631
  $element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
3632
  $element_index = isset($parameters['index']) ? $parameters['index'] : '';
3633
 
3634
- $wrapper_html = isset($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '';
3635
- $link_to = isset($element_data['link_to']) ? $element_data['link_to'] : '';
3636
-
3637
- $font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
3638
- $background_color = isset($element_data['background_color']) ? $element_data['background_color'] : '';
3639
- $color = isset($element_data['color']) ? $element_data['color'] : '';
3640
- $margin = isset($element_data['margin']) ? $element_data['margin'] : '';
3641
- $text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
3642
-
3643
- $css = isset($element_data['css']) ? $element_data['css'] : '';
3644
- $css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
3645
-
3646
- ?>
3647
- <div class="item">
3648
- <div class="element-title header ">
3649
- <span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
3650
- <span class="sort"><i class="fas fa-sort"></i></span>
3651
-
3652
- <span class="expand"><?php echo __('Author name with link','post-grid'); ?></span>
3653
- </div>
3654
- <div class="element-options options">
3655
-
3656
- <?php
3657
-
3658
- $args = array(
3659
- 'id' => 'link_to',
3660
- 'css_id' => $element_index.'_link_to',
3661
- 'parent' => $input_name.'[author_link]',
3662
- 'title' => __('Link to','post-grid'),
3663
- 'details' => __('Choose option to link title.','post-grid'),
3664
- 'type' => 'select',
3665
- 'value' => $link_to,
3666
- 'default' => 'none',
3667
- 'args' => array(
3668
- 'post_link'=> __('Post link', 'post-grid'),
3669
- 'author_posts_link'=> __('Author posts link', 'post-grid'),
3670
- 'none'=> __('None', 'post-grid'),
3671
- ),
3672
- );
3673
-
3674
- $settings_tabs_field->generate_field($args);
3675
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3676
 
3677
- $args = array(
3678
- 'id' => 'wrapper_html',
3679
- 'css_id' => $element_index.'_wrapper_html',
3680
- 'parent' => $input_name.'[author_link]',
3681
- 'title' => __('Wrapper html','post-grid'),
3682
- 'details' => __('Write wrapper html, use <code>%s</code> to replace on-sale output.','post-grid'),
3683
- 'type' => 'text',
3684
- 'value' => $wrapper_html,
3685
- 'default' => '',
3686
- 'placeholder' => 'Author: %s',
3687
- );
3688
 
3689
- $settings_tabs_field->generate_field($args);
3690
 
3691
 
3692
  $args = array(
3693
- 'id' => 'color',
3694
- 'css_id' => $element_index.'_color',
3695
- 'parent' => $input_name.'[author_link]',
3696
- 'title' => __('Text color','post-grid'),
3697
- 'details' => __('Choose text color.','post-grid'),
3698
  'type' => 'colorpicker',
3699
- 'value' => $color,
3700
  'default' => '',
3701
  );
3702
 
3703
  $settings_tabs_field->generate_field($args);
3704
 
3705
 
3706
-
3707
  $args = array(
3708
- 'id' => 'font_size',
3709
- 'css_id' => $element_index.'_font_size',
3710
- 'parent' => $input_name.'[author_link]',
3711
- 'title' => __('Font size','post-grid'),
3712
- 'details' => __('Choose text font size.','post-grid'),
3713
  'type' => 'text',
3714
- 'value' => $font_size,
3715
  'default' => '',
3716
- 'placeholder' => '16px',
3717
  );
3718
 
3719
  $settings_tabs_field->generate_field($args);
@@ -3721,9 +5573,9 @@ function post_grid_layout_element_option_author_link($parameters){
3721
  $args = array(
3722
  'id' => 'margin',
3723
  'css_id' => $element_index.'_padding',
3724
- 'parent' => $input_name.'[author_link]',
3725
  'title' => __('Margin','post-grid'),
3726
- 'details' => __('Choose padding.','post-grid'),
3727
  'type' => 'text',
3728
  'value' => $margin,
3729
  'default' => '',
@@ -3732,24 +5584,10 @@ function post_grid_layout_element_option_author_link($parameters){
3732
 
3733
  $settings_tabs_field->generate_field($args);
3734
 
3735
- $args = array(
3736
- 'id' => 'text_align',
3737
- 'css_id' => $element_index.'_text_align',
3738
- 'parent' => $input_name.'[author_link]',
3739
- 'title' => __('Text align','post-grid'),
3740
- 'details' => __('Choose text align.','post-grid'),
3741
- 'type' => 'select',
3742
- 'value' => $text_align,
3743
- 'default' => 'left',
3744
- 'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
3745
- );
3746
-
3747
- $settings_tabs_field->generate_field($args);
3748
-
3749
  $args = array(
3750
  'id' => 'css',
3751
  'css_id' => $element_index.'_css',
3752
- 'parent' => $input_name.'[author_link]',
3753
  'title' => __('Custom CSS','post-grid'),
3754
  'details' => __('Set csutom CSS.','post-grid'),
3755
  'type' => 'textarea',
@@ -3763,7 +5601,7 @@ function post_grid_layout_element_option_author_link($parameters){
3763
  $args = array(
3764
  'id' => 'css_hover',
3765
  'css_id' => $element_index.'_css_hover',
3766
- 'parent' => $input_name.'[author_link]',
3767
  'title' => __('Hover CSS','post-grid'),
3768
  'details' => __('Set hover custom CSS.','post-grid'),
3769
  'type' => 'textarea',
@@ -3776,8 +5614,7 @@ function post_grid_layout_element_option_author_link($parameters){
3776
 
3777
  ob_start();
3778
  ?>
3779
- <textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}
3780
- .element_<?php echo $element_index?> a{}</textarea>
3781
  <?php
3782
 
3783
  $html = ob_get_clean();
@@ -3792,6 +5629,8 @@ function post_grid_layout_element_option_author_link($parameters){
3792
  );
3793
 
3794
  $settings_tabs_field->generate_field($args);
 
 
3795
  ?>
3796
 
3797
  </div>
@@ -3800,11 +5639,72 @@ function post_grid_layout_element_option_author_link($parameters){
3800
 
3801
  }
3802
 
 
3803
 
 
3804
 
 
 
 
3805
 
3806
- add_action('post_grid_layout_element_option_post_date','post_grid_layout_element_option_post_date');
3807
- function post_grid_layout_element_option_post_date($parameters){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3808
 
3809
  $settings_tabs_field = new settings_tabs_field();
3810
 
@@ -3812,87 +5712,36 @@ function post_grid_layout_element_option_post_date($parameters){
3812
  $element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
3813
  $element_index = isset($parameters['index']) ? $parameters['index'] : '';
3814
 
3815
- $date_format = isset($element_data['date_format']) ? $element_data['date_format'] : '';
3816
- $wrapper_html = isset($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '';
3817
-
3818
- $link_to = isset($element_data['link_to']) ? $element_data['link_to'] : '';
3819
 
 
3820
  $color = isset($element_data['color']) ? $element_data['color'] : '';
3821
  $margin = isset($element_data['margin']) ? $element_data['margin'] : '';
3822
  $text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
3823
 
3824
- $font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
3825
- $font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
3826
-
3827
  $css = isset($element_data['css']) ? $element_data['css'] : '';
3828
  $css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
3829
 
 
3830
  ?>
3831
  <div class="item">
3832
  <div class="element-title header ">
3833
  <span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
3834
  <span class="sort"><i class="fas fa-sort"></i></span>
3835
 
3836
- <span class="expand"><?php echo __('Post date','post-grid'); ?></span>
3837
  </div>
3838
  <div class="element-options options">
3839
 
3840
  <?php
3841
 
3842
- $args = array(
3843
- 'id' => 'date_format',
3844
- 'css_id' => $element_index.'_background_colorpost_date',
3845
- 'parent' => $input_name.'[post_date]',
3846
- 'title' => __('Date format','post-grid'),
3847
- 'details' => __('Choose date format.','post-grid'),
3848
- 'type' => 'text',
3849
- 'value' => $date_format,
3850
- 'default' => '',
3851
- 'placeholder' => 'd-m-Y',
3852
-
3853
- );
3854
-
3855
- $settings_tabs_field->generate_field($args);
3856
-
3857
-
3858
- $args = array(
3859
- 'id' => 'wrapper_html',
3860
- 'css_id' => $element_index.'_wrapper_html',
3861
- 'parent' => $input_name.'[post_date]',
3862
- 'title' => __('Wrapper html','post-grid'),
3863
- 'details' => __('Write wrapper html, use <code>%s</code> to replace date output.','post-grid'),
3864
- 'type' => 'text',
3865
- 'value' => $wrapper_html,
3866
- 'default' => '',
3867
- 'placeholder' => 'Date: %s',
3868
- );
3869
-
3870
- $settings_tabs_field->generate_field($args);
3871
-
3872
-
3873
- $args = array(
3874
- 'id' => 'link_to',
3875
- 'css_id' => $element_index.'_link_to',
3876
- 'parent' => $input_name.'[post_date]',
3877
- 'title' => __('Link to','post-grid'),
3878
- 'details' => __('Choose option to link title.','post-grid'),
3879
- 'type' => 'select',
3880
- 'value' => $link_to,
3881
- 'default' => 'none',
3882
- 'args' => array(
3883
- 'post_link'=> __('Post link', 'post-grid'),
3884
- 'none'=> __('None', 'post-grid'),
3885
- ),
3886
- );
3887
 
3888
- $settings_tabs_field->generate_field($args);
3889
 
3890
  $args = array(
3891
  'id' => 'color',
3892
- 'css_id' => $element_index.'_custom_text',
3893
- 'parent' => $input_name.'[post_date]',
3894
- 'title' => __('Color','post-grid'),
3895
- 'details' => __('Title text color.','post-grid'),
3896
  'type' => 'colorpicker',
3897
  'value' => $color,
3898
  'default' => '',
@@ -3900,55 +5749,39 @@ function post_grid_layout_element_option_post_date($parameters){
3900
 
3901
  $settings_tabs_field->generate_field($args);
3902
 
 
3903
  $args = array(
3904
  'id' => 'font_size',
3905
  'css_id' => $element_index.'_font_size',
3906
- 'parent' => $input_name.'[post_date]',
3907
  'title' => __('Font size','post-grid'),
3908
- 'details' => __('Set font size.','post-grid'),
3909
  'type' => 'text',
3910
  'value' => $font_size,
3911
  'default' => '',
3912
- 'placeholder' => '14px',
3913
- );
3914
-
3915
- $settings_tabs_field->generate_field($args);
3916
-
3917
-
3918
- $args = array(
3919
- 'id' => 'font_family',
3920
- 'css_id' => $element_index.'_font_family',
3921
- 'parent' => $input_name.'[post_date]',
3922
- 'title' => __('Font family','post-grid'),
3923
- 'details' => __('Set font family.','post-grid'),
3924
- 'type' => 'text',
3925
- 'value' => $font_family,
3926
- 'default' => '',
3927
- 'placeholder' => 'Open Sans',
3928
  );
3929
 
3930
  $settings_tabs_field->generate_field($args);
3931
 
3932
-
3933
  $args = array(
3934
  'id' => 'margin',
3935
  'css_id' => $element_index.'_margin',
3936
- 'parent' => $input_name.'[post_date]',
3937
  'title' => __('Margin','post-grid'),
3938
- 'details' => __('Set margin.','post-grid'),
3939
  'type' => 'text',
3940
  'value' => $margin,
3941
  'default' => '',
3942
- 'placeholder' => '5px 0',
3943
  );
3944
 
3945
  $settings_tabs_field->generate_field($args);
3946
 
3947
-
3948
  $args = array(
3949
  'id' => 'text_align',
3950
  'css_id' => $element_index.'_text_align',
3951
- 'parent' => $input_name.'[post_date]',
3952
  'title' => __('Text align','post-grid'),
3953
  'details' => __('Choose text align.','post-grid'),
3954
  'type' => 'select',
@@ -3962,7 +5795,7 @@ function post_grid_layout_element_option_post_date($parameters){
3962
  $args = array(
3963
  'id' => 'css',
3964
  'css_id' => $element_index.'_css',
3965
- 'parent' => $input_name.'[post_date]',
3966
  'title' => __('Custom CSS','post-grid'),
3967
  'details' => __('Set csutom CSS.','post-grid'),
3968
  'type' => 'textarea',
@@ -3976,7 +5809,7 @@ function post_grid_layout_element_option_post_date($parameters){
3976
  $args = array(
3977
  'id' => 'css_hover',
3978
  'css_id' => $element_index.'_css_hover',
3979
- 'parent' => $input_name.'[post_date]',
3980
  'title' => __('Hover CSS','post-grid'),
3981
  'details' => __('Set hover custom CSS.','post-grid'),
3982
  'type' => 'textarea',
@@ -3987,10 +5820,10 @@ function post_grid_layout_element_option_post_date($parameters){
3987
 
3988
  $settings_tabs_field->generate_field($args);
3989
 
 
3990
  ob_start();
3991
  ?>
3992
- <textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}
3993
- .element_<?php echo $element_index?> a{}</textarea>
3994
  <?php
3995
 
3996
  $html = ob_get_clean();
@@ -4011,4 +5844,109 @@ function post_grid_layout_element_option_post_date($parameters){
4011
  </div>
4012
  </div>
4013
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4014
  }
 
 
 
 
 
 
 
1
  <?php
2
  if ( ! defined('ABSPATH')) exit; // if direct access
3
 
4
+
5
+
6
+ add_action('post_grid_layout_element_option_wrapper_start','post_grid_layout_element_option_wrapper_start');
7
+
8
+
9
+ function post_grid_layout_element_option_wrapper_start($parameters){
10
+
11
+ $settings_tabs_field = new settings_tabs_field();
12
+
13
+ $input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
14
+ $element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
15
+ $element_index = isset($parameters['index']) ? $parameters['index'] : '';
16
+
17
+ $wrapper_id = isset($element_data['wrapper_id']) ? $element_data['wrapper_id'] : '';
18
+ $wrapper_class = isset($element_data['wrapper_class']) ? $element_data['wrapper_class'] : '';
19
+ $margin = isset($element_data['margin']) ? $element_data['margin'] : '';
20
+
21
+
22
+ $css = isset($element_data['css']) ? $element_data['css'] : '';
23
+ $css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
24
+
25
+
26
+ ?>
27
+ <div class="item wrapper_start">
28
+ <div class="element-title header ">
29
+ <span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
30
+ <span class="sort"><i class="fas fa-sort"></i></span>
31
+
32
+ <span class="expand"><?php echo __('Wrapper start','post-grid'); ?></span>
33
+
34
+ <span class="handle-start"><i class="fas fa-level-up-alt"></i></span>
35
+
36
+ </div>
37
+ <div class="element-options options">
38
+
39
+ <?php
40
+
41
+ $args = array(
42
+ 'id' => 'wrapper_id',
43
+ 'parent' => $input_name.'[wrapper_start]',
44
+ 'title' => __('Wrapper id','post-grid'),
45
+ 'details' => __('Write wrapper id, ex: my-unique-id.','post-grid'),
46
+ 'type' => 'text',
47
+ 'value' => $wrapper_id,
48
+ 'default' => '',
49
+ );
50
+
51
+ $settings_tabs_field->generate_field($args);
52
+
53
+
54
+ $args = array(
55
+ 'id' => 'wrapper_class',
56
+ 'parent' => $input_name.'[wrapper_start]',
57
+ 'title' => __('Wrapper class','post-grid'),
58
+ 'details' => __('Write wrapper class, ex: layer-thumbnail','post-grid'),
59
+ 'type' => 'text',
60
+ 'value' => $wrapper_class,
61
+ 'default' => '',
62
+ );
63
+
64
+ $settings_tabs_field->generate_field($args);
65
+
66
+
67
+
68
+ $args = array(
69
+ 'id' => 'margin',
70
+ 'css_id' => $element_index.'_margin',
71
+ 'parent' => $input_name.'[wrapper_start]',
72
+ 'title' => __('Margin','post-grid'),
73
+ 'details' => __('Set margin.','post-grid'),
74
+ 'type' => 'text',
75
+ 'value' => $margin,
76
+ 'default' => '',
77
+ 'placeholder' => '5px 0',
78
+ );
79
+
80
+ $settings_tabs_field->generate_field($args);
81
+
82
+ $args = array(
83
+ 'id' => 'css',
84
+ 'css_id' => $element_index.'_css',
85
+ 'parent' => $input_name.'[wrapper_start]',
86
+ 'title' => __('Custom CSS','post-grid'),
87
+ 'details' => __('Set csutom CSS.','post-grid'),
88
+ 'type' => 'textarea',
89
+ 'value' => $css,
90
+ 'default' => '',
91
+ 'placeholder' => '',
92
+ );
93
+
94
+ $settings_tabs_field->generate_field($args);
95
+
96
+ $args = array(
97
+ 'id' => 'css_hover',
98
+ 'css_id' => $element_index.'_css_hover',
99
+ 'parent' => $input_name.'[wrapper_start]',
100
+ 'title' => __('Hover CSS','post-grid'),
101
+ 'details' => __('Set hover custom CSS.','post-grid'),
102
+ 'type' => 'textarea',
103
+ 'value' => $css_hover,
104
+ 'default' => '',
105
+ 'placeholder' => '',
106
+ );
107
+
108
+ $settings_tabs_field->generate_field($args);
109
+
110
+ ob_start();
111
+ ?>
112
+ <textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}</textarea>
113
+ <?php
114
+
115
+ $html = ob_get_clean();
116
+
117
+ $args = array(
118
+ 'id' => 'use_css',
119
+ 'title' => __('Use of CSS','post-grid'),
120
+ 'details' => __('Use following class selector to add custom CSS for this element.','post-grid'),
121
+ 'type' => 'custom_html',
122
+ 'html' => $html,
123
+
124
+ );
125
+
126
+ $settings_tabs_field->generate_field($args);
127
+
128
+ ?>
129
+
130
+ </div>
131
+ </div>
132
+ <?php
133
+
134
+ }
135
+
136
+
137
+
138
+
139
+ add_action('post_grid_layout_element_wrapper_start', 'post_grid_layout_element_wrapper_start', 10);
140
+ function post_grid_layout_element_wrapper_start($args){
141
+
142
+ $index = isset($args['index']) ? $args['index'] : '';
143
+ $element_class = !empty($index) ? 'element_'.$index : '';
144
+
145
+ //echo '<pre>'.var_export($args, true).'</pre>';
146
+ $element = isset($args['element']) ? $args['element'] : array();
147
+ $wrapper_class = isset($element['wrapper_class']) ? $element['wrapper_class'] : '';
148
+ $wrapper_id = isset($element['wrapper_id']) ? $element['wrapper_id'] : '';
149
+
150
+
151
+
152
+ ?>
153
+ <div class="<?php echo $wrapper_class; ?> <?php echo $element_class; ?>" id="<?php echo $wrapper_id; ?>">
154
+ <?php
155
+
156
+ }
157
+
158
+
159
+ add_action('post_grid_layout_element_css_wrapper_start', 'post_grid_layout_element_css_wrapper_start', 10);
160
+ function post_grid_layout_element_css_wrapper_start($args){
161
+
162
+
163
+ $index = isset($args['index']) ? $args['index'] : '';
164
+ $element = isset($args['element']) ? $args['element'] : array();
165
+ $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
166
+
167
+ $color = isset($element['color']) ? $element['color'] : '';
168
+ $font_size = isset($element['font_size']) ? $element['font_size'] : '';
169
+ $font_family = isset($element['font_family']) ? $element['font_family'] : '';
170
+ $margin = isset($element['margin']) ? $element['margin'] : '';
171
+ $text_align = isset($element['text_align']) ? $element['text_align'] : '';
172
+
173
+ $css = isset($element['css']) ? $element['css'] : '';
174
+ $css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
175
+
176
+ ?>
177
+ <style type="text/css">
178
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
179
+ <?php if(!empty($color)): ?>
180
+ color: <?php echo $color; ?>;
181
+ <?php endif; ?>
182
+ <?php if(!empty($font_size)): ?>
183
+ font-size: <?php echo $font_size; ?>;
184
+ <?php endif; ?>
185
+ <?php if(!empty($font_family)): ?>
186
+ font-family: <?php echo $font_family; ?>;
187
+ <?php endif; ?>
188
+ <?php if(!empty($margin)): ?>
189
+ margin: <?php echo $margin; ?>;
190
+ <?php endif; ?>
191
+ <?php if(!empty($text_align)): ?>
192
+ text-align: <?php echo $text_align; ?>;
193
+ <?php endif; ?>
194
+ <?php if(!empty($css)): ?>
195
+ <?php echo $css; ?>
196
+ <?php endif; ?>
197
+ }
198
+ <?php if(!empty($css_hover)): ?>
199
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
200
+ <?php echo $css_hover; ?>
201
+ }
202
+ <?php endif; ?>
203
+ </style>
204
+ <?php
205
+ }
206
+
207
+
208
+
209
+
210
+
211
+ add_action('post_grid_layout_element_option_wrapper_end','post_grid_layout_element_option_wrapper_end');
212
+
213
+
214
+ function post_grid_layout_element_option_wrapper_end($parameters){
215
+
216
+ $settings_tabs_field = new settings_tabs_field();
217
+
218
+ $input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
219
+ $element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
220
+
221
+ $wrapper_id = isset($element_data['wrapper_id']) ? $element_data['wrapper_id'] : '';
222
+
223
+ ?>
224
+ <div class="item wrapper_end">
225
+ <div class="element-title header ">
226
+ <span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
227
+ <span class="sort"><i class="fas fa-sort"></i></span>
228
+
229
+ <span class="expand"><?php echo __('Wrapper end','post-grid'); ?></span>
230
+ <span class="handle-end"><i class="fas fa-level-down-alt"></i></span>
231
+ </div>
232
+ <div class="element-options options">
233
+
234
+ <?php
235
+
236
+ $args = array(
237
+ 'id' => 'wrapper_id',
238
+ 'wraper_class' => 'hidden',
239
+
240
+ 'parent' => $input_name.'[wrapper_end]',
241
+ 'title' => __('Wrapper id','post-grid'),
242
+ 'details' => __('Write wrapper id, ex: div, p, span.','post-grid'),
243
+ 'type' => 'hidden',
244
+ 'value' => $wrapper_id,
245
+ 'default' => '',
246
+ );
247
+
248
+ $settings_tabs_field->generate_field($args);
249
+
250
+
251
+
252
+
253
+
254
+ ?>
255
+
256
+ </div>
257
+ </div>
258
+ <?php
259
+
260
+ }
261
+
262
+
263
+
264
+ add_action('post_grid_layout_element_wrapper_end', 'post_grid_layout_element_wrapper_end', 10);
265
+ function post_grid_layout_element_wrapper_end($args){
266
+
267
+
268
+ ?>
269
+ </div>
270
+ <?php
271
+
272
+ }
273
+
274
+
275
+
276
+
277
  add_action('post_grid_layout_element_option_custom_text','post_grid_layout_element_option_custom_text');
278
  function post_grid_layout_element_option_custom_text($parameters){
279
 
451
  }
452
 
453
 
454
+ add_action('post_grid_layout_element_custom_text', 'post_grid_layout_element_custom_text');
455
+ function post_grid_layout_element_custom_text($args){
456
+
457
+ $element = isset($args['element']) ? $args['element'] : array();
458
+ $elementIndex = isset($args['index']) ? $args['index'] : '';
459
+ $post_id = isset($args['post_id']) ? $args['post_id'] : '';
460
+
461
+ if(empty($post_id)) return;
462
+
463
+ $title = get_the_title($post_id);
464
+
465
+ $custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
466
+ $text = isset($element['text']) ? $element['text'] : '';
467
+
468
+ ?>
469
+ <div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> custom_text ">
470
+ <?php echo esc_html($text); ?>
471
+ </div>
472
+ <?php
473
+ }
474
+
475
+
476
+
477
+ add_action('post_grid_layout_element_css_custom_text', 'post_grid_layout_element_css_custom_text', 10);
478
+ function post_grid_layout_element_css_custom_text($args){
479
+
480
+
481
+ $index = isset($args['index']) ? $args['index'] : '';
482
+ $element = isset($args['element']) ? $args['element'] : array();
483
+ $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
484
+
485
+ $color = isset($element['color']) ? $element['color'] : '';
486
+ $font_size = isset($element['font_size']) ? $element['font_size'] : '';
487
+ $font_family = isset($element['font_family']) ? $element['font_family'] : '';
488
+ $margin = isset($element['margin']) ? $element['margin'] : '';
489
+ $text_align = isset($element['text_align']) ? $element['text_align'] : '';
490
+
491
+ $css = isset($element['css']) ? $element['css'] : '';
492
+ $css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
493
+
494
+ ?>
495
+ <style type="text/css">
496
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
497
+ <?php if(!empty($color)): ?>
498
+ color: <?php echo $color; ?>;
499
+ <?php endif; ?>
500
+ <?php if(!empty($font_size)): ?>
501
+ font-size: <?php echo $font_size; ?>;
502
+ <?php endif; ?>
503
+ <?php if(!empty($font_family)): ?>
504
+ font-family: <?php echo $font_family; ?>;
505
+ <?php endif; ?>
506
+ <?php if(!empty($margin)): ?>
507
+ margin: <?php echo $margin; ?>;
508
+ <?php endif; ?>
509
+ <?php if(!empty($text_align)): ?>
510
+ text-align: <?php echo $text_align; ?>;
511
+ <?php endif; ?>
512
+ <?php if(!empty($css)): ?>
513
+ <?php echo $css; ?>
514
+ <?php endif; ?>
515
+ }
516
+ <?php if(!empty($css_hover)): ?>
517
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
518
+ <?php echo $css_hover; ?>
519
+ }
520
+ <?php endif; ?>
521
+ </style>
522
+ <?php
523
+ }
524
+
525
+
526
+
527
  add_action('post_grid_layout_element_option_title','post_grid_layout_element_option_title');
528
  function post_grid_layout_element_option_title($parameters){
529
 
749
  }
750
 
751
 
752
+ add_action('post_grid_layout_element_title', 'post_grid_layout_element_title');
753
 
754
+ function post_grid_layout_element_title($args){
755
 
756
+ $element = isset($args['element']) ? $args['element'] : array();
757
+ $elementIndex = isset($args['index']) ? $args['index'] : '';
758
 
759
+ $post_id = isset($args['post_id']) ? $args['post_id'] : '';
760
 
761
+ if(empty($post_id)) return;
762
 
763
+ $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
764
 
765
+ $post_link = get_permalink($post_id);
766
 
767
+ $post = get_post( $post_id );
768
+ $title = isset( $post->post_title ) ? $post->post_title : '';
769
+
770
+
771
+ //$title = get_the_title($post_id);
772
+
773
+ $link_target = isset($element['link_target']) ? $element['link_target'] : '';
774
+ $custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
775
+ $char_limit = isset($element['char_limit']) ? (int) $element['char_limit'] : 0;
776
+ $char_end = isset($element['char_end']) ? $element['char_end'] : '...';
777
+ $link_to = isset($element['link_to']) ? $element['link_to'] : 'post_link';
778
+
779
+
780
+ if($char_limit > 0){
781
+ $title = wp_trim_words($title, $char_limit, $char_end);
782
+ }
783
+
784
+ ?>
785
+ <div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> title ">
786
+ <?php if($link_to == 'post_link'): ?>
787
+ <a target="<?php echo esc_attr($link_target); ?>" href="<?php echo esc_url_raw($post_link); ?>"><?php echo esc_html($title); ?></a>
788
+ <?php else: ?>
789
+ <?php echo esc_html($title); ?>
790
+ <?php endif; ?>
791
+
792
+
793
+ </div>
794
+ <?php
795
+ }
796
+
797
+
798
+ add_action('post_grid_layout_element_css_title', 'post_grid_layout_element_css_title', 10);
799
+ function post_grid_layout_element_css_title($args){
800
+
801
+
802
+ $index = isset($args['index']) ? $args['index'] : '';
803
+ $element = isset($args['element']) ? $args['element'] : array();
804
+ $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
805
+
806
+ $color = isset($element['color']) ? $element['color'] : '';
807
+ $font_size = isset($element['font_size']) ? $element['font_size'] : '';
808
+ $font_family = isset($element['font_family']) ? $element['font_family'] : '';
809
+ $margin = isset($element['margin']) ? $element['margin'] : '';
810
+ $text_align = isset($element['text_align']) ? $element['text_align'] : '';
811
+ $css = isset($element['css']) ? $element['css'] : '';
812
+ $css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
813
+
814
+ ?>
815
+ <style type="text/css">
816
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
817
+ <?php if(!empty($color)): ?>
818
+ color: <?php echo $color; ?>;
819
+ <?php endif; ?>
820
+ <?php if(!empty($font_size)): ?>
821
+ font-size: <?php echo $font_size; ?>;
822
+ <?php endif; ?>
823
+ <?php if(!empty($font_family)): ?>
824
+ font-family: <?php echo $font_family; ?>;
825
+ <?php endif; ?>
826
+ <?php if(!empty($margin)): ?>
827
+ margin: <?php echo $margin; ?>;
828
+ <?php endif; ?>
829
+ <?php if(!empty($text_align)): ?>
830
+ text-align: <?php echo $text_align; ?>;
831
+ <?php endif; ?>
832
+ <?php if(!empty($css)): ?>
833
+ <?php echo $css; ?>
834
+ <?php endif; ?>
835
+ }
836
+ <?php if(!empty($css_hover)): ?>
837
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
838
+ <?php echo $css_hover; ?>
839
+ }
840
+ <?php endif; ?>
841
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?> a{
842
+ <?php if(!empty($color)): ?>
843
+ color: <?php echo $color; ?>;
844
+ <?php endif; ?>
845
+ <?php if(!empty($font_size)): ?>
846
+ font-size: <?php echo $font_size; ?>;
847
+ <?php endif; ?>
848
+ <?php if(!empty($font_family)): ?>
849
+ font-family: <?php echo $font_family; ?>;
850
+ <?php endif; ?>
851
+ }
852
+ </style>
853
+ <?php
854
+ }
855
+
856
+
857
+
858
+
859
+
860
+ add_action('post_grid_layout_element_option_title_link','post_grid_layout_element_option_title_link');
861
+
862
+
863
+ function post_grid_layout_element_option_title_link($parameters){
864
+
865
+ $settings_tabs_field = new settings_tabs_field();
866
+
867
+ $input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
868
+ $element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
869
+ $element_index = isset($parameters['index']) ? $parameters['index'] : '';
870
 
871
 
872
  $color = isset($element_data['color']) ? $element_data['color'] : '';
1085
  }
1086
 
1087
 
1088
+ add_action('post_grid_layout_element_title_link', 'post_grid_layout_element_title_link');
1089
 
1090
+ function post_grid_layout_element_title_link($args){
1091
 
1092
+ $element = isset($args['element']) ? $args['element'] : array();
1093
+ $elementIndex = isset($args['index']) ? $args['index'] : '';
1094
 
1095
+ $post_id = isset($args['post_id']) ? $args['post_id'] : '';
1096
+
1097
+ if(empty($post_id)) return;
1098
+
1099
+ $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
1100
+
1101
+
1102
+ $title = get_the_title($post_id);
1103
+ $post_link = get_permalink($post_id);
1104
+
1105
+ $link_to = isset($element['link_to']) ? $element['link_to'] : 'post_link';
1106
+ $link_target = isset($element['link_target']) ? $element['link_target'] : '';
1107
+ $custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
1108
+ $char_limit = isset($element['char_limit']) ? (int) $element['char_limit'] : 0;
1109
+ $char_end = isset($element['char_end']) ? $element['char_end'] : '...';
1110
+
1111
+
1112
+ if($char_limit > 0){
1113
+ $title = wp_trim_words($title, $char_limit, $char_end);
1114
+ }
1115
+
1116
+
1117
+ ?>
1118
+ <div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> title_link ">
1119
+ <?php if($link_to == 'post_link'): ?>
1120
+ <a target="<?php echo esc_attr($link_target); ?>" href="<?php echo esc_url_raw($post_link); ?>"><?php echo esc_html($title); ?></a>
1121
+ <?php else: ?>
1122
+ <?php echo esc_html($title); ?>
1123
+ <?php endif; ?>
1124
+ </div>
1125
+ <?php
1126
+ }
1127
+
1128
+
1129
+
1130
+ add_action('post_grid_layout_element_css_title_link', 'post_grid_layout_element_css_title_link', 10);
1131
+ function post_grid_layout_element_css_title_link($args){
1132
+
1133
+
1134
+ $index = isset($args['index']) ? $args['index'] : '';
1135
+ $element = isset($args['element']) ? $args['element'] : array();
1136
+ $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
1137
+
1138
+ $color = isset($element['color']) ? $element['color'] : '';
1139
+ $font_size = isset($element['font_size']) ? $element['font_size'] : '';
1140
+ $font_family = isset($element['font_family']) ? $element['font_family'] : '';
1141
+ $margin = isset($element['margin']) ? $element['margin'] : '';
1142
+ $text_align = isset($element['text_align']) ? $element['text_align'] : '';
1143
+
1144
+ $css = isset($element['css']) ? $element['css'] : '';
1145
+ $css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
1146
+
1147
+ ?>
1148
+ <style type="text/css">
1149
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
1150
+ <?php if(!empty($color)): ?>
1151
+ color: <?php echo $color; ?>;
1152
+ <?php endif; ?>
1153
+ <?php if(!empty($font_size)): ?>
1154
+ font-size: <?php echo $font_size; ?>;
1155
+ <?php endif; ?>
1156
+ <?php if(!empty($font_family)): ?>
1157
+ font-family: <?php echo $font_family; ?>;
1158
+ <?php endif; ?>
1159
+ <?php if(!empty($margin)): ?>
1160
+ margin: <?php echo $margin; ?>;
1161
+ <?php endif; ?>
1162
+ <?php if(!empty($text_align)): ?>
1163
+ text-align: <?php echo $text_align; ?>;
1164
+ <?php endif; ?>
1165
+ <?php if(!empty($css)): ?>
1166
+ <?php echo $css; ?>
1167
+ <?php endif; ?>
1168
+ }
1169
+ <?php if(!empty($css_hover)): ?>
1170
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
1171
+ <?php echo $css_hover; ?>
1172
+ }
1173
+ <?php endif; ?>
1174
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?> a{
1175
+ <?php if(!empty($color)): ?>
1176
+ color: <?php echo $color; ?>;
1177
+ <?php endif; ?>
1178
+ <?php if(!empty($font_size)): ?>
1179
+ font-size: <?php echo $font_size; ?>;
1180
+ <?php endif; ?>
1181
+ <?php if(!empty($font_family)): ?>
1182
+ font-family: <?php echo $font_family; ?>;
1183
+ <?php endif; ?>
1184
+ }
1185
+ </style>
1186
+ <?php
1187
+ }
1188
+
1189
+
1190
+
1191
+ add_action('post_grid_layout_element_option_content','post_grid_layout_element_option_content');
1192
+
1193
+
1194
+ function post_grid_layout_element_option_content($parameters){
1195
 
1196
  $settings_tabs_field = new settings_tabs_field();
1197
 
1199
  $element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
1200
  $element_index = isset($parameters['index']) ? $parameters['index'] : '';
1201
 
 
 
 
 
 
 
 
 
1202
 
 
1203
  $font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
1204
  $margin = isset($element_data['margin']) ? $element_data['margin'] : '';
1205
  $text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
1213
  <span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
1214
  <span class="sort"><i class="fas fa-sort"></i></span>
1215
 
1216
+ <span class="expand"><?php echo __('Content','post-grid'); ?></span>
1217
  </div>
1218
  <div class="element-options options">
1219
 
1220
  <?php
1221
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1222
 
1223
  $args = array(
1224
+ 'id' => 'font_family',
1225
+ 'css_id' => $element_index.'_font_family',
1226
+ 'parent' => $input_name.'[content]',
1227
+ 'title' => __('Font family','post-grid'),
1228
+ 'details' => __('Set font family.','post-grid'),
1229
  'type' => 'text',
1230
+ 'value' => $font_family,
1231
  'default' => '',
1232
+ 'placeholder' => 'Open Sans',
1233
  );
1234
 
1235
  $settings_tabs_field->generate_field($args);
1236
 
1237
  $args = array(
1238
+ 'id' => 'text_align',
1239
+ 'css_id' => $element_index.'_text_align',
1240
+ 'parent' => $input_name.'[content]',
1241
+ 'title' => __('Text align','post-grid'),
1242
+ 'details' => __('Choose text align.','post-grid'),
 
 
 
 
 
 
 
 
 
 
 
 
 
1243
  'type' => 'select',
1244
+ 'value' => $text_align,
1245
+ 'default' => 'left',
1246
+ 'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
 
 
 
 
 
 
1247
  );
1248
 
1249
  $settings_tabs_field->generate_field($args);
1250
 
1251
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1252
  $args = array(
1253
  'id' => 'margin',
1254
  'css_id' => $element_index.'_margin',
1255
+ 'parent' => $input_name.'[content]',
1256
  'title' => __('Margin','post-grid'),
1257
  'details' => __('Set margin.','post-grid'),
1258
  'type' => 'text',
1263
 
1264
  $settings_tabs_field->generate_field($args);
1265
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1266
 
1267
  $args = array(
1268
  'id' => 'css',
1269
  'css_id' => $element_index.'_css',
1270
+ 'parent' => $input_name.'[content]',
1271
  'title' => __('Custom CSS','post-grid'),
1272
  'details' => __('Set csutom CSS.','post-grid'),
1273
  'type' => 'textarea',
1281
  $args = array(
1282
  'id' => 'css_hover',
1283
  'css_id' => $element_index.'_css_hover',
1284
+ 'parent' => $input_name.'[content]',
1285
  'title' => __('Hover CSS','post-grid'),
1286
  'details' => __('Set hover custom CSS.','post-grid'),
1287
  'type' => 'textarea',
1312
 
1313
  $settings_tabs_field->generate_field($args);
1314
 
1315
+
1316
  ?>
1317
 
1318
  </div>
1322
  }
1323
 
1324
 
1325
+
1326
+
1327
+ add_action('post_grid_layout_element_content', 'post_grid_layout_element_content');
1328
+
1329
+ function post_grid_layout_element_content($args){
1330
+
1331
+ $element = isset($args['element']) ? $args['element'] : array();
1332
+ $elementIndex = isset($args['index']) ? $args['index'] : '';
1333
+
1334
+ $post_id = isset($args['post_id']) ? $args['post_id'] : '';
1335
+
1336
+ if(empty($post_id)) return;
1337
+
1338
+ $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
1339
+
1340
+ $post = get_post( $post_id );
1341
+ $post_content = isset( $post->post_content ) ? $post->post_content : '';
1342
+
1343
+
1344
+ //$post_content = get_the_content($post_id);
1345
+
1346
+
1347
+ $custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
1348
+
1349
+ $post_content = wpautop($post_content);
1350
+ $post_content = do_shortcode($post_content);
1351
+
1352
+
1353
+ ?>
1354
+ <div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> content ">
1355
+ <?php echo ($post_content); ?>
1356
+ </div>
1357
+ <?php
1358
+ }
1359
+
1360
+
1361
+ add_action('post_grid_layout_element_option_excerpt','post_grid_layout_element_option_excerpt');
1362
+ function post_grid_layout_element_option_excerpt($parameters){
1363
 
1364
  $settings_tabs_field = new settings_tabs_field();
1365
 
1367
  $element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
1368
  $element_index = isset($parameters['index']) ? $parameters['index'] : '';
1369
 
 
 
 
 
 
 
 
1370
  $font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
1371
  $font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
1372
  $margin = isset($element_data['margin']) ? $element_data['margin'] : '';
1373
+ $color = isset($element_data['color']) ? $element_data['color'] : '';
1374
  $text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
1375
 
1376
+ $excerpt_source = isset($element_data['excerpt_source']) ? $element_data['excerpt_source'] : '';
1377
+
1378
+ $link_target = isset($element_data['link_target']) ? $element_data['link_target'] : '';
1379
+ $char_limit = isset($element_data['char_limit']) ? $element_data['char_limit'] : 0;
1380
+ $read_more_text = isset($element_data['read_more_text']) ? $element_data['read_more_text'] : '';
1381
+
1382
  $css = isset($element_data['css']) ? $element_data['css'] : '';
1383
  $css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
1384
 
1385
 
 
1386
  ?>
1387
  <div class="item">
1388
  <div class="element-title header ">
1389
  <span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
1390
  <span class="sort"><i class="fas fa-sort"></i></span>
1391
 
1392
+ <span class="expand"><?php echo __('Post excerpt','post-grid'); ?></span>
1393
  </div>
1394
  <div class="element-options options">
1395
 
1396
  <?php
1397
 
1398
  $args = array(
1399
+ 'id' => 'excerpt_source',
1400
+ 'css_id' => $element_index.'_excerpt_source',
1401
+ 'parent' => $input_name.'[excerpt]',
1402
+ 'title' => __('Excerpt source','post-grid'),
1403
+ 'details' => __('Choose excerpt source.','post-grid'),
1404
+ 'type' => 'select',
1405
+ 'value' => $excerpt_source,
1406
+ 'default' => 'post_link',
1407
+ 'args' => array(
1408
+ 'excerpt_field'=> __('Excerpt field', 'post-grid'),
1409
+ 'content'=> __('Content', 'post-grid'),
1410
+ 'excerpt_content'=> __('Excerpt first then Content', 'post-grid'),
1411
+
1412
+
1413
+ ),
1414
  );
1415
 
1416
  $settings_tabs_field->generate_field($args);
1417
 
 
1418
  $args = array(
1419
+ 'id' => 'char_limit',
1420
+ 'css_id' => $element_index.'_char_limit',
1421
+ 'parent' => $input_name.'[excerpt]',
1422
+ 'title' => __('Word limit','post-grid'),
1423
+ 'details' => __('Set word limit.','post-grid'),
1424
+ 'type' => 'text',
1425
+ 'value' => $char_limit,
1426
+ 'default' => '',
1427
+ 'placeholder' => '20',
 
 
 
 
1428
  );
1429
 
1430
  $settings_tabs_field->generate_field($args);
1431
 
1432
+ $args = array(
1433
+ 'id' => 'read_more_text',
1434
+ 'css_id' => $element_index.'_read_more_text',
1435
+ 'parent' => $input_name.'[excerpt]',
1436
+ 'title' => __('Read more text','post-grid'),
1437
+ 'details' => __('Custom read more text.','post-grid'),
1438
+ 'type' => 'text',
1439
+ 'value' => $read_more_text,
1440
+ 'default' => '',
1441
+ 'placeholder' => 'Read more',
1442
+ );
1443
 
1444
+ $settings_tabs_field->generate_field($args);
1445
  $args = array(
1446
  'id' => 'link_target',
1447
  'css_id' => $element_index.'_link_target',
1448
+ 'parent' => $input_name.'[excerpt]',
1449
  'title' => __('Link target','post-grid'),
1450
  'details' => __('Choose option link target.','post-grid'),
1451
  'type' => 'select',
1463
  $settings_tabs_field->generate_field($args);
1464
 
1465
 
 
 
 
 
 
 
 
 
 
 
1466
 
1467
+
1468
+
1469
 
1470
  $args = array(
1471
  'id' => 'margin',
1472
  'css_id' => $element_index.'_margin',
1473
+ 'parent' => $input_name.'[excerpt]',
1474
  'title' => __('Margin','post-grid'),
1475
  'details' => __('Set margin.','post-grid'),
1476
  'type' => 'text',
1477
  'value' => $margin,
1478
+ 'default' => '10px 0',
1479
  'placeholder' => '5px 0',
1480
  );
1481
 
1482
  $settings_tabs_field->generate_field($args);
1483
 
1484
  $args = array(
1485
+ 'id' => 'color',
1486
+ 'css_id' => $element_index.'_color',
1487
+ 'parent' => $input_name.'[excerpt]',
1488
+ 'title' => __('Text Color','post-grid'),
1489
+ 'details' => __('Choose text color.','post-grid'),
1490
+ 'type' => 'colorpicker',
1491
+ 'value' => $color,
1492
  'default' => '',
 
1493
  );
1494
 
1495
  $settings_tabs_field->generate_field($args);
1496
 
1497
+
1498
  $args = array(
1499
  'id' => 'text_align',
1500
  'css_id' => $element_index.'_text_align',
1501
+ 'parent' => $input_name.'[excerpt]',
1502
  'title' => __('Text align','post-grid'),
1503
  'details' => __('Choose text align.','post-grid'),
1504
  'type' => 'select',
1509
 
1510
  $settings_tabs_field->generate_field($args);
1511
 
1512
+
1513
+ $args = array(
1514
+ 'id' => 'font_size',
1515
+ 'css_id' => $element_index.'_font_size',
1516
+ 'parent' => $input_name.'[excerpt]',
1517
+ 'title' => __('Font size','post-grid'),
1518
+ 'details' => __('Set font size.','post-grid'),
1519
+ 'type' => 'text',
1520
+ 'value' => $font_size,
1521
+ 'default' => '15px',
1522
+ 'placeholder' => '14px',
1523
+ );
1524
+
1525
+ $settings_tabs_field->generate_field($args);
1526
+
1527
+
1528
  $args = array(
1529
  'id' => 'css',
1530
  'css_id' => $element_index.'_css',
1531
+ 'parent' => $input_name.'[excerpt]',
1532
  'title' => __('Custom CSS','post-grid'),
1533
  'details' => __('Set csutom CSS.','post-grid'),
1534
  'type' => 'textarea',
1542
  $args = array(
1543
  'id' => 'css_hover',
1544
  'css_id' => $element_index.'_css_hover',
1545
+ 'parent' => $input_name.'[excerpt]',
1546
  'title' => __('Hover CSS','post-grid'),
1547
  'details' => __('Set hover custom CSS.','post-grid'),
1548
  'type' => 'textarea',
1553
 
1554
  $settings_tabs_field->generate_field($args);
1555
 
 
1556
  ob_start();
1557
  ?>
1558
  <textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}
1582
 
1583
 
1584
 
1585
+ add_action('post_grid_layout_element_excerpt', 'post_grid_layout_element_excerpt');
1586
 
1587
+ function post_grid_layout_element_excerpt($args){
1588
 
1589
+ $element = isset($args['element']) ? $args['element'] : array();
1590
+ $elementIndex = isset($args['index']) ? $args['index'] : '';
1591
 
1592
+ $post_id = isset($args['post_id']) ? $args['post_id'] : '';
1593
 
1594
+ if(empty($post_id)) return;
1595
 
1596
+ $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
 
 
1597
 
 
 
 
1598
 
 
 
1599
 
1600
 
1601
+ //$post_excerpt = get_the_excerpt($post_id);
 
 
 
 
 
1602
 
 
 
1603
 
1604
+ $post_link = get_permalink($post_id);
1605
+ $excerpt_source = !empty($element['excerpt_source']) ? $element['excerpt_source'] : 'excerpt_content';
1606
 
1607
+ $link_target = isset($element['link_target']) ? $element['link_target'] : '';
1608
+ $custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
1609
+ $char_limit = !empty($element['char_limit']) ? (int) $element['char_limit'] : 50;
1610
+ $read_more_text = isset($element['read_more_text']) ? $element['read_more_text'] : '';
 
 
 
 
 
1611
 
1612
+ //var_dump($excerpt_source);
1613
 
1614
+ if($excerpt_source == 'excerpt_field'){
 
1615
 
1616
+ $the_post = get_post($post_id);
1617
+ $post_excerpt = isset($the_post->post_excerpt) ? $the_post->post_excerpt : '';
1618
+ //$post_content = strip_shortcodes( $post_content );
1619
+ //$post_excerpt = excerpt_remove_blocks( $post_content );
1620
 
 
 
1621
 
 
 
 
 
 
 
1622
 
1623
+ }elseif($excerpt_source == 'content'){
 
1624
 
1625
+ $the_post = get_post($post_id);
1626
+ $post_content = isset($the_post->post_content) ? $the_post->post_content : '';
1627
+ $post_content = strip_shortcodes( $post_content );
1628
+ $post_excerpt = excerpt_remove_blocks( $post_content );
1629
 
1630
+ }elseif($excerpt_source == 'excerpt_content'){
 
 
1631
 
1632
+ $the_post = get_post($post_id);
1633
+ $post_excerpt = isset($the_post->post_excerpt) ? $the_post->post_excerpt : '';
1634
+ $post_content = isset($the_post->post_content) ? $the_post->post_content : '';
1635
 
1636
+ $post_excerpt = !empty($post_excerpt) ? $post_excerpt : $post_content;
1637
+ $post_excerpt = strip_shortcodes( $post_excerpt );
1638
+ $post_excerpt = excerpt_remove_blocks( $post_excerpt );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1639
 
1640
+ }
1641
 
 
 
 
 
 
 
 
1642
 
 
1643
 
1644
 
1645
+ if($char_limit > 0){
1646
+ $post_excerpt = wp_trim_words($post_excerpt, $char_limit, '');
1647
+ }
1648
 
1649
+ //var_dump($post_excerpt);
1650
 
 
 
1651
 
1652
+ ?>
1653
+ <div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> excerpt ">
1654
+ <?php echo ($post_excerpt); ?>
1655
+ <?php
1656
+ if(!empty($read_more_text)):
1657
+ ?>
1658
+ <a target="<?php echo esc_attr($link_target); ?>" href="<?php echo esc_url_raw($post_link); ?>"><?php echo esc_html($read_more_text); ?></a>
1659
+ <?php
1660
+ endif;
1661
+ ?>
1662
+ </div>
1663
+ <?php
1664
+ }
1665
 
 
 
1666
 
1667
+ add_action('post_grid_layout_element_css_excerpt', 'post_grid_layout_element_css_excerpt', 10);
1668
+ function post_grid_layout_element_css_excerpt($args){
1669
+
1670
+
1671
+ $index = isset($args['index']) ? $args['index'] : '';
1672
+ $element = isset($args['element']) ? $args['element'] : array();
1673
+ $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
1674
+
1675
+ $color = isset($element['color']) ? $element['color'] : '';
1676
+ $font_size = isset($element['font_size']) ? $element['font_size'] : '';
1677
+ $font_family = isset($element['font_family']) ? $element['font_family'] : '';
1678
+ $margin = isset($element['margin']) ? $element['margin'] : '';
1679
+ $text_align = isset($element['text_align']) ? $element['text_align'] : '';
1680
+
1681
+ $css = isset($element['css']) ? $element['css'] : '';
1682
+ $css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
1683
+ ?>
1684
+ <style type="text/css">
1685
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
1686
+ <?php if(!empty($color)): ?>
1687
+ color: <?php echo $color; ?>;
1688
+ <?php endif; ?>
1689
+ <?php if(!empty($font_size)): ?>
1690
+ font-size: <?php echo $font_size; ?>;
1691
+ <?php endif; ?>
1692
+ <?php if(!empty($font_family)): ?>
1693
+ font-family: <?php echo $font_family; ?>;
1694
+ <?php endif; ?>
1695
+ <?php if(!empty($margin)): ?>
1696
+ margin: <?php echo $margin; ?>;
1697
+ <?php endif; ?>
1698
+ <?php if(!empty($text_align)): ?>
1699
+ text-align: <?php echo $text_align; ?>;
1700
+ <?php endif; ?>
1701
+ <?php if(!empty($css)): ?>
1702
+ <?php echo $css; ?>
1703
+ <?php endif; ?>
1704
+ }
1705
+ <?php if(!empty($css_hover)): ?>
1706
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
1707
+ <?php echo $css_hover; ?>
1708
+ }
1709
+ <?php endif; ?>
1710
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?> a{
1711
+ <?php if(!empty($color)): ?>
1712
+ color: <?php echo $color; ?>;
1713
+ <?php endif; ?>
1714
+ <?php if(!empty($font_size)): ?>
1715
+ font-size: <?php echo $font_size; ?>;
1716
+ <?php endif; ?>
1717
+ <?php if(!empty($font_family)): ?>
1718
+ font-family: <?php echo $font_family; ?>;
1719
+ <?php endif; ?>
1720
+ }
1721
+ </style>
1722
+ <?php
1723
+ }
1724
+
1725
+
1726
+
1727
+ add_action('post_grid_layout_element_option_excerpt_read_more','post_grid_layout_element_option_excerpt_read_more');
1728
+ function post_grid_layout_element_option_excerpt_read_more($parameters){
1729
+
1730
+ $settings_tabs_field = new settings_tabs_field();
1731
+
1732
+ $input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
1733
+ $element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
1734
+ $element_index = isset($parameters['index']) ? $parameters['index'] : '';
1735
+
1736
+ $excerpt_source = isset($element_data['excerpt_source']) ? $element_data['excerpt_source'] : '';
1737
+
1738
+ $link_target = isset($element_data['link_target']) ? $element_data['link_target'] : '';
1739
+ $char_limit = isset($element_data['char_limit']) ? $element_data['char_limit'] : 0;
1740
+ $read_more_text = isset($element_data['read_more_text']) ? $element_data['read_more_text'] : __('Read more', 'post-grid');
1741
+
1742
+ $wrapper_html = isset($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '';
1743
+ $color = isset($element_data['color']) ? $element_data['color'] : '';
1744
+
1745
+ $font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
1746
+ $font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
1747
+ $margin = isset($element_data['margin']) ? $element_data['margin'] : '';
1748
+ $text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
1749
+
1750
+ $css = isset($element_data['css']) ? $element_data['css'] : '';
1751
+ $css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
1752
+
1753
+ ?>
1754
+ <div class="item">
1755
+ <div class="element-title header ">
1756
+ <span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
1757
+ <span class="sort"><i class="fas fa-sort"></i></span>
1758
+
1759
+ <span class="expand"><?php echo __('Excerpt read more','post-grid'); ?></span>
1760
+ </div>
1761
+ <div class="element-options options">
1762
+
1763
+ <?php
1764
+
1765
+ $args = array(
1766
+ 'id' => 'excerpt_source',
1767
+ 'css_id' => $element_index.'_excerpt_source',
1768
+ 'parent' => $input_name.'[excerpt]',
1769
+ 'title' => __('Excerpt source','post-grid'),
1770
+ 'details' => __('Choose excerpt source.','post-grid'),
1771
+ 'type' => 'select',
1772
+ 'value' => $excerpt_source,
1773
+ 'default' => 'post_link',
1774
+ 'args' => array(
1775
+ 'excerpt_field'=> __('Excerpt field', 'post-grid'),
1776
+ 'content'=> __('Content', 'post-grid'),
1777
+ 'excerpt_content'=> __('Excerpt first then Content', 'post-grid'),
1778
 
 
 
 
 
 
 
1779
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1780
  ),
1781
+ );
1782
 
1783
+ $settings_tabs_field->generate_field($args);
1784
+
1785
+ $args = array(
1786
+ 'id' => 'char_limit',
1787
+ 'css_id' => $element_index.'_char_limit',
1788
+ 'parent' => $input_name.'[excerpt_read_more]',
1789
+ 'title' => __('Word limit','post-grid'),
1790
+ 'details' => __('Set word limit.','post-grid'),
1791
+ 'type' => 'text',
1792
+ 'value' => $char_limit,
1793
+ 'default' => '',
1794
+ 'placeholder' => '20',
1795
  );
1796
 
1797
  $settings_tabs_field->generate_field($args);
1798
 
1799
+ $args = array(
1800
+ 'id' => 'read_more_text',
1801
+ 'css_id' => $element_index.'_read_more_text',
1802
+ 'parent' => $input_name.'[excerpt_read_more]',
1803
+ 'title' => __('Read more text','post-grid'),
1804
+ 'details' => __('Custom read more text.','post-grid'),
1805
+ 'type' => 'text',
1806
+ 'value' => $read_more_text,
1807
+ 'default' => '',
1808
+ 'placeholder' => 'Read more',
1809
+ );
1810
 
1811
+ $settings_tabs_field->generate_field($args);
1812
+ $args = array(
1813
+ 'id' => 'link_target',
1814
+ 'css_id' => $element_index.'_link_target',
1815
+ 'parent' => $input_name.'[excerpt_read_more]',
1816
+ 'title' => __('Link target','post-grid'),
1817
+ 'details' => __('Choose option link target.','post-grid'),
1818
+ 'type' => 'select',
1819
+ 'value' => $link_target,
1820
+ 'default' => 'post_link',
1821
+ 'args' => array(
1822
+ '_blank'=> __('_blank', 'post-grid'),
1823
+ '_parent'=> __('_parent', 'post-grid'),
1824
+ '_self'=> __('_self', 'post-grid'),
1825
+ '_top'=> __('_top', 'post-grid'),
1826
+
1827
+ ),
1828
+ );
1829
+
1830
+ $settings_tabs_field->generate_field($args);
1831
+
1832
+
1833
+
1834
+
1835
+
1836
+
1837
+ $args = array(
1838
+ 'id' => 'color',
1839
+ 'css_id' => $element_index.'_color',
1840
+ 'parent' => $input_name.'[excerpt_read_more]',
1841
+ 'title' => __('Text Color','post-grid'),
1842
+ 'details' => __('Choose text color.','post-grid'),
1843
+ 'type' => 'colorpicker',
1844
+ 'value' => $color,
1845
+ 'default' => '',
1846
+ );
1847
+
1848
+ $settings_tabs_field->generate_field($args);
1849
 
1850
  $args = array(
1851
  'id' => 'margin',
1852
  'css_id' => $element_index.'_margin',
1853
+ 'parent' => $input_name.'[excerpt_read_more]',
1854
  'title' => __('Margin','post-grid'),
1855
  'details' => __('Set margin.','post-grid'),
1856
  'type' => 'text',
1861
 
1862
  $settings_tabs_field->generate_field($args);
1863
 
 
1864
  $args = array(
1865
+ 'id' => 'font_size',
1866
+ 'css_id' => $element_index.'_font_size',
1867
+ 'parent' => $input_name.'[excerpt_read_more]',
1868
+ 'title' => __('Font size','post-grid'),
1869
+ 'details' => __('Set font size.','post-grid'),
1870
  'type' => 'text',
1871
+ 'value' => $font_size,
1872
  'default' => '',
1873
+ 'placeholder' => '16px',
1874
  );
1875
 
1876
  $settings_tabs_field->generate_field($args);
1877
 
1878
+ $args = array(
1879
+ 'id' => 'text_align',
1880
+ 'css_id' => $element_index.'_text_align',
1881
+ 'parent' => $input_name.'[excerpt_read_more]',
1882
+ 'title' => __('Text align','post-grid'),
1883
+ 'details' => __('Choose text align.','post-grid'),
1884
+ 'type' => 'select',
1885
+ 'value' => $text_align,
1886
+ 'default' => 'left',
1887
+ 'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
1888
+ );
1889
+
1890
+ $settings_tabs_field->generate_field($args);
1891
 
1892
  $args = array(
1893
  'id' => 'css',
1894
  'css_id' => $element_index.'_css',
1895
+ 'parent' => $input_name.'[excerpt_read_more]',
1896
  'title' => __('Custom CSS','post-grid'),
1897
  'details' => __('Set csutom CSS.','post-grid'),
1898
  'type' => 'textarea',
1906
  $args = array(
1907
  'id' => 'css_hover',
1908
  'css_id' => $element_index.'_css_hover',
1909
+ 'parent' => $input_name.'[excerpt_read_more]',
1910
  'title' => __('Hover CSS','post-grid'),
1911
  'details' => __('Set hover custom CSS.','post-grid'),
1912
  'type' => 'textarea',
1917
 
1918
  $settings_tabs_field->generate_field($args);
1919
 
1920
+
1921
  ob_start();
1922
  ?>
1923
  <textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}
1937
 
1938
  $settings_tabs_field->generate_field($args);
1939
 
 
1940
  ?>
1941
 
1942
  </div>
1946
  }
1947
 
1948
 
1949
+ add_action('post_grid_layout_element_excerpt_read_more', 'post_grid_layout_element_excerpt_read_more');
1950
+
1951
+ function post_grid_layout_element_excerpt_read_more($args){
1952
+
1953
+ $element = isset($args['element']) ? $args['element'] : array();
1954
+ $elementIndex = isset($args['index']) ? $args['index'] : '';
1955
+
1956
+ $post_id = isset($args['post_id']) ? $args['post_id'] : '';
1957
+
1958
+ if(empty($post_id)) return;
1959
+
1960
+ $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
1961
+
1962
+
1963
+
1964
+ $post_link = get_permalink($post_id);
1965
+
1966
+ $excerpt_source = !empty($element['excerpt_source']) ? $element['excerpt_source'] : 'excerpt_content';
1967
+
1968
+ $custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
1969
+ $char_limit = isset($element['char_limit']) ? (int) $element['char_limit'] : 0;
1970
+ $read_more_text = isset($element['read_more_text']) ? $element['read_more_text'] : '';
1971
+ $link_target = isset($element['link_target']) ? $element['link_target'] : '';
1972
+
1973
+
1974
+ if($excerpt_source == 'excerpt_field'){
1975
+
1976
+ $the_post = get_post($post_id);
1977
+ $post_excerpt = isset($the_post->post_excerpt) ? $the_post->post_excerpt : '';
1978
+ //$post_content = strip_shortcodes( $post_content );
1979
+ //$post_excerpt = excerpt_remove_blocks( $post_content );
1980
+
1981
+
1982
+ }elseif($excerpt_source == 'content'){
1983
+
1984
+ $the_post = get_post($post_id);
1985
+ $post_content = isset($the_post->post_content) ? $the_post->post_content : '';
1986
+ $post_content = strip_shortcodes( $post_content );
1987
+ $post_excerpt = excerpt_remove_blocks( $post_content );
1988
+
1989
+ }elseif($excerpt_source == 'excerpt_content'){
1990
+
1991
+ $the_post = get_post($post_id);
1992
+ $post_excerpt = isset($the_post->post_excerpt) ? $the_post->post_excerpt : '';
1993
+ $post_content = isset($the_post->post_content) ? $the_post->post_content : '';
1994
+
1995
+ $post_excerpt = !empty($post_excerpt) ? $post_excerpt : $post_content;
1996
+ $post_excerpt = strip_shortcodes( $post_excerpt );
1997
+ $post_excerpt = excerpt_remove_blocks( $post_excerpt );
1998
+
1999
+ }
2000
+
2001
+ if($char_limit > 0){
2002
+ $post_excerpt = wp_trim_words($post_excerpt, $char_limit, '');
2003
+ }
2004
+
2005
+
2006
+ ?>
2007
+ <div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> excerpt_read_more ">
2008
+ <?php echo ($post_excerpt); ?>
2009
+ <a target="<?php echo esc_attr($link_target); ?>" href="<?php echo esc_url_raw($post_link); ?>"><?php echo esc_html($read_more_text); ?></a>
2010
+
2011
+ </div>
2012
+ <?php
2013
+ }
2014
+
2015
 
 
2016
 
2017
 
2018
+
2019
+ add_action('post_grid_layout_element_css_excerpt_read_more', 'post_grid_layout_element_css_excerpt_read_more', 10);
2020
+ function post_grid_layout_element_css_excerpt_read_more($args){
2021
+
2022
+
2023
+ $index = isset($args['index']) ? $args['index'] : '';
2024
+ $element = isset($args['element']) ? $args['element'] : array();
2025
+ $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
2026
+
2027
+ $color = isset($element['color']) ? $element['color'] : '';
2028
+ $font_size = isset($element['font_size']) ? $element['font_size'] : '';
2029
+ $font_family = isset($element['font_family']) ? $element['font_family'] : '';
2030
+ $margin = isset($element['margin']) ? $element['margin'] : '';
2031
+ $text_align = isset($element['text_align']) ? $element['text_align'] : '';
2032
+
2033
+ $css = isset($element['css']) ? $element['css'] : '';
2034
+ $css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
2035
+ ?>
2036
+ <style type="text/css">
2037
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
2038
+ <?php if(!empty($color)): ?>
2039
+ color: <?php echo $color; ?>;
2040
+ <?php endif; ?>
2041
+ <?php if(!empty($font_size)): ?>
2042
+ font-size: <?php echo $font_size; ?>;
2043
+ <?php endif; ?>
2044
+ <?php if(!empty($font_family)): ?>
2045
+ font-family: <?php echo $font_family; ?>;
2046
+ <?php endif; ?>
2047
+ <?php if(!empty($margin)): ?>
2048
+ margin: <?php echo $margin; ?>;
2049
+ <?php endif; ?>
2050
+ <?php if(!empty($text_align)): ?>
2051
+ text-align: <?php echo $text_align; ?>;
2052
+ <?php endif; ?>
2053
+ <?php if(!empty($css)): ?>
2054
+ <?php echo $css; ?>
2055
+ <?php endif; ?>
2056
+ }
2057
+ <?php if(!empty($css_hover)): ?>
2058
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
2059
+ <?php echo $css_hover; ?>
2060
+ }
2061
+ <?php endif; ?>
2062
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?> a{
2063
+ <?php if(!empty($color)): ?>
2064
+ color: <?php echo $color; ?>;
2065
+ <?php endif; ?>
2066
+ <?php if(!empty($font_size)): ?>
2067
+ font-size: <?php echo $font_size; ?>;
2068
+ <?php endif; ?>
2069
+ <?php if(!empty($font_family)): ?>
2070
+ font-family: <?php echo $font_family; ?>;
2071
+ <?php endif; ?>
2072
+ }
2073
+ </style>
2074
+ <?php
2075
+ }
2076
+
2077
+
2078
+
2079
+
2080
+ add_action('post_grid_layout_element_option_read_more','post_grid_layout_element_option_read_more');
2081
+ function post_grid_layout_element_option_read_more($parameters){
2082
 
2083
  $settings_tabs_field = new settings_tabs_field();
2084
 
2086
  $element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
2087
  $element_index = isset($parameters['index']) ? $parameters['index'] : '';
2088
 
2089
+ $link_to = isset($element_data['link_to']) ? $element_data['link_to'] : '';
 
2090
  $link_target = isset($element_data['link_target']) ? $element_data['link_target'] : '';
2091
+ $wrapper_html = isset($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '';
2092
+ $read_more_text = isset($element_data['read_more_text']) ? $element_data['read_more_text'] : __('Read more', 'post-grid');
2093
 
2094
+ $color = isset($element_data['color']) ? $element_data['color'] : '';
 
 
2095
 
2096
+ $font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
2097
+ $font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
2098
+ $margin = isset($element_data['margin']) ? $element_data['margin'] : '';
2099
+ $text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
2100
 
2101
  $css = isset($element_data['css']) ? $element_data['css'] : '';
2102
  $css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
2109
  <span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
2110
  <span class="sort"><i class="fas fa-sort"></i></span>
2111
 
2112
+ <span class="expand"><?php echo __('Read more','post-grid'); ?></span>
2113
  </div>
2114
  <div class="element-options options">
2115
 
2116
  <?php
2117
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2118
  $args = array(
2119
+ 'id' => 'read_more_text',
2120
+ 'css_id' => $element_index.'_read_more_text',
2121
+ 'parent' => $input_name.'[read_more]',
2122
+ 'title' => __('Read more text','post-grid'),
2123
+ 'details' => __('Custom read more text.','post-grid'),
2124
+ 'type' => 'text',
2125
+ 'value' => $read_more_text,
2126
+ 'default' => '',
2127
+ 'placeholder' => 'Read more',
2128
  );
2129
 
2130
  $settings_tabs_field->generate_field($args);
2131
 
2132
 
 
2133
  $args = array(
2134
  'id' => 'link_to',
2135
  'css_id' => $element_index.'_link_to',
2136
+ 'parent' => $input_name.'[read_more]',
2137
  'title' => __('Link to','post-grid'),
2138
  'details' => __('Choose option to link title.','post-grid'),
2139
  'type' => 'select',
2152
  $args = array(
2153
  'id' => 'link_target',
2154
  'css_id' => $element_index.'_link_target',
2155
+ 'parent' => $input_name.'[read_more]',
2156
  'title' => __('Link target','post-grid'),
2157
  'details' => __('Choose option link target.','post-grid'),
2158
  'type' => 'select',
2170
  $settings_tabs_field->generate_field($args);
2171
 
2172
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2173
  $args = array(
2174
+ 'id' => 'color',
2175
+ 'css_id' => $element_index.'_color',
2176
+ 'parent' => $input_name.'[read_more]',
2177
+ 'title' => __('Text Color','post-grid'),
2178
+ 'details' => __('Choose text color.','post-grid'),
2179
+ 'type' => 'colorpicker',
2180
+ 'value' => $color,
2181
  'default' => '',
2182
  );
2183
 
2184
  $settings_tabs_field->generate_field($args);
2185
 
 
2186
  $args = array(
2187
  'id' => 'margin',
2188
  'css_id' => $element_index.'_margin',
2189
+ 'parent' => $input_name.'[read_more]',
2190
  'title' => __('Margin','post-grid'),
2191
  'details' => __('Set margin.','post-grid'),
2192
  'type' => 'text',
2197
 
2198
  $settings_tabs_field->generate_field($args);
2199
 
2200
+ $args = array(
2201
+ 'id' => 'font_size',
2202
+ 'css_id' => $element_index.'_font_size',
2203
+ 'parent' => $input_name.'[read_more]',
2204
+ 'title' => __('Font size','post-grid'),
2205
+ 'details' => __('Set font size.','post-grid'),
2206
+ 'type' => 'text',
2207
+ 'value' => $font_size,
2208
+ 'default' => '',
2209
+ 'placeholder' => '16px',
2210
+ );
2211
+
2212
+ $settings_tabs_field->generate_field($args);
2213
+
2214
+ $args = array(
2215
+ 'id' => 'text_align',
2216
+ 'css_id' => $element_index.'_text_align',
2217
+ 'parent' => $input_name.'[read_more]',
2218
+ 'title' => __('Text align','post-grid'),
2219
+ 'details' => __('Choose text align.','post-grid'),
2220
+ 'type' => 'select',
2221
+ 'value' => $text_align,
2222
+ 'default' => 'left',
2223
+ 'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
2224
+ );
2225
+
2226
+ $settings_tabs_field->generate_field($args);
2227
+
2228
  $args = array(
2229
  'id' => 'css',
2230
  'css_id' => $element_index.'_css',
2231
+ 'parent' => $input_name.'[read_more]',
2232
  'title' => __('Custom CSS','post-grid'),
2233
  'details' => __('Set csutom CSS.','post-grid'),
2234
  'type' => 'textarea',
2242
  $args = array(
2243
  'id' => 'css_hover',
2244
  'css_id' => $element_index.'_css_hover',
2245
+ 'parent' => $input_name.'[read_more]',
2246
  'title' => __('Hover CSS','post-grid'),
2247
  'details' => __('Set hover custom CSS.','post-grid'),
2248
  'type' => 'textarea',
2273
 
2274
  $settings_tabs_field->generate_field($args);
2275
 
 
2276
  ?>
2277
 
2278
  </div>
2283
 
2284
 
2285
 
2286
+ add_action('post_grid_layout_element_read_more', 'post_grid_layout_element_read_more');
2287
 
2288
+ function post_grid_layout_element_read_more($args){
2289
+
2290
+ $element = isset($args['element']) ? $args['element'] : array();
2291
+ $elementIndex = isset($args['index']) ? $args['index'] : '';
2292
+ $post_id = isset($args['post_id']) ? $args['post_id'] : '';
2293
+
2294
+ if(empty($post_id)) return;
2295
+
2296
+ $post_link = get_permalink($post_id);
2297
+
2298
+
2299
+ $custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
2300
+ $read_more_text = isset($element['read_more_text']) ? $element['read_more_text'] : '';
2301
+ $link_target = isset($element['link_target']) ? $element['link_target'] : '';
2302
+ $link_to = isset($element['link_to']) ? $element['link_to'] : 'post_link';
2303
+
2304
+
2305
+ ?>
2306
+ <?php if($link_to == 'post_link'): ?>
2307
+ <a class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> read_more " target="<?php echo esc_attr($link_target); ?>" href="<?php echo esc_url_raw($post_link); ?>"><?php echo esc_html($read_more_text); ?></a>
2308
+ <?php else: ?>
2309
+ <div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> read_more ">
2310
+ <?php echo esc_html($read_more_text); ?>
2311
+ </div>
2312
+ <?php endif; ?>
2313
+
2314
+ <?php
2315
+ }
2316
+
2317
+
2318
+
2319
+ add_action('post_grid_layout_element_css_read_more', 'post_grid_layout_element_css_read_more', 10);
2320
+ function post_grid_layout_element_css_read_more($args){
2321
 
2322
+
2323
+ $index = isset($args['index']) ? $args['index'] : '';
2324
+ $element = isset($args['element']) ? $args['element'] : array();
2325
+ $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
2326
+
2327
+ $color = isset($element['color']) ? $element['color'] : '';
2328
+ $font_size = isset($element['font_size']) ? $element['font_size'] : '';
2329
+ $font_family = isset($element['font_family']) ? $element['font_family'] : '';
2330
+ $margin = isset($element['margin']) ? $element['margin'] : '';
2331
+ $text_align = isset($element['text_align']) ? $element['text_align'] : '';
2332
+
2333
+ $css = isset($element['css']) ? $element['css'] : '';
2334
+ $css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
2335
+ ?>
2336
+ <style type="text/css">
2337
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
2338
+ <?php if(!empty($color)): ?>
2339
+ color: <?php echo $color; ?> !important;;
2340
+ <?php endif; ?>
2341
+ <?php if(!empty($font_size)): ?>
2342
+ font-size: <?php echo $font_size; ?>;
2343
+ <?php endif; ?>
2344
+ <?php if(!empty($font_family)): ?>
2345
+ font-family: <?php echo $font_family; ?>;
2346
+ <?php endif; ?>
2347
+ <?php if(!empty($margin)): ?>
2348
+ margin: <?php echo $margin; ?>;
2349
+ <?php endif; ?>
2350
+ <?php if(!empty($text_align)): ?>
2351
+ text-align: <?php echo $text_align; ?>;
2352
+ <?php endif; ?>
2353
+ <?php if(!empty($css)): ?>
2354
+ <?php echo $css; ?>
2355
+ <?php endif; ?>
2356
+ }
2357
+ <?php if(!empty($css_hover)): ?>
2358
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
2359
+ <?php echo $css_hover; ?>
2360
+ }
2361
+ <?php endif; ?>
2362
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?> a{
2363
+ <?php if(!empty($color)): ?>
2364
+ color: <?php echo $color; ?> !important; ;
2365
+ <?php endif; ?>
2366
+ <?php if(!empty($font_size)): ?>
2367
+ font-size: <?php echo $font_size; ?> !important;;
2368
+ <?php endif; ?>
2369
+ <?php if(!empty($font_family)): ?>
2370
+ font-family: <?php echo $font_family; ?> !important;;
2371
+ <?php endif; ?>
2372
+ }
2373
+ </style>
2374
+ <?php
2375
+ }
2376
+
2377
+
2378
+
2379
+
2380
+ add_action('post_grid_layout_element_option_media','post_grid_layout_element_option_media');
2381
+
2382
+
2383
+ function post_grid_layout_element_option_media($parameters){
2384
 
2385
  $settings_tabs_field = new settings_tabs_field();
2386
 
2388
  $element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
2389
  $element_index = isset($parameters['index']) ? $parameters['index'] : '';
2390
 
2391
+ $media_source = isset($element_data['media_source']) ? $element_data['media_source'] : array();
2392
+ $padding = isset($element_data['padding']) ? $element_data['padding'] : '';
 
 
2393
  $margin = isset($element_data['margin']) ? $element_data['margin'] : '';
 
 
 
 
 
 
 
2394
 
2395
  $css = isset($element_data['css']) ? $element_data['css'] : '';
2396
  $css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
2397
 
2398
 
2399
+ $media_sources_list = apply_filters('post_grid_media_source_list',
2400
+ array(
2401
+ 'featured_image'=>__('Featured Image','post-grid'),
2402
+ 'first_image'=>__('First images from content','post-grid'),
2403
+ 'empty_thumb'=>__('Empty thumbnail','post-grid'),
2404
+ 'siteorigin_first_image'=>__('SiteOrigin first image','post-grid'),
2405
+
2406
+ )
2407
+ );
2408
+
2409
+
2410
  ?>
2411
  <div class="item">
2412
  <div class="element-title header ">
2413
  <span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
2414
  <span class="sort"><i class="fas fa-sort"></i></span>
2415
+ <span class="expand"><?php echo __('Media','post-grid'); ?></span>
 
2416
  </div>
2417
  <div class="element-options options">
 
2418
  <?php
2419
 
2420
+ ob_start();
 
 
2421
 
2422
+ if(!empty($media_sources_list)){
2423
+ $media_source_new = array();
 
 
2424
 
2425
+ if(!empty($media_source))
2426
+ foreach ($media_source as $elementIndex => $argData){
2427
+ $enable = isset($argData['enable']) ? $argData['enable'] :'';
2428
 
2429
+ if($enable == 'yes')
2430
+ $media_source_new[$elementIndex] = array('enable'=> $enable);
 
 
 
 
 
 
 
 
2431
 
2432
+ }
2433
+ $media_sources_new = array_replace($media_source_new, $media_sources_list);
2434
+ $media_sources_new = (!empty($media_sources_new)) ? $media_sources_new : $media_sources_list;
2435
+ ?>
2436
+ <div class="expandable sortable">
2437
+ <?php
2438
+
2439
+ if(!empty($media_sources_new))
2440
+ foreach ($media_sources_new as $source_id => $source_name ) {
2441
+
2442
+ if(is_array($source_name)) continue;
2443
+
2444
+ $media_source_options = array();
2445
+ $source_data = isset($media_source[$source_id]) ? $media_source[$source_id] : array();
2446
+ $source_enable = isset($media_source[$source_id]['enable']) ? $media_source[$source_id]['enable'] : '';
2447
 
2448
+ $media_source_options['index'] = $element_index;
2449
+ $media_source_options['input_name'] = $input_name;
2450
+ $media_source_options['source_data'] = $source_data;
2451
 
2452
+ ?>
2453
+ <div class="item">
2454
+ <div class="element-title header ">
2455
+ <span class="sort"><i class="fas fa-sort"></i></span>
2456
+ <?php
2457
+ if($source_enable == 'yes'):
2458
+ ?><i class="fas fa-check"></i><?php
2459
+ else:
2460
+ ?><i class="fas fa-times"></i><?php
2461
+ endif;?>
2462
+ <span class="expand"><?php echo $source_name; ?></span>
2463
+ </div>
2464
+ <div class="element-options options">
2465
+ <?php
2466
+ do_action('media_source_options_'.$source_id, $media_source_options);
2467
+ ?>
2468
+ </div>
2469
+ </div>
2470
+ <?php
2471
+ }
2472
+ ?>
2473
+ </div>
2474
+ <?php
2475
+ }
2476
 
2477
+ $html = ob_get_clean();
2478
 
2479
  $args = array(
2480
+ 'id' => 'media_source',
2481
+ 'title' => __('Media source', 'post-grid'),
2482
+ 'details' => __('Choose media sources.', 'post-grid'),
2483
+ 'type' => 'custom_html',
2484
+ 'html' => $html,
 
 
 
 
 
 
 
2485
  );
2486
 
2487
  $settings_tabs_field->generate_field($args);
2488
 
2489
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2490
 
2491
+ $media_height = isset($element_data['media_height']) ? $element_data['media_height'] : '';
 
2492
 
2493
+ $media_height_large = isset($media_height['large']) ? $media_height['large'] : '';
2494
+ $media_height_large_type = isset($media_height['large_type']) ? $media_height['large_type'] : '';
2495
+
2496
+ $media_height_medium = isset($media_height['medium']) ? $media_height['medium'] : '';
2497
+ $media_height_medium_type = isset($media_height['medium_type']) ? $media_height['medium_type'] : '';
2498
 
2499
+ $media_height_small = isset($media_height['small']) ? $media_height['small'] : '';
2500
+ $media_height_small_type = isset($media_height['small_type']) ? $media_height['small_type'] : '';
2501
 
2502
 
2503
  $args = array(
2504
+ 'id' => 'media_height',
2505
+ 'title' => __('Media height','post-grid'),
2506
+ 'details' => __('Set media height.','post-grid'),
2507
  'type' => 'option_group',
2508
  'options' => array(
2509
+
2510
  array(
2511
+ 'id' => 'large_type',
2512
+ 'css_id' => $element_index.'_text_align',
2513
+ 'parent' => $input_name.'[media][media_height]',
2514
  'title' => __('In desktop','post-grid'),
2515
  'details' => __('min-width: 1200px, ex: 280px','post-grid'),
2516
+ 'type' => 'select',
2517
+ 'value' => $media_height_large_type,
2518
+ 'default' => 'left',
2519
+ 'args' => array('auto_height'=> __('Auto height', 'post-grid'),'fixed_height'=> __('Fixed height', 'post-grid'),'max_height'=> __('Max height', 'post-grid') ),
2520
+ ),
2521
+ array(
2522
+ 'id' => 'large',
2523
+ 'parent' => $input_name.'[media][media_height]',
2524
+ 'title' => __('Height value','post-grid'),
2525
+ //'details' => __('','post-grid'),
2526
  'type' => 'text',
2527
+ 'value' => $media_height_large,
2528
  'default' => '',
2529
  'placeholder' => '280px',
2530
  ),
2531
  array(
2532
+ 'id' => 'medium_type',
2533
+ 'css_id' => $element_index.'_text_align',
2534
+ 'parent' => $input_name.'[media][media_height]',
2535
  'title' => __('In tablet & small desktop','post-grid'),
2536
  'details' => __('min-width: 992px, ex: 280px','post-grid'),
2537
+ 'type' => 'select',
2538
+ 'value' => $media_height_medium_type,
2539
+ 'default' => 'left',
2540
+ 'args' => array('auto_height'=> __('Auto height', 'post-grid'),'fixed_height'=> __('Fixed height', 'post-grid'),'max_height'=> __('Max height', 'post-grid') ),
2541
+ ),
2542
+ array(
2543
+ 'id' => 'medium',
2544
+ 'parent' => $input_name.'[media][media_height]',
2545
+ 'title' => __('Height value','post-grid'),
2546
+ //'details' => __('','post-grid'),
2547
  'type' => 'text',
2548
+ 'value' => $media_height_medium,
2549
  'default' => '',
2550
  'placeholder' => '280px',
2551
  ),
2552
  array(
2553
+ 'id' => 'small_type',
2554
+ 'css_id' => $element_index.'_text_align',
2555
+ 'parent' => $input_name.'[media][media_height]',
2556
  'title' => __('In mobile','post-grid'),
2557
  'details' => __('max-width: 768px, ex: 280px','post-grid'),
2558
+ 'type' => 'select',
2559
+ 'value' => $media_height_small_type,
2560
+ 'default' => 'left',
2561
+ 'args' => array('auto_height'=> __('Auto height', 'post-grid'),'fixed_height'=> __('Fixed height', 'post-grid'),'max_height'=> __('Max height', 'post-grid') ),
2562
+ ),
2563
+ array(
2564
+ 'id' => 'small',
2565
+ 'parent' => $input_name.'[media][media_height]',
2566
+ 'title' => __('Height value','post-grid'),
2567
+ //'details' => __('','post-grid'),
2568
  'type' => 'text',
2569
+ 'value' => $media_height_small,
2570
  'default' => '',
2571
  'placeholder' => '280px',
2572
  ),
2576
 
2577
  $settings_tabs_field->generate_field($args);
2578
 
2579
+
2580
+
2581
  $args = array(
2582
+ 'id' => 'margin',
2583
+ 'css_id' => $element_index.'_margin',
2584
+ 'parent' => $input_name.'[media]',
2585
+ 'title' => __('Margin','post-grid'),
2586
+ 'details' => __('Set margin.','post-grid'),
2587
+ 'type' => 'text',
2588
+ 'value' => $margin,
2589
  'default' => '',
2590
+ 'placeholder' => '5px 0',
2591
  );
2592
 
2593
  $settings_tabs_field->generate_field($args);
2594
 
2595
 
2596
  $args = array(
2597
+ 'id' => 'padding',
2598
  'css_id' => $element_index.'_margin',
2599
+ 'parent' => $input_name.'[media]',
2600
+ 'title' => __('Padding','post-grid'),
2601
+ 'details' => __('Set padding.','post-grid'),
2602
  'type' => 'text',
2603
+ 'value' => $padding,
2604
  'default' => '',
2605
  'placeholder' => '5px 0',
2606
  );
2607
 
2608
  $settings_tabs_field->generate_field($args);
2609
 
2610
+
2611
  $args = array(
2612
  'id' => 'css',
2613
  'css_id' => $element_index.'_css',
2614
+ 'parent' => $input_name.'[media]',
2615
  'title' => __('Custom CSS','post-grid'),
2616
  'details' => __('Set csutom CSS.','post-grid'),
2617
  'type' => 'textarea',
2625
  $args = array(
2626
  'id' => 'css_hover',
2627
  'css_id' => $element_index.'_css_hover',
2628
+ 'parent' => $input_name.'[media]',
2629
  'title' => __('Hover CSS','post-grid'),
2630
  'details' => __('Set hover custom CSS.','post-grid'),
2631
  'type' => 'textarea',
2636
 
2637
  $settings_tabs_field->generate_field($args);
2638
 
 
2639
  ob_start();
2640
  ?>
2641
  <textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}
2665
  }
2666
 
2667
 
 
2668
 
2669
+ add_action('post_grid_layout_element_media', 'post_grid_layout_element_media');
2670
 
2671
+ function post_grid_layout_element_media($args){
2672
+
2673
+ $element = isset($args['element']) ? $args['element'] : array();
2674
+ $elementIndex = isset($args['index']) ? $args['index'] : '';
2675
+ $post_id = isset($args['post_id']) ? $args['post_id'] : '';
2676
+
2677
+ if(empty($post_id)) return;
2678
+
2679
+ $custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
2680
+ $media_source = isset($element['media_source']) ? $element['media_source'] : '';
2681
+
2682
+ $featured_img_size = !empty($element['featured_img_size']) ? $element['featured_img_size'] : 'full';
2683
+ $thumb_linked = !empty($element['thumb_linked']) ? $element['thumb_linked'] : 'yes';
2684
+
2685
+ $post_grid_post_settings = get_post_meta($post_id, 'post_grid_post_settings', true);
2686
+
2687
+
2688
+ ?>
2689
+ <div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> element-media ">
2690
+ <?php
2691
+
2692
+ $html_media = '';
2693
+
2694
+ $is_image = false;
2695
+ foreach($media_source as $source_id => $source_info){
2696
+
2697
+ $args['source_id'] = $source_id;
2698
+ $args['source_args'] = $source_info;
2699
+ $args['post_settings'] = $post_grid_post_settings;
2700
+
2701
+
2702
+ //var_dump($source_id);
2703
+ // var_dump($source_info);
2704
+
2705
+ $is_enable = isset($source_info['enable']) ? $source_info['enable'] : '';
2706
+
2707
+ $media = post_grid_media($post_id, $args);
2708
+
2709
+ if ( $is_image ) continue;
2710
+
2711
+ if($is_enable == 'yes'){
2712
+ if(!empty($media)){
2713
+
2714
+ $html_media = post_grid_media($post_id, $args);
2715
+ $is_image = true;
2716
+ }
2717
+ else{
2718
+ $html_media = '';
2719
+ }
2720
+ }
2721
+ }
2722
+
2723
+ echo $html_media;
2724
+
2725
+ ?>
2726
+
2727
+
2728
+ </div>
2729
+ <?php
2730
+ }
2731
+
2732
+
2733
+ add_action('post_grid_layout_element_css_media', 'post_grid_layout_element_css_media', 10);
2734
+ function post_grid_layout_element_css_media($args){
2735
+
2736
+ //echo '<pre>'.var_export($args, true).'</pre>';
2737
+ $index = isset($args['index']) ? $args['index'] : '';
2738
+ $element = isset($args['element']) ? $args['element'] : array();
2739
+ $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
2740
+
2741
+ $media_height = isset($element['media_height']) ? $element['media_height'] : '';
2742
+ $thumb_height_large = isset($media_height['large']) ? $media_height['large'] : '';
2743
+ $thumb_height_medium = isset($media_height['medium']) ? $media_height['medium'] : '';
2744
+ $thumb_height_small = isset($media_height['small']) ? $media_height['small'] : '';
2745
+
2746
+ $height_large_type = isset($media_height['large_type']) ? $media_height['large_type'] : '';
2747
+ $height_medium_type = isset($media_height['medium_type']) ? $media_height['medium_type'] : '';
2748
+ $height_small_type = isset($media_height['small_type']) ? $media_height['small_type'] : '';
2749
+
2750
+ $padding = isset($element['padding']) ? $element['padding'] : '';
2751
+ $margin = isset($element['margin']) ? $element['margin'] : '';
2752
+ $css = isset($element['css']) ? $element['css'] : '';
2753
+ $css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
2754
+
2755
+ //var_dump($css);
2756
+
2757
+ ?>
2758
+ <style type="text/css">
2759
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
2760
+ <?php if(!empty($margin)): ?>
2761
+ margin: <?php echo $margin; ?>;
2762
+ <?php endif; ?>
2763
+ <?php if(!empty($padding)): ?>
2764
+ padding: <?php echo $padding; ?>;
2765
+ <?php endif; ?>
2766
+ overflow: hidden;
2767
+ <?php if(!empty($css)): ?>
2768
+ <?php echo $css; ?>
2769
+ <?php endif; ?>
2770
+ }
2771
+ <?php if(!empty($css_hover)): ?>
2772
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
2773
+ <?php echo $css_hover; ?>
2774
+ }
2775
+ <?php endif; ?>
2776
+ @media only screen and (min-width: 1024px ){
2777
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
2778
+ <?php if($height_large_type =='auto_height'): ?>
2779
+ height: auto;
2780
+ <?php elseif ($height_large_type =='fixed_height'): ?>
2781
+ <?php if(!empty($thumb_height_large)): ?>
2782
+ height: <?php echo $thumb_height_large; ?>;
2783
+ <?php endif; ?>
2784
+ <?php elseif ($height_large_type =='max_height'): ?>
2785
+ <?php if(!empty($thumb_height_large)): ?>
2786
+ max-height: <?php echo $thumb_height_large; ?>;
2787
+ <?php endif; ?>
2788
+ <?php endif; ?>
2789
+ }
2790
+ }
2791
+ @media only screen and ( min-width: 768px ) and ( max-width: 1023px ) {
2792
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
2793
+ <?php if($height_medium_type =='auto_height'): ?>
2794
+ height: auto;
2795
+ <?php elseif ($height_medium_type =='fixed_height'): ?>
2796
+ <?php if(!empty($thumb_height_medium)): ?>
2797
+ height: <?php echo $thumb_height_medium; ?>;
2798
+ <?php endif; ?>
2799
+ <?php elseif ($height_medium_type =='max_height'): ?>
2800
+ <?php if(!empty($thumb_height_medium)): ?>
2801
+ max-height: <?php echo $thumb_height_medium; ?>;
2802
+ <?php endif; ?>
2803
+ <?php endif; ?>
2804
+ }
2805
+ }
2806
+ @media only screen and ( min-width: 0px ) and ( max-width: 767px ){
2807
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
2808
+ <?php if($height_small_type =='auto_height'): ?>
2809
+ height: auto;
2810
+ <?php elseif ($height_small_type =='fixed_height'): ?>
2811
+ <?php if(!empty($thumb_height_small)): ?>
2812
+ height: <?php echo $thumb_height_small; ?>;
2813
+ <?php endif; ?>
2814
+ <?php elseif ($height_small_type =='max_height'): ?>
2815
+ <?php if(!empty($thumb_height_small)): ?>
2816
+ max-height: <?php echo $thumb_height_small; ?>;
2817
+ <?php endif; ?>
2818
+ <?php endif; ?>
2819
+ }
2820
+ }
2821
+ </style>
2822
+ <?php
2823
+ }
2824
+
2825
+
2826
+
2827
+
2828
+ add_action('post_grid_layout_element_option_thumb','post_grid_layout_element_option_thumb');
2829
+
2830
+
2831
+ function post_grid_layout_element_option_thumb($parameters){
2832
 
2833
  $settings_tabs_field = new settings_tabs_field();
2834
 
2836
  $element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
2837
  $element_index = isset($parameters['index']) ? $parameters['index'] : '';
2838
 
2839
+ $thumb_size = isset($element_data['thumb_size']) ? $element_data['thumb_size'] : '';
2840
+ $default_thumb_src = isset($element_data['default_thumb_src']) ? $element_data['default_thumb_src'] : '';
 
2841
 
2842
+ $thumb_height = isset($element_data['thumb_height']) ? $element_data['thumb_height'] : '';
 
 
2843
  $margin = isset($element_data['margin']) ? $element_data['margin'] : '';
2844
  $link_to = isset($element_data['link_to']) ? $element_data['link_to'] : '';
2845
+ $link_target = isset($element_data['link_target']) ? $element_data['link_target'] : '';
2846
+
2847
+ $thumb_height_large = isset($thumb_height['large']) ? $thumb_height['large'] : '';
2848
+ $thumb_height_medium = isset($thumb_height['medium']) ? $thumb_height['medium'] : '';
2849
+ $thumb_height_small = isset($thumb_height['small']) ? $thumb_height['small'] : '';
2850
+
2851
 
2852
  $css = isset($element_data['css']) ? $element_data['css'] : '';
2853
  $css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
2854
 
2855
+
2856
  ?>
2857
  <div class="item">
2858
  <div class="element-title header ">
2859
  <span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
2860
  <span class="sort"><i class="fas fa-sort"></i></span>
2861
 
2862
+ <span class="expand"><?php echo __('Thumbnail','post-grid'); ?></span>
2863
  </div>
2864
  <div class="element-options options">
2865
 
2866
  <?php
2867
 
2868
+ $thumbnail_sizes = array();
2869
+ $thumbnail_sizes['full'] = __('Full', '');
2870
+ $get_intermediate_image_sizes = get_intermediate_image_sizes();
2871
 
2872
+ if(!empty($get_intermediate_image_sizes))
2873
+ foreach($get_intermediate_image_sizes as $size_key){
2874
+ $size_name = str_replace('_', ' ',$size_key);
2875
+ $size_name = str_replace('-', ' ',$size_name);
2876
 
2877
+ $thumbnail_sizes[$size_key] = ucfirst($size_name);
2878
+ }
2879
+ //echo '<pre>'.var_export($thumbnail_sizes, true).'</pre>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2880
 
2881
  $args = array(
2882
+ 'id' => 'thumb_size',
2883
+ 'parent' => $input_name.'[thumb]',
2884
+ 'title' => __('Thumbnail size','post-grid'),
2885
+ 'details' => __('Choose thumbnail size.','post-grid'),
2886
+ 'type' => 'select',
2887
+ 'value' => $thumb_size,
2888
+ 'default' => 'large',
2889
+ 'args' => $thumbnail_sizes,
 
2890
  );
2891
 
2892
  $settings_tabs_field->generate_field($args);
2893
 
2894
 
2895
 
2896
+
2897
  $args = array(
2898
+ 'id' => 'link_to',
2899
+ 'css_id' => $element_index.'_link_to',
2900
+ 'parent' => $input_name.'[thumb]',
2901
+ 'title' => __('Link to','post-grid'),
2902
+ 'details' => __('Choose option to link title.','post-grid'),
2903
+ 'type' => 'select',
2904
+ 'value' => $link_to,
2905
+ 'default' => 'none',
2906
+ 'args' => array(
2907
+ 'post_link'=> __('Post link', 'post-grid'),
2908
+ 'none'=> __('None', 'post-grid'),
2909
+ ),
2910
  );
2911
 
2912
  $settings_tabs_field->generate_field($args);
2913
 
2914
+
2915
  $args = array(
2916
+ 'id' => 'link_target',
2917
+ 'css_id' => $element_index.'_link_target',
2918
+ 'parent' => $input_name.'[thumb]',
2919
+ 'title' => __('Link target','post-grid'),
2920
+ 'details' => __('Choose option link target.','post-grid'),
2921
+ 'type' => 'select',
2922
+ 'value' => $link_target,
2923
+ 'default' => 'post_link',
2924
+ 'args' => array(
2925
+ '_blank'=> __('_blank', 'post-grid'),
2926
+ '_parent'=> __('_parent', 'post-grid'),
2927
+ '_self'=> __('_self', 'post-grid'),
2928
+ '_top'=> __('_top', 'post-grid'),
2929
+
2930
+ ),
2931
  );
2932
 
2933
  $settings_tabs_field->generate_field($args);
2934
 
2935
 
2936
+
2937
  $args = array(
2938
+ 'id' => 'thumb_height',
2939
+ 'title' => __('Thumbnail height','post-grid'),
2940
+ 'details' => __('Set thumbnail height.','post-grid'),
2941
+ 'type' => 'option_group',
2942
+ 'options' => array(
2943
+ array(
2944
+ 'id' => 'large',
2945
+ 'parent' => $input_name.'[thumb][thumb_height]',
2946
+ 'title' => __('In desktop','post-grid'),
2947
+ 'details' => __('min-width: 1200px, ex: 280px','post-grid'),
2948
+ 'type' => 'text',
2949
+ 'value' => $thumb_height_large,
2950
+ 'default' => '',
2951
+ 'placeholder' => '280px',
2952
+ ),
2953
+ array(
2954
+ 'id' => 'medium',
2955
+ 'parent' => $input_name.'[thumb][thumb_height]',
2956
+ 'title' => __('In tablet & small desktop','post-grid'),
2957
+ 'details' => __('min-width: 992px, ex: 280px','post-grid'),
2958
+ 'type' => 'text',
2959
+ 'value' => $thumb_height_medium,
2960
+ 'default' => '',
2961
+ 'placeholder' => '280px',
2962
+ ),
2963
+ array(
2964
+ 'id' => 'small',
2965
+ 'parent' => $input_name.'[thumb][thumb_height]',
2966
+ 'title' => __('In mobile','post-grid'),
2967
+ 'details' => __('max-width: 768px, ex: 280px','post-grid'),
2968
+ 'type' => 'text',
2969
+ 'value' => $thumb_height_small,
2970
+ 'default' => '',
2971
+ 'placeholder' => '280px',
2972
+ ),
2973
+ ),
2974
+
2975
  );
2976
 
2977
  $settings_tabs_field->generate_field($args);
2978
 
2979
  $args = array(
2980
+ 'id' => 'default_thumb_src',
2981
+ 'parent' => $input_name.'[thumb]',
2982
+ 'title' => __('Default thumbnail','post-grid'),
2983
+ 'details' => __('Choose default thumbnail.','post-grid'),
2984
+ 'type' => 'media_url',
2985
+ 'value' => $default_thumb_src,
2986
+ 'default' => '',
 
 
2987
  );
2988
 
2989
  $settings_tabs_field->generate_field($args);
2992
  $args = array(
2993
  'id' => 'margin',
2994
  'css_id' => $element_index.'_margin',
2995
+ 'parent' => $input_name.'[thumb]',
2996
  'title' => __('Margin','post-grid'),
2997
  'details' => __('Set margin.','post-grid'),
2998
  'type' => 'text',
3003
 
3004
  $settings_tabs_field->generate_field($args);
3005
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3006
  $args = array(
3007
  'id' => 'css',
3008
  'css_id' => $element_index.'_css',
3009
+ 'parent' => $input_name.'[thumb]',
3010
  'title' => __('Custom CSS','post-grid'),
3011
  'details' => __('Set csutom CSS.','post-grid'),
3012
  'type' => 'textarea',
3020
  $args = array(
3021
  'id' => 'css_hover',
3022
  'css_id' => $element_index.'_css_hover',
3023
+ 'parent' => $input_name.'[thumb]',
3024
  'title' => __('Hover CSS','post-grid'),
3025
  'details' => __('Set hover custom CSS.','post-grid'),
3026
  'type' => 'textarea',
3062
 
3063
 
3064
 
3065
+ add_action('post_grid_layout_element_thumb', 'post_grid_layout_element_thumb');
3066
 
3067
+ function post_grid_layout_element_thumb($args){
3068
+
3069
+ $element = isset($args['element']) ? $args['element'] : array();
3070
+ $elementIndex = isset($args['index']) ? $args['index'] : '';
3071
+ $post_id = isset($args['post_id']) ? $args['post_id'] : '';
3072
+
3073
+ if(empty($post_id)) return;
3074
+
3075
+ $custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
3076
+ $default_thumb_src = isset($element['default_thumb_src']) ? $element['default_thumb_src'] : '';
3077
+ $thumb_size = isset($element['thumb_size']) ? $element['thumb_size'] : 'large';
3078
+
3079
+ $link_target = isset($element['link_target']) ? $element['link_target'] : '';
3080
+ $link_to = isset($element['link_to']) ? $element['link_to'] : 'post_link';
3081
+
3082
+
3083
+ $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post_id), $thumb_size );
3084
+ $thumb_url = !empty($thumb['0']) ? $thumb['0'] : $default_thumb_src;
3085
+
3086
+ if(empty($thumb_url)) return;
3087
+
3088
+
3089
+ $post_link = get_permalink($post_id);
3090
+
3091
+
3092
+
3093
+ ?>
3094
+ <div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> thumb ">
3095
+ <?php
3096
+ if($link_to == 'post_link'):
3097
+ ?>
3098
+ <a target="<?php echo esc_attr($link_target); ?>" href="<?php echo esc_url_raw($post_link); ?>"><img src="<?php echo esc_url_raw($thumb_url); ?>"></a>
3099
+ <?php
3100
+ else:
3101
+ ?>
3102
+ <img src="<?php echo esc_url_raw($thumb_url); ?>">
3103
+ <?php
3104
+
3105
+ endif;
3106
+ ?>
3107
+
3108
+
3109
+ </div>
3110
+ <?php
3111
+ }
3112
+
3113
+
3114
+
3115
+
3116
+
3117
+
3118
+ add_action('post_grid_layout_element_css_thumb', 'post_grid_layout_element_css_thumb', 10);
3119
+ function post_grid_layout_element_css_thumb($args){
3120
+
3121
+ //echo '<pre>'.var_export($args, true).'</pre>';
3122
+ $index = isset($args['index']) ? $args['index'] : '';
3123
+ $element = isset($args['element']) ? $args['element'] : array();
3124
+ $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
3125
+
3126
+ $thumb_height = isset($element['thumb_height']) ? $element['thumb_height'] : '';
3127
+ $thumb_height_large = isset($thumb_height['large']) ? $thumb_height['large'] : '';
3128
+ $thumb_height_medium = isset($thumb_height['medium']) ? $thumb_height['medium'] : '';
3129
+ $thumb_height_small = isset($thumb_height['small']) ? $thumb_height['small'] : '';
3130
+
3131
+ $margin = isset($element['margin']) ? $element['margin'] : '';
3132
+ $css = isset($element['css']) ? $element['css'] : '';
3133
+ $css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
3134
+
3135
+ ?>
3136
+ <style type="text/css">
3137
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
3138
+ overflow: hidden;
3139
+ <?php if(!empty($margin)): ?>
3140
+ margin: <?php echo $margin; ?>;
3141
+ <?php endif; ?>
3142
+ }
3143
+ @media only screen and (min-width: 1024px ){
3144
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
3145
+ <?php if(!empty($thumb_height_large)): ?>
3146
+ max-height: <?php echo $thumb_height_large; ?>;
3147
+ <?php endif; ?>
3148
+ }
3149
+ }
3150
+ @media only screen and ( min-width: 768px ) and ( max-width: 1023px ) {
3151
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
3152
+ <?php if(!empty($thumb_height_medium)): ?>
3153
+ max-height: <?php echo $thumb_height_medium; ?>;
3154
+ <?php endif; ?>
3155
+ }
3156
+ }
3157
+ @media only screen and ( min-width: 0px ) and ( max-width: 767px ){
3158
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
3159
+ <?php if(!empty($thumb_height_small)): ?>
3160
+ max-height: <?php echo $thumb_height_small; ?>;
3161
+ <?php endif; ?>
3162
+ }
3163
+ }
3164
+ </style>
3165
+ <?php
3166
+ }
3167
+
3168
+
3169
+ add_action('post_grid_layout_element_option_thumb_link','post_grid_layout_element_option_thumb_link');
3170
+
3171
+
3172
+ function post_grid_layout_element_option_thumb_link($parameters){
3173
 
3174
  $settings_tabs_field = new settings_tabs_field();
3175
 
3177
  $element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
3178
  $element_index = isset($parameters['index']) ? $parameters['index'] : '';
3179
 
3180
+ $thumb_size = isset($element_data['thumb_size']) ? $element_data['thumb_size'] : '';
3181
+ $default_thumb_src = isset($element_data['default_thumb_src']) ? $element_data['default_thumb_src'] : '';
3182
+ $link_target = isset($element_data['link_target']) ? $element_data['link_target'] : '';
 
 
3183
 
3184
+ $thumb_height = isset($element_data['thumb_height']) ? $element_data['thumb_height'] : '';
3185
+ $margin = isset($element_data['margin']) ? $element_data['margin'] : '';
3186
+ $link_to = isset($element_data['link_to']) ? $element_data['link_to'] : '';
3187
 
3188
+ $thumb_height_large = isset($thumb_height['large']) ? $thumb_height['large'] : '';
3189
+ $thumb_height_medium = isset($thumb_height['medium']) ? $thumb_height['medium'] : '';
3190
+ $thumb_height_small = isset($thumb_height['small']) ? $thumb_height['small'] : '';
3191
 
3192
  $css = isset($element_data['css']) ? $element_data['css'] : '';
3193
  $css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
3194
 
3195
 
3196
+
3197
  ?>
3198
  <div class="item">
3199
  <div class="element-title header ">
3200
  <span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
3201
  <span class="sort"><i class="fas fa-sort"></i></span>
3202
 
3203
+ <span class="expand"><?php echo __('Thumbnail with link','post-grid'); ?></span>
3204
  </div>
3205
  <div class="element-options options">
3206
 
3207
  <?php
3208
 
3209
+ $thumbnail_sizes = array();
3210
+ $thumbnail_sizes['full'] = __('Full', '');
3211
+ $get_intermediate_image_sizes = get_intermediate_image_sizes();
 
 
 
 
 
 
 
 
 
 
 
3212
 
3213
+ if(!empty($get_intermediate_image_sizes))
3214
+ foreach($get_intermediate_image_sizes as $size_key){
3215
+ $size_name = str_replace('_', ' ',$size_key);
3216
+ $size_name = str_replace('-', ' ',$size_name);
3217
 
3218
+ $thumbnail_sizes[$size_key] = ucfirst($size_name);
3219
+ }
3220
+ //echo '<pre>'.var_export($thumbnail_sizes, true).'</pre>';
3221
 
3222
  $args = array(
3223
+ 'id' => 'thumb_size',
3224
+ 'parent' => $input_name.'[thumb_link]',
3225
+ 'title' => __('Thumbnail size','post-grid'),
3226
+ 'details' => __('Choose thumbnail size.','post-grid'),
3227
+ 'type' => 'select',
3228
+ 'value' => $thumb_size,
3229
+ 'default' => 'large',
3230
+ 'args' => $thumbnail_sizes,
 
3231
  );
3232
 
3233
  $settings_tabs_field->generate_field($args);
3234
 
3235
+
3236
+
3237
  $args = array(
3238
+ 'id' => 'link_to',
3239
+ 'css_id' => $element_index.'_link_to',
3240
+ 'parent' => $input_name.'[thumb_link]',
3241
+ 'title' => __('Link to','post-grid'),
3242
+ 'details' => __('Choose option to link title.','post-grid'),
3243
+ 'type' => 'select',
3244
+ 'value' => $link_to,
3245
+ 'default' => 'none',
3246
+ 'args' => array(
3247
+ 'post_link'=> __('Post link', 'post-grid'),
3248
+ //'meta_value'=> __('Meta value', 'post-grid'),
3249
+ 'none'=> __('None', 'post-grid'),
3250
+ ),
3251
  );
3252
 
3253
  $settings_tabs_field->generate_field($args);
3254
+
3255
+
3256
  $args = array(
3257
  'id' => 'link_target',
3258
  'css_id' => $element_index.'_link_target',
3259
+ 'parent' => $input_name.'[thumb_link]',
3260
  'title' => __('Link target','post-grid'),
3261
  'details' => __('Choose option link target.','post-grid'),
3262
  'type' => 'select',
3275
 
3276
 
3277
 
 
 
 
3278
  $args = array(
3279
+ 'id' => 'thumb_height',
3280
+ 'title' => __('Thumbnail height','post-grid'),
3281
+ 'details' => __('Set thumbnail height.','post-grid'),
3282
+ 'type' => 'option_group',
3283
+ 'options' => array(
3284
+ array(
3285
+ 'id' => 'large',
3286
+ 'parent' => $input_name.'[thumb_link][thumb_height]',
3287
+ 'title' => __('In desktop','post-grid'),
3288
+ 'details' => __('min-width: 1200px, ex: 280px','post-grid'),
3289
+ 'type' => 'text',
3290
+ 'value' => $thumb_height_large,
3291
+ 'default' => '',
3292
+ 'placeholder' => '280px',
3293
+ ),
3294
+ array(
3295
+ 'id' => 'medium',
3296
+ 'parent' => $input_name.'[thumb_link][thumb_height]',
3297
+ 'title' => __('In tablet & small desktop','post-grid'),
3298
+ 'details' => __('min-width: 992px, ex: 280px','post-grid'),
3299
+ 'type' => 'text',
3300
+ 'value' => $thumb_height_medium,
3301
+ 'default' => '',
3302
+ 'placeholder' => '280px',
3303
+ ),
3304
+ array(
3305
+ 'id' => 'small',
3306
+ 'parent' => $input_name.'[thumb_link][thumb_height]',
3307
+ 'title' => __('In mobile','post-grid'),
3308
+ 'details' => __('max-width: 768px, ex: 280px','post-grid'),
3309
+ 'type' => 'text',
3310
+ 'value' => $thumb_height_small,
3311
+ 'default' => '',
3312
+ 'placeholder' => '280px',
3313
+ ),
3314
+ ),
3315
 
 
 
 
 
 
 
 
 
 
3316
  );
3317
 
3318
  $settings_tabs_field->generate_field($args);
3319
 
 
3320
  $args = array(
3321
+ 'id' => 'default_thumb_src',
3322
+ 'parent' => $input_name.'[thumb_link]',
3323
+ 'title' => __('Default thumbnail','post-grid'),
3324
+ 'details' => __('Choose default thumbnail.','post-grid'),
3325
+ 'type' => 'media_url',
3326
+ 'value' => $default_thumb_src,
3327
+ 'default' => '',
 
 
3328
  );
3329
 
3330
  $settings_tabs_field->generate_field($args);
3331
 
3332
 
3333
  $args = array(
3334
+ 'id' => 'margin',
3335
+ 'css_id' => $element_index.'_margin',
3336
+ 'parent' => $input_name.'[thumb_link]',
3337
+ 'title' => __('Margin','post-grid'),
3338
+ 'details' => __('Set margin.','post-grid'),
3339
  'type' => 'text',
3340
+ 'value' => $margin,
3341
+ 'default' => '',
3342
+ 'placeholder' => '5px 0',
3343
  );
3344
 
3345
  $settings_tabs_field->generate_field($args);
3346
 
 
3347
  $args = array(
3348
  'id' => 'css',
3349
  'css_id' => $element_index.'_css',
3350
+ 'parent' => $input_name.'[thumb_link]',
3351
  'title' => __('Custom CSS','post-grid'),
3352
  'details' => __('Set csutom CSS.','post-grid'),
3353
  'type' => 'textarea',
3361
  $args = array(
3362
  'id' => 'css_hover',
3363
  'css_id' => $element_index.'_css_hover',
3364
+ 'parent' => $input_name.'[thumb_link]',
3365
  'title' => __('Hover CSS','post-grid'),
3366
  'details' => __('Set hover custom CSS.','post-grid'),
3367
  'type' => 'textarea',
3372
 
3373
  $settings_tabs_field->generate_field($args);
3374
 
3375
+
3376
  ob_start();
3377
  ?>
3378
  <textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}
3392
 
3393
  $settings_tabs_field->generate_field($args);
3394
 
3395
+
3396
  ?>
3397
 
3398
  </div>
3402
  }
3403
 
3404
 
3405
+ add_action('post_grid_layout_element_thumb_link', 'post_grid_layout_element_thumb_link');
3406
+
3407
+ function post_grid_layout_element_thumb_link($args){
3408
+
3409
+ $element = isset($args['element']) ? $args['element'] : array();
3410
+ $elementIndex = isset($args['index']) ? $args['index'] : '';
3411
+ $post_id = isset($args['post_id']) ? $args['post_id'] : '';
3412
+
3413
+ if(empty($post_id)) return;
3414
+
3415
+ $custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
3416
+ $default_thumb_src = isset($element['default_thumb_src']) ? $element['default_thumb_src'] : '';
3417
+ $thumb_size = isset($element['thumb_size']) ? $element['thumb_size'] : 'large';
3418
+
3419
+ $link_target = isset($element['link_target']) ? $element['link_target'] : '';
3420
+ $link_to = isset($element['link_to']) ? $element['link_to'] : 'post_link';
3421
+
3422
+
3423
+ $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post_id), $thumb_size );
3424
+ $thumb_url = !empty($thumb['0']) ? $thumb['0'] : $default_thumb_src;
3425
+
3426
+ if(empty($thumb_url)) return;
3427
+
3428
+
3429
+ $post_link = get_permalink($post_id);
3430
+
3431
+
3432
+
3433
+ ?>
3434
+ <div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> thumb_link ">
3435
+ <?php
3436
+ if($link_to == 'post_link'):
3437
+ ?>
3438
+ <a target="<?php echo esc_attr($link_target); ?>" href="<?php echo esc_url_raw($post_link); ?>"><img src="<?php echo esc_url_raw($thumb_url); ?>"></a>
3439
+ <?php
3440
+ else:
3441
+ ?>
3442
+ <img src="<?php echo esc_url_raw($thumb_url); ?>">
3443
+ <?php
3444
+
3445
+ endif;
3446
+ ?>
3447
+
3448
+
3449
+ </div>
3450
+ <?php
3451
+ }
3452
+
3453
+
3454
+ add_action('post_grid_layout_element_css_thumb_link', 'post_grid_layout_element_css_thumb_link', 10);
3455
+ function post_grid_layout_element_css_thumb_link($args){
3456
+
3457
+ //echo '<pre>'.var_export($args, true).'</pre>';
3458
+ $index = isset($args['index']) ? $args['index'] : '';
3459
+ $element = isset($args['element']) ? $args['element'] : array();
3460
+ $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
3461
+
3462
+ $thumb_height = isset($element['thumb_height']) ? $element['thumb_height'] : '';
3463
+ $thumb_height_large = isset($thumb_height['large']) ? $thumb_height['large'] : '';
3464
+ $thumb_height_medium = isset($thumb_height['medium']) ? $thumb_height['medium'] : '';
3465
+ $thumb_height_small = isset($thumb_height['small']) ? $thumb_height['small'] : '';
3466
+
3467
+ $margin = isset($element['margin']) ? $element['margin'] : '';
3468
+ $css = isset($element['css']) ? $element['css'] : '';
3469
+ $css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
3470
+
3471
+ ?>
3472
+ <style type="text/css">
3473
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
3474
+ overflow: hidden;
3475
+ <?php if(!empty($margin)): ?>
3476
+ margin: <?php echo $margin; ?>;
3477
+ <?php endif; ?>
3478
+ }
3479
+ @media only screen and (min-width: 1024px ){
3480
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
3481
+ <?php if(!empty($thumb_height_large)): ?>
3482
+ max-height: <?php echo $thumb_height_large; ?>;
3483
+ <?php endif; ?>
3484
+ }
3485
+ }
3486
+ @media only screen and ( min-width: 768px ) and ( max-width: 1023px ) {
3487
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
3488
+ <?php if(!empty($thumb_height_medium)): ?>
3489
+ max-height: <?php echo $thumb_height_medium; ?>;
3490
+ <?php endif; ?>
3491
+ }
3492
+ }
3493
+ @media only screen and ( min-width: 0px ) and ( max-width: 767px ){
3494
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
3495
+ <?php if(!empty($thumb_height_small)): ?>
3496
+ max-height: <?php echo $thumb_height_small; ?>;
3497
+ <?php endif; ?>
3498
+ }
3499
+ }
3500
+ </style>
3501
+ <?php
3502
+ }
3503
+
3504
 
3505
 
3506
 
 
3507
 
3508
 
3509
+
3510
+
3511
+
3512
+
3513
+
3514
+ add_action('post_grid_layout_element_option_post_date','post_grid_layout_element_option_post_date');
3515
+ function post_grid_layout_element_option_post_date($parameters){
3516
 
3517
  $settings_tabs_field = new settings_tabs_field();
3518
 
3520
  $element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
3521
  $element_index = isset($parameters['index']) ? $parameters['index'] : '';
3522
 
3523
+ $date_format = isset($element_data['date_format']) ? $element_data['date_format'] : '';
3524
+ $wrapper_html = isset($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '';
3525
+
3526
+ $link_to = isset($element_data['link_to']) ? $element_data['link_to'] : '';
3527
+
3528
+ $color = isset($element_data['color']) ? $element_data['color'] : '';
3529
  $margin = isset($element_data['margin']) ? $element_data['margin'] : '';
3530
+ $text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
3531
 
3532
+ $font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
3533
+ $font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
3534
 
3535
  $css = isset($element_data['css']) ? $element_data['css'] : '';
3536
  $css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
3537
 
 
3538
  ?>
3539
+ <div class="item">
3540
  <div class="element-title header ">
3541
  <span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
3542
  <span class="sort"><i class="fas fa-sort"></i></span>
3543
 
3544
+ <span class="expand"><?php echo __('Post date','post-grid'); ?></span>
 
 
 
3545
  </div>
3546
  <div class="element-options options">
3547
 
3548
+ <?php
3549
+
3550
+ $args = array(
3551
+ 'id' => 'date_format',
3552
+ 'css_id' => $element_index.'_background_colorpost_date',
3553
+ 'parent' => $input_name.'[post_date]',
3554
+ 'title' => __('Date format','post-grid'),
3555
+ 'details' => __('Choose date format.','post-grid'),
3556
+ 'type' => 'text',
3557
+ 'value' => $date_format,
3558
+ 'default' => '',
3559
+ 'placeholder' => 'd-m-Y',
3560
+
3561
+ );
3562
+
3563
+ $settings_tabs_field->generate_field($args);
3564
+
3565
+
3566
+ $args = array(
3567
+ 'id' => 'wrapper_html',
3568
+ 'css_id' => $element_index.'_wrapper_html',
3569
+ 'parent' => $input_name.'[post_date]',
3570
+ 'title' => __('Wrapper html','post-grid'),
3571
+ 'details' => __('Write wrapper html, use <code>%s</code> to replace date output.','post-grid'),
3572
+ 'type' => 'text',
3573
+ 'value' => $wrapper_html,
3574
+ 'default' => '',
3575
+ 'placeholder' => 'Date: %s',
3576
+ );
3577
+
3578
+ $settings_tabs_field->generate_field($args);
3579
+
3580
+
3581
+ $args = array(
3582
+ 'id' => 'link_to',
3583
+ 'css_id' => $element_index.'_link_to',
3584
+ 'parent' => $input_name.'[post_date]',
3585
+ 'title' => __('Link to','post-grid'),
3586
+ 'details' => __('Choose option to link title.','post-grid'),
3587
+ 'type' => 'select',
3588
+ 'value' => $link_to,
3589
+ 'default' => 'none',
3590
+ 'args' => array(
3591
+ 'post_link'=> __('Post link', 'post-grid'),
3592
+ 'none'=> __('None', 'post-grid'),
3593
+ ),
3594
+ );
3595
+
3596
+ $settings_tabs_field->generate_field($args);
3597
+
3598
+ $args = array(
3599
+ 'id' => 'color',
3600
+ 'css_id' => $element_index.'_custom_text',
3601
+ 'parent' => $input_name.'[post_date]',
3602
+ 'title' => __('Color','post-grid'),
3603
+ 'details' => __('Title text color.','post-grid'),
3604
+ 'type' => 'colorpicker',
3605
+ 'value' => $color,
3606
+ 'default' => '',
3607
+ );
3608
+
3609
+ $settings_tabs_field->generate_field($args);
3610
 
3611
  $args = array(
3612
+ 'id' => 'font_size',
3613
+ 'css_id' => $element_index.'_font_size',
3614
+ 'parent' => $input_name.'[post_date]',
3615
+ 'title' => __('Font size','post-grid'),
3616
+ 'details' => __('Set font size.','post-grid'),
3617
  'type' => 'text',
3618
+ 'value' => $font_size,
3619
  'default' => '',
3620
+ 'placeholder' => '14px',
3621
  );
3622
 
3623
  $settings_tabs_field->generate_field($args);
3624
 
3625
 
3626
  $args = array(
3627
+ 'id' => 'font_family',
3628
+ 'css_id' => $element_index.'_font_family',
3629
+ 'parent' => $input_name.'[post_date]',
3630
+ 'title' => __('Font family','post-grid'),
3631
+ 'details' => __('Set font family.','post-grid'),
3632
  'type' => 'text',
3633
+ 'value' => $font_family,
3634
  'default' => '',
3635
+ 'placeholder' => 'Open Sans',
3636
  );
3637
 
3638
  $settings_tabs_field->generate_field($args);
3639
 
3640
 
 
3641
  $args = array(
3642
  'id' => 'margin',
3643
  'css_id' => $element_index.'_margin',
3644
+ 'parent' => $input_name.'[post_date]',
3645
  'title' => __('Margin','post-grid'),
3646
  'details' => __('Set margin.','post-grid'),
3647
  'type' => 'text',
3652
 
3653
  $settings_tabs_field->generate_field($args);
3654
 
3655
+
3656
+ $args = array(
3657
+ 'id' => 'text_align',
3658
+ 'css_id' => $element_index.'_text_align',
3659
+ 'parent' => $input_name.'[post_date]',
3660
+ 'title' => __('Text align','post-grid'),
3661
+ 'details' => __('Choose text align.','post-grid'),
3662
+ 'type' => 'select',
3663
+ 'value' => $text_align,
3664
+ 'default' => 'left',
3665
+ 'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
3666
+ );
3667
+
3668
+ $settings_tabs_field->generate_field($args);
3669
+
3670
  $args = array(
3671
  'id' => 'css',
3672
  'css_id' => $element_index.'_css',
3673
+ 'parent' => $input_name.'[post_date]',
3674
  'title' => __('Custom CSS','post-grid'),
3675
  'details' => __('Set csutom CSS.','post-grid'),
3676
  'type' => 'textarea',
3684
  $args = array(
3685
  'id' => 'css_hover',
3686
  'css_id' => $element_index.'_css_hover',
3687
+ 'parent' => $input_name.'[post_date]',
3688
  'title' => __('Hover CSS','post-grid'),
3689
  'details' => __('Set hover custom CSS.','post-grid'),
3690
  'type' => 'textarea',
3697
 
3698
  ob_start();
3699
  ?>
3700
+ <textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}
3701
+ .element_<?php echo $element_index?> a{}</textarea>
3702
  <?php
3703
 
3704
  $html = ob_get_clean();
3719
  </div>
3720
  </div>
3721
  <?php
 
3722
  }
3723
 
3724
 
3725
 
3726
+ add_action('post_grid_layout_element_post_date', 'post_grid_layout_element_post_date');
3727
 
3728
+ function post_grid_layout_element_post_date($args){
 
3729
 
3730
+ $element = isset($args['element']) ? $args['element'] : array();
3731
+ $elementIndex = isset($args['index']) ? $args['index'] : '';
3732
+ $post_id = isset($args['post_id']) ? $args['post_id'] : '';
3733
 
3734
+ if(empty($post_id)) return;
3735
 
3736
+ $custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
3737
+ $link_to = isset($element['link_to']) ? $element['link_to'] : '';
3738
+ $link_target = isset($element['link_target']) ? $element['link_target'] : '';
3739
+ $date_format = isset($element['date_format']) ? $element['date_format'] : 'd-m-Y';
3740
+ $wrapper_html = !empty($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
3741
 
 
3742
 
3743
+ $post_link = get_permalink($post_id);
3744
+ $post_date = get_the_date($date_format, $post_id);
 
 
 
3745
 
3746
+ $post_date = sprintf($wrapper_html,$post_date);
 
 
 
3747
 
3748
+ ?>
3749
+ <div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> post_date ">
3750
+ <?php
3751
+ if($link_to == 'post_link'):
3752
+ ?>
3753
+ <a target="<?php echo esc_attr($link_target); ?>" href="<?php echo esc_url_raw($post_link); ?>"><?php echo esc_html($post_date); ?></a>
3754
  <?php
3755
+ else:
3756
+ ?>
3757
+ <?php echo esc_html($post_date); ?>
3758
+ <?php
3759
+ endif;
3760
+ ?>
3761
 
3762
+ </div>
3763
+ <?php
3764
+ }
 
 
 
 
 
 
 
 
 
 
 
3765
 
3766
 
3767
+ add_action('post_grid_layout_element_css_post_date', 'post_grid_layout_element_css_post_date', 10);
3768
+ function post_grid_layout_element_css_post_date($args){
3769
 
3770
 
3771
+ $index = isset($args['index']) ? $args['index'] : '';
3772
+ $element = isset($args['element']) ? $args['element'] : array();
3773
+ $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
3774
 
3775
+ $color = isset($element['color']) ? $element['color'] : '';
3776
+ $font_size = isset($element['font_size']) ? $element['font_size'] : '';
3777
+ $font_family = isset($element['font_family']) ? $element['font_family'] : '';
3778
+ $margin = isset($element['margin']) ? $element['margin'] : '';
3779
+ $text_align = isset($element['text_align']) ? $element['text_align'] : '';
3780
+ $css = isset($element['css']) ? $element['css'] : '';
3781
+ $css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
3782
+ ?>
3783
+ <style type="text/css">
3784
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
3785
+ <?php if(!empty($color)): ?>
3786
+ color: <?php echo $color; ?>;
3787
+ <?php endif; ?>
3788
+ <?php if(!empty($font_size)): ?>
3789
+ font-size: <?php echo $font_size; ?>;
3790
+ <?php endif; ?>
3791
+ <?php if(!empty($font_family)): ?>
3792
+ font-family: <?php echo $font_family; ?>;
3793
+ <?php endif; ?>
3794
+ <?php if(!empty($margin)): ?>
3795
+ margin: <?php echo $margin; ?>;
3796
+ <?php endif; ?>
3797
+ <?php if(!empty($text_align)): ?>
3798
+ text-align: <?php echo $text_align; ?>;
3799
+ <?php endif; ?>
3800
+ <?php if(!empty($css)): ?>
3801
+ <?php echo $css; ?>
3802
+ <?php endif; ?>
3803
+ }
3804
+ <?php if(!empty($css_hover)): ?>
3805
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
3806
+ <?php echo $css_hover; ?>
3807
+ }
3808
+ <?php endif; ?>
3809
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?> a{
3810
+ <?php if(!empty($color)): ?>
3811
+ color: <?php echo $color; ?>;
3812
+ <?php endif; ?>
3813
+ <?php if(!empty($font_size)): ?>
3814
+ font-size: <?php echo $font_size; ?>;
3815
+ <?php endif; ?>
3816
+ <?php if(!empty($font_family)): ?>
3817
+ font-family: <?php echo $font_family; ?>;
3818
+ <?php endif; ?>
3819
+ }
3820
+ </style>
3821
  <?php
 
3822
  }
3823
 
3824
 
3825
 
3826
 
3827
 
3828
+
3829
+ add_action('post_grid_layout_element_option_author','post_grid_layout_element_option_author');
3830
+ function post_grid_layout_element_option_author($parameters){
3831
 
3832
  $settings_tabs_field = new settings_tabs_field();
3833
 
3835
  $element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
3836
  $element_index = isset($parameters['index']) ? $parameters['index'] : '';
3837
 
 
 
 
3838
  $wrapper_html = isset($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '';
3839
+ $link_to = isset($element_data['link_to']) ? $element_data['link_to'] : '';
 
 
3840
 
3841
+ $font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
3842
+ $color = isset($element_data['color']) ? $element_data['color'] : '';
3843
+ $margin = isset($element_data['margin']) ? $element_data['margin'] : '';
3844
  $text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
3845
 
3846
  $css = isset($element_data['css']) ? $element_data['css'] : '';
3847
  $css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
3848
 
 
3849
  ?>
3850
  <div class="item">
3851
  <div class="element-title header ">
3852
  <span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
3853
  <span class="sort"><i class="fas fa-sort"></i></span>
3854
 
3855
+ <span class="expand"><?php echo __('Author name','post-grid'); ?></span>
3856
  </div>
3857
  <div class="element-options options">
3858
 
3859
  <?php
3860
 
 
 
 
 
 
 
 
 
 
 
 
 
3861
 
3862
  $args = array(
3863
+ 'id' => 'link_to',
3864
+ 'css_id' => $element_index.'_link_to',
3865
+ 'parent' => $input_name.'[author]',
3866
+ 'title' => __('Link to','post-grid'),
3867
+ 'details' => __('Choose option to link title.','post-grid'),
3868
+ 'type' => 'select',
3869
+ 'value' => $link_to,
3870
+ 'default' => 'none',
3871
+ 'args' => array(
3872
+ 'post_link'=> __('Post link', 'post-grid'),
3873
+ 'author_posts_link'=> __('Author posts link', 'post-grid'),
3874
+ 'none'=> __('None', 'post-grid'),
3875
+ ),
3876
  );
3877
 
3878
  $settings_tabs_field->generate_field($args);
3880
  $args = array(
3881
  'id' => 'wrapper_html',
3882
  'css_id' => $element_index.'_wrapper_html',
3883
+ 'parent' => $input_name.'[author]',
3884
  'title' => __('Wrapper html','post-grid'),
3885
+ 'details' => __('Write wrapper html.','post-grid'),
3886
  'type' => 'text',
3887
  'value' => $wrapper_html,
3888
  'default' => '',
3889
+ 'placeholder' => 'Author: %s',
3890
  );
3891
 
3892
  $settings_tabs_field->generate_field($args);
3893
 
3894
+
3895
+
3896
  $args = array(
3897
+ 'id' => 'color',
3898
+ 'css_id' => $element_index.'_color',
3899
+ 'parent' => $input_name.'[author]',
3900
+ 'title' => __('Text color','post-grid'),
3901
+ 'details' => __('Choose text color.','post-grid'),
3902
+ 'type' => 'colorpicker',
3903
+ 'value' => $color,
3904
  'default' => '',
 
3905
  );
3906
 
3907
  $settings_tabs_field->generate_field($args);
3908
 
3909
 
3910
+
3911
  $args = array(
3912
  'id' => 'font_size',
3913
  'css_id' => $element_index.'_font_size',
3914
+ 'parent' => $input_name.'[author]',
3915
  'title' => __('Font size','post-grid'),
3916
+ 'details' => __('Choose text font size.','post-grid'),
3917
  'type' => 'text',
3918
  'value' => $font_size,
3919
  'default' => '',
3920
  'placeholder' => '16px',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3921
  );
3922
 
3923
  $settings_tabs_field->generate_field($args);
3924
 
3925
  $args = array(
3926
+ 'id' => 'margin',
3927
+ 'css_id' => $element_index.'_padding',
3928
+ 'parent' => $input_name.'[author]',
3929
+ 'title' => __('Margin','post-grid'),
3930
+ 'details' => __('Choose padding.','post-grid'),
3931
+ 'type' => 'text',
3932
+ 'value' => $margin,
3933
  'default' => '',
3934
+ 'placeholder' => '5px 10px',
3935
  );
3936
 
3937
  $settings_tabs_field->generate_field($args);
3938
 
 
3939
  $args = array(
3940
  'id' => 'text_align',
3941
  'css_id' => $element_index.'_text_align',
3942
+ 'parent' => $input_name.'[author]',
3943
  'title' => __('Text align','post-grid'),
3944
  'details' => __('Choose text align.','post-grid'),
3945
  'type' => 'select',
3953
  $args = array(
3954
  'id' => 'css',
3955
  'css_id' => $element_index.'_css',
3956
+ 'parent' => $input_name.'[author]',
3957
  'title' => __('Custom CSS','post-grid'),
3958
  'details' => __('Set csutom CSS.','post-grid'),
3959
  'type' => 'textarea',
3967
  $args = array(
3968
  'id' => 'css_hover',
3969
  'css_id' => $element_index.'_css_hover',
3970
+ 'parent' => $input_name.'[author]',
3971
  'title' => __('Hover CSS','post-grid'),
3972
  'details' => __('Set hover custom CSS.','post-grid'),
3973
  'type' => 'textarea',
4002
  </div>
4003
  </div>
4004
  <?php
4005
+
4006
+ }
4007
+
4008
+
4009
+
4010
+ add_action('post_grid_layout_element_author', 'post_grid_layout_element_author');
4011
+
4012
+ function post_grid_layout_element_author($args){
4013
+
4014
+ $element = isset($args['element']) ? $args['element'] : array();
4015
+ $elementIndex = isset($args['index']) ? $args['index'] : '';
4016
+ $post_id = isset($args['post_id']) ? $args['post_id'] : '';
4017
+
4018
+ if(empty($post_id)) return;
4019
+
4020
+ $custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
4021
+ $link_to = isset($element['link_to']) ? $element['link_to'] : '';
4022
+ $link_target = isset($element['link_target']) ? $element['link_target'] : '';
4023
+ $wrapper_html = !empty($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
4024
+
4025
+ $post_link = get_permalink($post_id);
4026
+
4027
+ $post = get_post($post_id);
4028
+ $post_author = isset($post->post_author) ? $post->post_author : '';
4029
+ $post_author_data = get_user_by('ID', $post_author);
4030
+
4031
+ $post_author = isset($post_author_data->display_name) ? $post_author_data->display_name : '';
4032
+
4033
+ $post_author = sprintf($wrapper_html, $post_author);
4034
+
4035
+ ?>
4036
+ <div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> author ">
4037
+ <?php
4038
+ if($link_to == 'post_link'):
4039
+ ?>
4040
+ <a target="<?php echo esc_attr($link_target); ?>" href="<?php echo esc_url_raw($post_link); ?>"><?php echo esc_html($post_author); ?></a>
4041
+ <?php
4042
+ elseif($link_to == 'author_posts_link'):
4043
+ $post_author_link = get_author_posts_url( get_the_author_meta( 'ID' ) ) ;
4044
+
4045
+ ?>
4046
+ <a target="<?php echo esc_attr($link_target); ?>" href="<?php echo esc_url_raw($post_author_link); ?>"><?php echo esc_html($post_author); ?></a>
4047
+ <?php
4048
+
4049
+ else:
4050
+ ?>
4051
+ <?php echo esc_html($post_author); ?>
4052
+ <?php
4053
+ endif;
4054
+ ?>
4055
+
4056
+ </div>
4057
+ <?php
4058
+ }
4059
+
4060
+
4061
+
4062
+ add_action('post_grid_layout_element_css_author', 'post_grid_layout_element_css_author', 10);
4063
+ function post_grid_layout_element_css_author($args){
4064
+
4065
+
4066
+ $index = isset($args['index']) ? $args['index'] : '';
4067
+ $element = isset($args['element']) ? $args['element'] : array();
4068
+ $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
4069
+
4070
+ $color = isset($element['color']) ? $element['color'] : '';
4071
+ $font_size = isset($element['font_size']) ? $element['font_size'] : '';
4072
+ $font_family = isset($element['font_family']) ? $element['font_family'] : '';
4073
+ $margin = isset($element['margin']) ? $element['margin'] : '';
4074
+ $text_align = isset($element['text_align']) ? $element['text_align'] : '';
4075
+ $css = isset($element['css']) ? $element['css'] : '';
4076
+ $css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
4077
+ ?>
4078
+ <style type="text/css">
4079
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
4080
+ <?php if(!empty($color)): ?>
4081
+ color: <?php echo $color; ?>;
4082
+ <?php endif; ?>
4083
+ <?php if(!empty($font_size)): ?>
4084
+ font-size: <?php echo $font_size; ?>;
4085
+ <?php endif; ?>
4086
+ <?php if(!empty($font_family)): ?>
4087
+ font-family: <?php echo $font_family; ?>;
4088
+ <?php endif; ?>
4089
+ <?php if(!empty($margin)): ?>
4090
+ margin: <?php echo $margin; ?>;
4091
+ <?php endif; ?>
4092
+ <?php if(!empty($text_align)): ?>
4093
+ text-align: <?php echo $text_align; ?>;
4094
+ <?php endif; ?>
4095
+ <?php if(!empty($css)): ?>
4096
+ <?php echo $css; ?>
4097
+ <?php endif; ?>
4098
+ }
4099
+ <?php if(!empty($css_hover)): ?>
4100
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
4101
+ <?php echo $css_hover; ?>
4102
+ }
4103
+ <?php endif; ?>
4104
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?> a{
4105
+ <?php if(!empty($color)): ?>
4106
+ color: <?php echo $color; ?>;
4107
+ <?php endif; ?>
4108
+ <?php if(!empty($font_size)): ?>
4109
+ font-size: <?php echo $font_size; ?>;
4110
+ <?php endif; ?>
4111
+ <?php if(!empty($font_family)): ?>
4112
+ font-family: <?php echo $font_family; ?>;
4113
+ <?php endif; ?>
4114
+ }
4115
+ </style>
4116
+ <?php
4117
  }
4118
 
4119
 
4120
+
4121
+
4122
+ add_action('post_grid_layout_element_option_author_link','post_grid_layout_element_option_author_link');
4123
+ function post_grid_layout_element_option_author_link($parameters){
4124
 
4125
  $settings_tabs_field = new settings_tabs_field();
4126
 
4128
  $element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
4129
  $element_index = isset($parameters['index']) ? $parameters['index'] : '';
4130
 
 
 
 
4131
  $wrapper_html = isset($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '';
4132
+ $link_to = isset($element_data['link_to']) ? $element_data['link_to'] : '';
4133
+
4134
+ $font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
4135
+ $background_color = isset($element_data['background_color']) ? $element_data['background_color'] : '';
4136
+ $color = isset($element_data['color']) ? $element_data['color'] : '';
4137
+ $margin = isset($element_data['margin']) ? $element_data['margin'] : '';
4138
  $text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
 
4139
 
4140
  $css = isset($element_data['css']) ? $element_data['css'] : '';
4141
  $css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
4142
 
 
4143
  ?>
4144
  <div class="item">
4145
  <div class="element-title header ">
4146
  <span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
4147
  <span class="sort"><i class="fas fa-sort"></i></span>
4148
 
4149
+ <span class="expand"><?php echo __('Author name with link','post-grid'); ?></span>
4150
  </div>
4151
  <div class="element-options options">
4152
 
4153
  <?php
4154
 
 
4155
  $args = array(
4156
+ 'id' => 'link_to',
4157
+ 'css_id' => $element_index.'_link_to',
4158
+ 'parent' => $input_name.'[author_link]',
4159
+ 'title' => __('Link to','post-grid'),
4160
+ 'details' => __('Choose option to link title.','post-grid'),
4161
+ 'type' => 'select',
4162
+ 'value' => $link_to,
4163
+ 'default' => 'none',
4164
+ 'args' => array(
4165
+ 'post_link'=> __('Post link', 'post-grid'),
4166
+ 'author_posts_link'=> __('Author posts link', 'post-grid'),
4167
+ 'none'=> __('None', 'post-grid'),
4168
+ ),
4169
  );
4170
 
4171
  $settings_tabs_field->generate_field($args);
4172
 
4173
+
4174
  $args = array(
4175
+ 'id' => 'wrapper_html',
4176
+ 'css_id' => $element_index.'_wrapper_html',
4177
+ 'parent' => $input_name.'[author_link]',
4178
+ 'title' => __('Wrapper html','post-grid'),
4179
+ 'details' => __('Write wrapper html, use <code>%s</code> to replace on-sale output.','post-grid'),
4180
  'type' => 'text',
4181
+ 'value' => $wrapper_html,
4182
  'default' => '',
4183
+ 'placeholder' => 'Author: %s',
 
4184
  );
4185
 
4186
  $settings_tabs_field->generate_field($args);
4187
 
4188
 
4189
  $args = array(
4190
+ 'id' => 'color',
4191
+ 'css_id' => $element_index.'_color',
4192
+ 'parent' => $input_name.'[author_link]',
4193
+ 'title' => __('Text color','post-grid'),
4194
+ 'details' => __('Choose text color.','post-grid'),
4195
+ 'type' => 'colorpicker',
4196
+ 'value' => $color,
4197
  'default' => '',
 
4198
  );
4199
 
4200
  $settings_tabs_field->generate_field($args);
4201
 
4202
+
4203
+
4204
  $args = array(
4205
+ 'id' => 'font_size',
4206
+ 'css_id' => $element_index.'_font_size',
4207
+ 'parent' => $input_name.'[author_link]',
4208
+ 'title' => __('Font size','post-grid'),
4209
+ 'details' => __('Choose text font size.','post-grid'),
4210
  'type' => 'text',
4211
+ 'value' => $font_size,
4212
  'default' => '',
4213
+ 'placeholder' => '16px',
4214
  );
4215
 
4216
  $settings_tabs_field->generate_field($args);
4217
 
4218
  $args = array(
4219
+ 'id' => 'margin',
4220
+ 'css_id' => $element_index.'_padding',
4221
+ 'parent' => $input_name.'[author_link]',
4222
+ 'title' => __('Margin','post-grid'),
4223
+ 'details' => __('Choose padding.','post-grid'),
4224
+ 'type' => 'text',
4225
+ 'value' => $margin,
4226
  'default' => '',
4227
+ 'placeholder' => '5px 10px',
4228
  );
4229
 
4230
  $settings_tabs_field->generate_field($args);
4231
 
 
4232
  $args = array(
4233
  'id' => 'text_align',
4234
  'css_id' => $element_index.'_text_align',
4235
+ 'parent' => $input_name.'[author_link]',
4236
  'title' => __('Text align','post-grid'),
4237
  'details' => __('Choose text align.','post-grid'),
4238
  'type' => 'select',
4246
  $args = array(
4247
  'id' => 'css',
4248
  'css_id' => $element_index.'_css',
4249
+ 'parent' => $input_name.'[author_link]',
4250
  'title' => __('Custom CSS','post-grid'),
4251
  'details' => __('Set csutom CSS.','post-grid'),
4252
  'type' => 'textarea',
4260
  $args = array(
4261
  'id' => 'css_hover',
4262
  'css_id' => $element_index.'_css_hover',
4263
+ 'parent' => $input_name.'[author_link]',
4264
  'title' => __('Hover CSS','post-grid'),
4265
  'details' => __('Set hover custom CSS.','post-grid'),
4266
  'type' => 'textarea',
4289
  );
4290
 
4291
  $settings_tabs_field->generate_field($args);
 
4292
  ?>
4293
 
4294
  </div>
4297
 
4298
  }
4299
 
4300
+
4301
+
4302
+
4303
+ add_action('post_grid_layout_element_author_link', 'post_grid_layout_element_author_link');
4304
+
4305
+ function post_grid_layout_element_author_link($args){
4306
+
4307
+ $element = isset($args['element']) ? $args['element'] : array();
4308
+ $elementIndex = isset($args['index']) ? $args['index'] : '';
4309
+ $post_id = isset($args['post_id']) ? $args['post_id'] : '';
4310
+
4311
+ if(empty($post_id)) return;
4312
+
4313
+ $custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
4314
+ $link_to = isset($element['link_to']) ? $element['link_to'] : 'post_link';
4315
+ $link_target = isset($element['link_target']) ? $element['link_target'] : '';
4316
+ $wrapper_html = !empty($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
4317
+
4318
+ $post_link = get_permalink($post_id);
4319
+ $post_author = get_the_author();
4320
+
4321
+ $post_author = sprintf($wrapper_html, $post_author);
4322
+
4323
+ ?>
4324
+ <div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> author_link ">
4325
+ <?php
4326
+ if($link_to == 'post_link'):
4327
+ ?>
4328
+ <a target="<?php echo esc_attr($link_target); ?>" href="<?php echo esc_url_raw($post_link); ?>"><?php echo esc_html($post_author); ?></a>
4329
+ <?php
4330
+ elseif($link_to == 'author_posts_link'):
4331
+ $post_author_link = get_author_posts_url( get_the_author_meta( 'ID' ) ) ;
4332
+
4333
+ ?>
4334
+ <a target="<?php echo esc_attr($link_target); ?>" href="<?php echo esc_url_raw($post_author_link); ?>"><?php echo esc_html($post_author); ?></a>
4335
+ <?php
4336
+
4337
+ else:
4338
+ ?>
4339
+ <?php echo esc_html($post_author); ?>
4340
+ <?php
4341
+ endif;
4342
+ ?>
4343
+
4344
+ </div>
4345
+ <?php
4346
+ }
4347
+
4348
+ add_action('post_grid_layout_element_css_author_link', 'post_grid_layout_element_css_author_link', 10);
4349
+ function post_grid_layout_element_css_author_link($args){
4350
+
4351
+
4352
+ $index = isset($args['index']) ? $args['index'] : '';
4353
+ $element = isset($args['element']) ? $args['element'] : array();
4354
+ $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
4355
+
4356
+ $color = isset($element['color']) ? $element['color'] : '';
4357
+ $font_size = isset($element['font_size']) ? $element['font_size'] : '';
4358
+ $font_family = isset($element['font_family']) ? $element['font_family'] : '';
4359
+ $margin = isset($element['margin']) ? $element['margin'] : '';
4360
+ $text_align = isset($element['text_align']) ? $element['text_align'] : 'left';
4361
+ $css = isset($element['css']) ? $element['css'] : '';
4362
+ $css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
4363
+ ?>
4364
+ <style type="text/css">
4365
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
4366
+ <?php if(!empty($color)): ?>
4367
+ color: <?php echo $color; ?>;
4368
+ <?php endif; ?>
4369
+ <?php if(!empty($font_size)): ?>
4370
+ font-size: <?php echo $font_size; ?>;
4371
+ <?php endif; ?>
4372
+ <?php if(!empty($font_family)): ?>
4373
+ font-family: <?php echo $font_family; ?>;
4374
+ <?php endif; ?>
4375
+ <?php if(!empty($margin)): ?>
4376
+ margin: <?php echo $margin; ?>;
4377
+ <?php endif; ?>
4378
+ <?php if(!empty($text_align)): ?>
4379
+ text-align: <?php echo $text_align; ?>;
4380
+ <?php endif; ?>
4381
+ <?php if(!empty($css)): ?>
4382
+ <?php echo $css; ?>
4383
+ <?php endif; ?>
4384
+ }
4385
+ <?php if(!empty($css_hover)): ?>
4386
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
4387
+ <?php echo $css_hover; ?>
4388
+ }
4389
+ <?php endif; ?>
4390
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?> a{
4391
+ <?php if(!empty($color)): ?>
4392
+ color: <?php echo $color; ?>;
4393
+ <?php endif; ?>
4394
+ <?php if(!empty($font_size)): ?>
4395
+ font-size: <?php echo $font_size; ?>;
4396
+ <?php endif; ?>
4397
+ <?php if(!empty($font_family)): ?>
4398
+ font-family: <?php echo $font_family; ?>;
4399
+ <?php endif; ?>
4400
+ }
4401
+ </style>
4402
+ <?php
4403
+ }
4404
+
4405
+
4406
+
4407
+
4408
+ add_action('post_grid_layout_element_option_categories','post_grid_layout_element_option_categories');
4409
+ function post_grid_layout_element_option_categories($parameters){
4410
 
4411
  $settings_tabs_field = new settings_tabs_field();
4412
 
4414
  $element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
4415
  $element_index = isset($parameters['index']) ? $parameters['index'] : '';
4416
 
4417
+ $max_count = isset($element_data['max_count']) ? $element_data['max_count'] : '';
4418
  $font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
4419
  $font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
4420
+ $wrapper_html = isset($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '';
4421
+ $wrapper_margin = isset($element_data['wrapper_margin']) ? $element_data['wrapper_margin'] : '';
4422
+ $link_color = isset($element_data['link_color']) ? $element_data['link_color'] : '';
4423
+ $text_color = isset($element_data['text_color']) ? $element_data['text_color'] : '';
4424
+
4425
+ $separator = isset($element_data['separator']) ? $element_data['separator'] : '';
4426
  $text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
4427
 
4428
  $css = isset($element_data['css']) ? $element_data['css'] : '';
4429
  $css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
4430
 
4431
+
4432
  ?>
4433
  <div class="item">
4434
  <div class="element-title header ">
4435
  <span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
4436
  <span class="sort"><i class="fas fa-sort"></i></span>
4437
 
4438
+ <span class="expand"><?php echo __('Post categories','post-grid'); ?></span>
4439
  </div>
4440
  <div class="element-options options">
4441
 
4442
  <?php
4443
 
4444
+ $args = array(
4445
+ 'id' => 'max_count',
4446
+ 'parent' => $input_name.'[categories]',
4447
+ 'title' => __('Max count','post-grid'),
4448
+ 'details' => __('Write max count','post-grid'),
4449
+ 'type' => 'text',
4450
+ 'value' => $max_count,
4451
+ 'default' => 3,
4452
+ 'placeholder' => '3',
4453
+ );
4454
+
4455
+ $settings_tabs_field->generate_field($args);
4456
+
4457
+ $args = array(
4458
+ 'id' => 'separator',
4459
+ 'css_id' => $element_index.'_position_color',
4460
+ 'parent' => $input_name.'[categories]',
4461
+ 'title' => __('Link separator','post-grid'),
4462
+ 'details' => __('Choose link separator.','post-grid'),
4463
+ 'type' => 'text',
4464
+ 'value' => $separator,
4465
+ 'default' => '',
4466
+ 'placeholder' => ', ',
4467
+
4468
+ );
4469
+
4470
+ $settings_tabs_field->generate_field($args);
4471
+
4472
  $args = array(
4473
  'id' => 'wrapper_html',
4474
  'css_id' => $element_index.'_wrapper_html',
4475
+ 'parent' => $input_name.'[categories]',
4476
  'title' => __('Wrapper html','post-grid'),
4477
+ 'details' => __('Write wrapper html, use <code>%s</code> to replace category output.','post-grid'),
4478
  'type' => 'text',
4479
  'value' => $wrapper_html,
4480
  'default' => '',
4481
+ 'placeholder' => 'Categories: %s',
4482
  );
4483
 
4484
  $settings_tabs_field->generate_field($args);
4485
 
 
 
 
4486
  $args = array(
4487
+ 'id' => 'wrapper_margin',
4488
+ 'css_id' => $element_index.'_margin',
4489
+ 'parent' => $input_name.'[categories]',
4490
+ 'title' => __('Margin','post-grid'),
4491
+ 'details' => __('Set margin.','post-grid'),
4492
+ 'type' => 'text',
4493
+ 'value' => $wrapper_margin,
4494
  'default' => '',
4495
+ 'placeholder' => '5px 0',
4496
  );
4497
 
4498
  $settings_tabs_field->generate_field($args);
4499
 
4500
+
4501
  $args = array(
4502
  'id' => 'font_size',
4503
  'css_id' => $element_index.'_font_size',
4504
+ 'parent' => $input_name.'[categories]',
4505
  'title' => __('Font size','post-grid'),
4506
+ 'details' => __('Choose font size.','post-grid'),
4507
  'type' => 'text',
4508
  'value' => $font_size,
4509
  'default' => '',
4510
+ 'placeholder' => '16px',
4511
+
4512
  );
4513
 
4514
  $settings_tabs_field->generate_field($args);
4515
 
4516
 
4517
  $args = array(
4518
+ 'id' => 'link_color',
4519
+ 'css_id' => $element_index.'_link_color',
4520
+ 'parent' => $input_name.'[categories]',
4521
+ 'title' => __('Link color','post-grid'),
4522
+ 'details' => __('Choose link color.','post-grid'),
4523
+ 'type' => 'colorpicker',
4524
+ 'value' => $link_color,
4525
  'default' => '',
 
4526
  );
4527
 
4528
  $settings_tabs_field->generate_field($args);
4529
 
 
4530
  $args = array(
4531
+ 'id' => 'text_color',
4532
+ 'css_id' => $element_index.'_text_color',
4533
+ 'parent' => $input_name.'[categories]',
4534
+ 'title' => __('Text color','post-grid'),
4535
+ 'details' => __('Choose text color.','post-grid'),
4536
+ 'type' => 'colorpicker',
4537
+ 'value' => $text_color,
4538
  'default' => '',
 
4539
  );
4540
 
4541
  $settings_tabs_field->generate_field($args);
4544
  $args = array(
4545
  'id' => 'text_align',
4546
  'css_id' => $element_index.'_text_align',
4547
+ 'parent' => $input_name.'[categories]',
4548
  'title' => __('Text align','post-grid'),
4549
  'details' => __('Choose text align.','post-grid'),
4550
  'type' => 'select',
4558
  $args = array(
4559
  'id' => 'css',
4560
  'css_id' => $element_index.'_css',
4561
+ 'parent' => $input_name.'[categories]',
4562
  'title' => __('Custom CSS','post-grid'),
4563
  'details' => __('Set csutom CSS.','post-grid'),
4564
  'type' => 'textarea',
4572
  $args = array(
4573
  'id' => 'css_hover',
4574
  'css_id' => $element_index.'_css_hover',
4575
+ 'parent' => $input_name.'[categories]',
4576
  'title' => __('Hover CSS','post-grid'),
4577
  'details' => __('Set hover custom CSS.','post-grid'),
4578
  'type' => 'textarea',
4585
 
4586
  ob_start();
4587
  ?>
4588
+ <textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}
4589
+ .element_<?php echo $element_index?> a{}</textarea>
4590
  <?php
4591
 
4592
  $html = ob_get_clean();
4602
 
4603
  $settings_tabs_field->generate_field($args);
4604
 
 
4605
  ?>
4606
 
4607
  </div>
4611
  }
4612
 
4613
 
4614
+ add_action('post_grid_layout_element_categories', 'post_grid_layout_element_categories');
4615
+
4616
+ function post_grid_layout_element_categories($args){
4617
+
4618
+ $element = isset($args['element']) ? $args['element'] : array();
4619
+ $elementIndex = isset($args['index']) ? $args['index'] : '';
4620
+ $post_id = isset($args['post_id']) ? $args['post_id'] : '';
4621
+
4622
+ if(empty($post_id)) return;
4623
+
4624
+ $custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
4625
+ $link_target = isset($element['link_target']) ? $element['link_target'] : '';
4626
+ $max_count = isset($element['max_count']) ? (int) $element['max_count'] : 3;
4627
+ $wrapper_html = !empty($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
4628
+ $separator = isset($element['separator']) ? $element['separator'] : ', ';
4629
+
4630
+
4631
+ $term_list = wp_get_post_terms( $post_id, 'category', array( 'fields' => 'all' ) );
4632
+
4633
+ $categories_html = '';
4634
+ $term_total_count = count($term_list);
4635
+ $max_term_limit = ($term_total_count < $max_count) ? $term_total_count : $max_count ;
4636
+
4637
+ $i = 0;
4638
+ foreach ($term_list as $term){
4639
+ if($i >= $max_count) continue;
4640
+
4641
+ $term_id = isset($term->term_id) ? $term->term_id : '';
4642
+ $term_name = isset($term->name) ? $term->name : '';
4643
+ $term_link = get_term_link($term_id);
4644
+
4645
+ $categories_html .= '<a target="'.esc_attr($link_target).'" href="'.esc_url_raw($term_link).'">'.esc_html($term_name).'</a>';
4646
+ if( $i+1 < $max_term_limit){ $categories_html .= $separator;}
4647
+
4648
+ $i++;
4649
+ }
4650
+
4651
+ //var_dump($categories_html);
4652
+
4653
+ ?>
4654
+ <div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> categories ">
4655
+ <?php echo sprintf($wrapper_html, $categories_html); ?>
4656
+ </div>
4657
+ <?php
4658
+ }
4659
 
4660
+
4661
+ add_action('post_grid_layout_element_css_categories', 'post_grid_layout_element_css_categories', 10);
4662
+ function post_grid_layout_element_css_categories($args){
4663
+
4664
+
4665
+ $index = isset($args['index']) ? $args['index'] : '';
4666
+ $element = isset($args['element']) ? $args['element'] : array();
4667
+ $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
4668
+
4669
+ $link_color = isset($element['link_color']) ? $element['link_color'] : '';
4670
+ $text_color = isset($element['text_color']) ? $element['text_color'] : '';
4671
+
4672
+ $font_size = isset($element['font_size']) ? $element['font_size'] : '';
4673
+ $font_family = isset($element['font_family']) ? $element['font_family'] : '';
4674
+ $margin = isset($element['margin']) ? $element['margin'] : '';
4675
+ $text_align = isset($element['text_align']) ? $element['text_align'] : '';
4676
+ $css = isset($element['css']) ? $element['css'] : '';
4677
+ $css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
4678
+ ?>
4679
+ <style type="text/css">
4680
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
4681
+ <?php if(!empty($text_color)): ?>
4682
+ color: <?php echo $text_color; ?>;
4683
+ <?php endif; ?>
4684
+ <?php if(!empty($font_size)): ?>
4685
+ font-size: <?php echo $font_size; ?>;
4686
+ <?php endif; ?>
4687
+ <?php if(!empty($font_family)): ?>
4688
+ font-family: <?php echo $font_family; ?>;
4689
+ <?php endif; ?>
4690
+ <?php if(!empty($margin)): ?>
4691
+ margin: <?php echo $margin; ?>;
4692
+ <?php endif; ?>
4693
+ <?php if(!empty($text_align)): ?>
4694
+ text-align: <?php echo $text_align; ?>;
4695
+ <?php endif; ?>
4696
+ <?php if(!empty($css)): ?>
4697
+ <?php echo $css; ?>
4698
+ <?php endif; ?>
4699
+ }
4700
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?> a{
4701
+ <?php if(!empty($link_color)): ?>
4702
+ color: <?php echo $link_color; ?>;
4703
+ <?php endif; ?>
4704
+ <?php if(!empty($font_size)): ?>
4705
+ font-size: <?php echo $font_size; ?>;
4706
+ <?php endif; ?>
4707
+ <?php if(!empty($font_family)): ?>
4708
+ font-family: <?php echo $font_family; ?>;
4709
+ <?php endif; ?>
4710
+ }
4711
+ <?php if(!empty($css_hover)): ?>
4712
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
4713
+ <?php echo $css_hover; ?>
4714
+ }
4715
+ <?php endif; ?>
4716
+ </style>
4717
+ <?php
4718
+ }
4719
+
4720
+
4721
+
4722
+
4723
+
4724
+ add_action('post_grid_layout_element_option_tags','post_grid_layout_element_option_tags');
4725
+ function post_grid_layout_element_option_tags($parameters){
4726
 
4727
  $settings_tabs_field = new settings_tabs_field();
4728
 
4730
  $element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
4731
  $element_index = isset($parameters['index']) ? $parameters['index'] : '';
4732
 
4733
+ $max_count = isset($element_data['max_count']) ? $element_data['max_count'] : '';
4734
  $font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
4735
+ $font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
4736
+ $wrapper_html = isset($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '';
4737
+ $wrapper_margin = isset($element_data['wrapper_margin']) ? $element_data['wrapper_margin'] : '';
4738
+ $link_color = isset($element_data['link_color']) ? $element_data['link_color'] : '';
4739
  $text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
4740
+ $separator = isset($element_data['separator']) ? $element_data['separator'] : '';
4741
 
4742
  $css = isset($element_data['css']) ? $element_data['css'] : '';
4743
  $css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
4749
  <span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
4750
  <span class="sort"><i class="fas fa-sort"></i></span>
4751
 
4752
+ <span class="expand"><?php echo __('Post tag','post-grid'); ?></span>
4753
  </div>
4754
  <div class="element-options options">
4755
 
4756
  <?php
4757
 
4758
 
4759
+ $args = array(
4760
+ 'id' => 'max_count',
4761
+ 'parent' => $input_name.'[tags]',
4762
+ 'title' => __('Max count','post-grid'),
4763
+ 'details' => __('Write max count','post-grid'),
4764
+ 'type' => 'text',
4765
+ 'value' => $max_count,
4766
+ 'default' => 3,
4767
+ 'placeholder' => '3',
4768
+ );
4769
+
4770
+ $settings_tabs_field->generate_field($args);
4771
 
4772
  $args = array(
4773
+ 'id' => 'separator',
4774
+ 'css_id' => $element_index.'_position_color',
4775
+ 'parent' => $input_name.'[tags]',
4776
+ 'title' => __('Link separator','post-grid'),
4777
+ 'details' => __('Choose link separator.','post-grid'),
4778
+ 'type' => 'text',
4779
+ 'value' => $separator,
4780
  'default' => '',
4781
+ 'placeholder' => ', ',
4782
+
4783
  );
4784
 
4785
  $settings_tabs_field->generate_field($args);
4786
 
4787
 
4788
  $args = array(
4789
+ 'id' => 'wrapper_html',
4790
+ 'css_id' => $element_index.'_wrapper_html',
4791
+ 'parent' => $input_name.'[tags]',
4792
+ 'title' => __('Wrapper html','post-grid'),
4793
+ 'details' => __('Write wrapper html, use <code>%s</code> to replace tags output.','post-grid'),
4794
  'type' => 'text',
4795
+ 'value' => $wrapper_html,
4796
  'default' => '',
4797
+ 'placeholder' => 'Tags: %s',
4798
  );
4799
 
4800
  $settings_tabs_field->generate_field($args);
4801
 
4802
  $args = array(
4803
+ 'id' => 'wrapper_margin',
4804
  'css_id' => $element_index.'_margin',
4805
+ 'parent' => $input_name.'[tags]',
4806
  'title' => __('Margin','post-grid'),
4807
+ 'details' => __('Set margin.','post-grid'),
4808
  'type' => 'text',
4809
+ 'value' => $wrapper_margin,
4810
+ 'default' => '',
4811
+ 'placeholder' => '5px 0',
4812
+ );
4813
+
4814
+ $settings_tabs_field->generate_field($args);
4815
+
4816
+ $args = array(
4817
+ 'id' => 'link_color',
4818
+ 'css_id' => $element_index.'_link_color',
4819
+ 'parent' => $input_name.'[tags]',
4820
+ 'title' => __('Link color','post-grid'),
4821
+ 'details' => __('Choose link color.','post-grid'),
4822
+ 'type' => 'colorpicker',
4823
+ 'value' => $link_color,
4824
  'default' => '',
 
4825
  );
4826
 
4827
  $settings_tabs_field->generate_field($args);
4828
 
4829
+
4830
  $args = array(
4831
  'id' => 'text_align',
4832
  'css_id' => $element_index.'_text_align',
4833
+ 'parent' => $input_name.'[tags]',
4834
  'title' => __('Text align','post-grid'),
4835
  'details' => __('Choose text align.','post-grid'),
4836
  'type' => 'select',
4844
  $args = array(
4845
  'id' => 'css',
4846
  'css_id' => $element_index.'_css',
4847
+ 'parent' => $input_name.'[tags]',
4848
  'title' => __('Custom CSS','post-grid'),
4849
  'details' => __('Set csutom CSS.','post-grid'),
4850
  'type' => 'textarea',
4858
  $args = array(
4859
  'id' => 'css_hover',
4860
  'css_id' => $element_index.'_css_hover',
4861
+ 'parent' => $input_name.'[tags]',
4862
  'title' => __('Hover CSS','post-grid'),
4863
  'details' => __('Set hover custom CSS.','post-grid'),
4864
  'type' => 'textarea',
4869
 
4870
  $settings_tabs_field->generate_field($args);
4871
 
 
4872
  ob_start();
4873
  ?>
4874
+ <textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}
4875
+ .element_<?php echo $element_index?> a{}</textarea>
4876
  <?php
4877
 
4878
  $html = ob_get_clean();
4895
  <?php
4896
 
4897
  }
4898
+ add_action('post_grid_layout_element_tags', 'post_grid_layout_element_tags');
4899
 
4900
+ function post_grid_layout_element_tags($args){
4901
+
4902
+ $element = isset($args['element']) ? $args['element'] : array();
4903
+ $elementIndex = isset($args['index']) ? $args['index'] : '';
4904
+ $post_id = isset($args['post_id']) ? $args['post_id'] : '';
4905
+
4906
+ if(empty($post_id)) return;
4907
+
4908
+ $custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
4909
+ $link_target = isset($element['link_target']) ? $element['link_target'] : '';
4910
+ $max_count = isset($element['max_count']) ? (int) $element['max_count'] : 3;
4911
+ $wrapper_html = isset($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
4912
+ $separator = isset($element['separator']) ? $element['separator'] : ', ';
4913
+
4914
+
4915
+ $term_list = wp_get_post_terms( $post_id, 'post_tag', array( 'fields' => 'all' ) );
4916
+
4917
+ $categories_html = '';
4918
+ $term_total_count = count($term_list);
4919
+ $max_term_limit = ($term_total_count < $max_count) ? $term_total_count : $max_count ;
4920
+
4921
+ $i = 0;
4922
+ foreach ($term_list as $term){
4923
+ if($i >= $max_count) continue;
4924
+
4925
+ $term_id = isset($term->term_id) ? $term->term_id : '';
4926
+ $term_name = isset($term->name) ? $term->name : '';
4927
+ $term_link = get_term_link($term_id);
4928
+
4929
+ $categories_html .= '<a target="'.esc_attr($link_target).'" href="'.esc_url_raw($term_link).'">'.esc_html($term_name).'</a>';
4930
+ if( $i+1 < $max_term_limit){ $categories_html .= $separator;}
4931
+
4932
+ $i++;
4933
+ }
4934
+
4935
+ ?>
4936
+ <div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> tags ">
4937
+ <?php echo sprintf($wrapper_html, $categories_html); ?>
4938
+ </div>
4939
+ <?php
4940
+ }
4941
+
4942
+
4943
+ add_action('post_grid_layout_element_css_tags', 'post_grid_layout_element_css_tags', 10);
4944
+ function post_grid_layout_element_css_tags($args){
4945
+
4946
+
4947
+ $index = isset($args['index']) ? $args['index'] : '';
4948
+ $element = isset($args['element']) ? $args['element'] : array();
4949
+ $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
4950
+
4951
+ $link_color = isset($element['link_color']) ? $element['link_color'] : '';
4952
+ $text_color = isset($element['text_color']) ? $element['text_color'] : '';
4953
+
4954
+ $font_size = isset($element['font_size']) ? $element['font_size'] : '';
4955
+ $font_family = isset($element['font_family']) ? $element['font_family'] : '';
4956
+ $margin = isset($element['margin']) ? $element['margin'] : '';
4957
+ $text_align = isset($element['text_align']) ? $element['text_align'] : '';
4958
+
4959
+ $css = isset($element['css']) ? $element['css'] : '';
4960
+ $css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
4961
+ ?>
4962
+ <style type="text/css">
4963
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
4964
+ <?php if(!empty($text_color)): ?>
4965
+ color: <?php echo $text_color; ?>;
4966
+ <?php endif; ?>
4967
+ <?php if(!empty($font_size)): ?>
4968
+ font-size: <?php echo $font_size; ?>;
4969
+ <?php endif; ?>
4970
+ <?php if(!empty($font_family)): ?>
4971
+ font-family: <?php echo $font_family; ?>;
4972
+ <?php endif; ?>
4973
+ <?php if(!empty($margin)): ?>
4974
+ margin: <?php echo $margin; ?>;
4975
+ <?php endif; ?>
4976
+ <?php if(!empty($text_align)): ?>
4977
+ text-align: <?php echo $text_align; ?>;
4978
+ <?php endif; ?>
4979
+ <?php if(!empty($css)): ?>
4980
+ <?php echo $css; ?>
4981
+ <?php endif; ?>
4982
+ }
4983
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?> a{
4984
+ <?php if(!empty($link_color)): ?>
4985
+ color: <?php echo $link_color; ?>;
4986
+ <?php endif; ?>
4987
+ <?php if(!empty($font_size)): ?>
4988
+ font-size: <?php echo $font_size; ?>;
4989
+ <?php endif; ?>
4990
+ <?php if(!empty($font_family)): ?>
4991
+ font-family: <?php echo $font_family; ?>;
4992
+ <?php endif; ?>
4993
+ }
4994
+ <?php if(!empty($css_hover)): ?>
4995
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
4996
+ <?php echo $css_hover; ?>
4997
+ }
4998
+ <?php endif; ?>
4999
+ </style>
5000
+ <?php
5001
+ }
5002
+
5003
+
5004
+
5005
+
5006
+ add_action('post_grid_layout_element_option_comments_count','post_grid_layout_element_option_comments_count');
5007
+ function post_grid_layout_element_option_comments_count($parameters){
5008
 
5009
  $settings_tabs_field = new settings_tabs_field();
5010
 
5012
  $element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
5013
  $element_index = isset($parameters['index']) ? $parameters['index'] : '';
5014
 
5015
+ $wrapper_html = isset($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '';
5016
+ $font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
5017
+ $font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
5018
  $margin = isset($element_data['margin']) ? $element_data['margin'] : '';
5019
+ $color = isset($element_data['color']) ? $element_data['color'] : '';
5020
+ $text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
5021
 
5022
  $css = isset($element_data['css']) ? $element_data['css'] : '';
5023
  $css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
5028
  <span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
5029
  <span class="sort"><i class="fas fa-sort"></i></span>
5030
 
5031
+ <span class="expand"><?php echo __('Comment count','post-grid'); ?></span>
5032
  </div>
5033
  <div class="element-options options">
5034
 
5035
  <?php
5036
 
5037
+ $args = array(
5038
+ 'id' => 'wrapper_html',
5039
+ 'css_id' => $element_index.'_wrapper_html',
5040
+ 'parent' => $input_name.'[comments_count]',
5041
+ 'title' => __('Wrapper html','post-grid'),
5042
+ 'details' => __('Write wrapper html, use <code>%s</code> to replace comment count output.','post-grid'),
5043
+ 'type' => 'text',
5044
+ 'value' => $wrapper_html,
5045
+ 'default' => '',
5046
+ 'placeholder' => 'Total comments: %s',
5047
+ );
5048
+
5049
+ $settings_tabs_field->generate_field($args);
5050
+
5051
 
5052
 
5053
 
5054
  $args = array(
5055
+ 'id' => 'color',
5056
+ 'css_id' => $element_index.'_color',
5057
+ 'parent' => $input_name.'[comments_count]',
5058
+ 'title' => __('Color','post-grid'),
5059
+ 'details' => __('Title text color.','post-grid'),
5060
  'type' => 'colorpicker',
5061
+ 'value' => $color,
5062
  'default' => '',
5063
  );
5064
 
5065
  $settings_tabs_field->generate_field($args);
5066
 
5067
+ $args = array(
5068
+ 'id' => 'font_size',
5069
+ 'css_id' => $element_index.'_font_size',
5070
+ 'parent' => $input_name.'[comments_count]',
5071
+ 'title' => __('Font size','post-grid'),
5072
+ 'details' => __('Set font size.','post-grid'),
5073
+ 'type' => 'text',
5074
+ 'value' => $font_size,
5075
+ 'default' => '',
5076
+ 'placeholder' => '14px',
5077
+ );
5078
+
5079
+ $settings_tabs_field->generate_field($args);
5080
+
5081
 
5082
  $args = array(
5083
+ 'id' => 'font_family',
5084
+ 'css_id' => $element_index.'_font_family',
5085
+ 'parent' => $input_name.'[comments_count]',
5086
+ 'title' => __('Font family','post-grid'),
5087
+ 'details' => __('Set font family.','post-grid'),
5088
  'type' => 'text',
5089
+ 'value' => $font_family,
5090
  'default' => '',
5091
+ 'placeholder' => 'Open Sans',
5092
  );
5093
 
5094
  $settings_tabs_field->generate_field($args);
5095
 
5096
+
5097
  $args = array(
5098
  'id' => 'margin',
5099
+ 'css_id' => $element_index.'_margin',
5100
+ 'parent' => $input_name.'[comments_count]',
5101
  'title' => __('Margin','post-grid'),
5102
+ 'details' => __('Set margin.','post-grid'),
5103
  'type' => 'text',
5104
  'value' => $margin,
5105
  'default' => '',
5106
+ 'placeholder' => '5px 0',
5107
+ );
5108
+
5109
+ $settings_tabs_field->generate_field($args);
5110
+
5111
+
5112
+ $args = array(
5113
+ 'id' => 'text_align',
5114
+ 'css_id' => $element_index.'_text_align',
5115
+ 'parent' => $input_name.'[comments_count]',
5116
+ 'title' => __('Text align','post-grid'),
5117
+ 'details' => __('Choose text align.','post-grid'),
5118
+ 'type' => 'select',
5119
+ 'value' => $text_align,
5120
+ 'default' => 'left',
5121
+ 'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
5122
  );
5123
 
5124
  $settings_tabs_field->generate_field($args);
5126
  $args = array(
5127
  'id' => 'css',
5128
  'css_id' => $element_index.'_css',
5129
+ 'parent' => $input_name.'[comments_count]',
5130
  'title' => __('Custom CSS','post-grid'),
5131
  'details' => __('Set csutom CSS.','post-grid'),
5132
  'type' => 'textarea',
5140
  $args = array(
5141
  'id' => 'css_hover',
5142
  'css_id' => $element_index.'_css_hover',
5143
+ 'parent' => $input_name.'[comments_count]',
5144
  'title' => __('Hover CSS','post-grid'),
5145
  'details' => __('Set hover custom CSS.','post-grid'),
5146
  'type' => 'textarea',
5178
 
5179
  }
5180
 
5181
+
5182
+
5183
+ add_action('post_grid_layout_element_comments_count', 'post_grid_layout_element_comments_count');
5184
+
5185
+ function post_grid_layout_element_comments_count($args){
5186
+
5187
+ $element = isset($args['element']) ? $args['element'] : array();
5188
+ $elementIndex = isset($args['index']) ? $args['index'] : '';
5189
+ $post_id = isset($args['post_id']) ? $args['post_id'] : '';
5190
+
5191
+ if(empty($post_id)) return;
5192
+
5193
+ $custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
5194
+ $wrapper_html = isset($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
5195
+
5196
+
5197
+
5198
+ $comments_number = get_comments_number( $post_id );
5199
+ $comments_count_html = '';
5200
+
5201
+ if(comments_open()){
5202
+
5203
+ if ( $comments_number == 0 ) {
5204
+ $comments_count_html.= __('No Comments', 'post-grid');
5205
+ } elseif ( $comments_number > 1 ) {
5206
+ $comments_count_html.= sprintf(__('%s Comments', 'post-grid'), $comments_number);
5207
+ } else {
5208
+ $comments_count_html.= __('1 Comment', 'post-grid');
5209
+ }
5210
+
5211
+ ?>
5212
+ <div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> tags ">
5213
+ <?php echo sprintf($wrapper_html, $comments_count_html); ?>
5214
+ </div>
5215
+ <?php
5216
+
5217
+ }
5218
+
5219
+
5220
+ }
5221
+
5222
+
5223
+ add_action('post_grid_layout_element_css_comments_count', 'post_grid_layout_element_css_comments_count', 10);
5224
+ function post_grid_layout_element_css_comments_count($args){
5225
+
5226
+
5227
+ $index = isset($args['index']) ? $args['index'] : '';
5228
+ $element = isset($args['element']) ? $args['element'] : array();
5229
+ $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
5230
+
5231
+ $color = isset($element['color']) ? $element['color'] : '';
5232
+
5233
+ $font_size = isset($element['font_size']) ? $element['font_size'] : '';
5234
+ $font_family = isset($element['font_family']) ? $element['font_family'] : '';
5235
+ $margin = isset($element['margin']) ? $element['margin'] : '';
5236
+ $text_align = isset($element['text_align']) ? $element['text_align'] : '';
5237
+
5238
+ $css = isset($element['css']) ? $element['css'] : '';
5239
+ $css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
5240
+ ?>
5241
+ <style type="text/css">
5242
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
5243
+ <?php if(!empty($color)): ?>
5244
+ color: <?php echo $color; ?>;
5245
+ <?php endif; ?>
5246
+ <?php if(!empty($font_size)): ?>
5247
+ font-size: <?php echo $font_size; ?>;
5248
+ <?php endif; ?>
5249
+ <?php if(!empty($font_family)): ?>
5250
+ font-family: <?php echo $font_family; ?>;
5251
+ <?php endif; ?>
5252
+ <?php if(!empty($margin)): ?>
5253
+ margin: <?php echo $margin; ?>;
5254
+ <?php endif; ?>
5255
+ <?php if(!empty($text_align)): ?>
5256
+ text-align: <?php echo $text_align; ?>;
5257
+ <?php endif; ?>
5258
+ <?php if(!empty($css)): ?>
5259
+ <?php echo $css; ?>
5260
+ <?php endif; ?>
5261
+ }
5262
+ <?php if(!empty($css_hover)): ?>
5263
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
5264
+ <?php echo $css_hover; ?>
5265
+ }
5266
+ <?php endif; ?>
5267
+ </style>
5268
+ <?php
5269
+ }
5270
+
5271
+
5272
+
5273
+
5274
+
5275
+
5276
+
5277
+
5278
+
5279
+
5280
  add_action('post_grid_layout_element_option_share_button','post_grid_layout_element_option_share_button');
5281
  function post_grid_layout_element_option_share_button($parameters){
5282
 
5408
  }
5409
 
5410
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5411
 
 
5412
 
5413
+ add_action('post_grid_layout_element_share_button', 'post_grid_layout_element_share_button');
5414
 
5415
+ function post_grid_layout_element_share_button($args){
5416
 
5417
+ $element = isset($args['element']) ? $args['element'] : array();
5418
+ $elementIndex = isset($args['index']) ? $args['index'] : '';
5419
+ $post_id = isset($args['post_id']) ? $args['post_id'] : '';
 
 
 
 
 
 
 
 
5420
 
5421
+ if(empty($post_id)) return;
5422
 
5423
+ $custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
5424
+ $link_target = isset($element['link_target']) ? $element['link_target'] : '';
5425
+ $wrapper_html = isset($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
5426
+ $font_size = isset($element['font_size']) ? $element['font_size'] : '';
5427
+ $font_color = isset($element['color']) ? $element['color'] : '';
 
 
 
 
 
 
5428
 
 
5429
 
5430
+ $post_title = get_the_title($post_id);
5431
+ $post_link = get_permalink($post_id);
 
 
 
 
 
 
 
 
 
5432
 
5433
+ $share_button_html = '';
5434
 
5435
+ $share_button_html.= '
5436
+ <span class="fb">
5437
+ <a target="'.$link_target.'" href="https://www.facebook.com/sharer/sharer.php?u='.$post_link.'"><i class="fab fa-facebook-square"></i></a>
5438
+ </span>
5439
+ <span class="twitter">
5440
+ <a target="'.$link_target.'" href="https://twitter.com/intent/tweet?url='.$post_link.'&text='.$post_title.'"><i class="fab fa-twitter-square"></i></a>
5441
+ </span>';
 
 
 
 
5442
 
5443
+ $share_button_html = apply_filters('post_grid_filter_share_buttons', $share_button_html);
5444
 
5445
+ ?>
5446
+ <div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> share_button ">
5447
+ <?php echo sprintf($wrapper_html, $share_button_html); ?>
5448
+ </div>
5449
+ <?php
5450
+ }
 
 
 
 
 
5451
 
 
5452
 
5453
+ add_action('post_grid_layout_element_css_share_button', 'post_grid_layout_element_css_share_button', 10);
5454
+ function post_grid_layout_element_css_share_button($args){
 
 
 
5455
 
 
5456
 
5457
+ $index = isset($args['index']) ? $args['index'] : '';
5458
+ $element = isset($args['element']) ? $args['element'] : array();
5459
+ $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
 
 
 
5460
 
5461
+ $font_size = isset($element['font_size']) ? $element['font_size'] : '';
5462
 
5463
+ $wrapper_margin = isset($element['wrapper_margin']) ? $element['wrapper_margin'] : '';
5464
 
5465
+ $text_align = isset($element['text_align']) ? $element['text_align'] : '';
5466
+ $icon_margin = isset($element['icon_margin']) ? $element['icon_margin'] : '';
5467
+ $icon_color = isset($element['icon_color']) ? $element['icon_color'] : '';
5468
+ $font_size = isset($element['font_size']) ? $element['font_size'] : '';
5469
+ $css = isset($element['css']) ? $element['css'] : '';
5470
+ $css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
5471
 
5472
+ ?>
5473
+ <style type="text/css">
5474
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
5475
+ <?php if(!empty($icon_color)): ?>
5476
+ color: <?php echo $icon_color; ?>;
5477
+ <?php endif; ?>
5478
+ <?php if(!empty($font_size)): ?>
5479
+ font-size: <?php echo $font_size; ?>;
5480
+ <?php endif; ?>
5481
+ <?php if(!empty($wrapper_margin)): ?>
5482
+ margin: <?php echo $wrapper_margin; ?>;
5483
+ <?php endif; ?>
5484
+ <?php if(!empty($text_align)): ?>
5485
+ text-align: <?php echo $text_align; ?>;
5486
+ <?php endif; ?>
5487
+ <?php if(!empty($css)): ?>
5488
+ <?php echo $css; ?>
5489
+ <?php endif; ?>
5490
+ }
5491
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?> a{
5492
+ <?php if(!empty($icon_color)): ?>
5493
+ color: <?php echo $icon_color; ?>;
5494
+ <?php endif; ?>
5495
+ <?php if(!empty($font_size)): ?>
5496
+ font-size: <?php echo $font_size; ?>;
5497
+ <?php endif; ?>
5498
+ <?php if(!empty($icon_margin)): ?>
5499
+ margin: <?php echo $icon_margin; ?>;
5500
+ <?php endif; ?>
5501
+ }
5502
+ <?php if(!empty($css_hover)): ?>
5503
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
5504
+ <?php echo $css_hover; ?>
5505
+ }
5506
+ <?php endif; ?>
5507
+ </style>
5508
  <?php
 
5509
  }
5510
 
5511
 
5512
 
5513
+
5514
+ add_action('post_grid_layout_element_option_hr','post_grid_layout_element_option_hr');
5515
+ function post_grid_layout_element_option_hr($parameters){
5516
 
5517
  $settings_tabs_field = new settings_tabs_field();
5518
 
5520
  $element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
5521
  $element_index = isset($parameters['index']) ? $parameters['index'] : '';
5522
 
5523
+ $background_color = isset($element_data['background_color']) ? $element_data['background_color'] : '';
5524
+ $margin = isset($element_data['margin']) ? $element_data['margin'] : '';
5525
+ $height = isset($element_data['height']) ? $element_data['height'] : '';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5526
 
5527
+ $css = isset($element_data['css']) ? $element_data['css'] : '';
5528
+ $css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
5529
+
5530
+ ?>
5531
+ <div class="item">
5532
+ <div class="element-title header ">
5533
+ <span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
5534
+ <span class="sort"><i class="fas fa-sort"></i></span>
5535
+
5536
+ <span class="expand"><?php echo __('Horizontal line','post-grid'); ?></span>
5537
+ </div>
5538
+ <div class="element-options options">
5539
+
5540
+ <?php
5541
 
 
 
 
 
 
 
 
 
 
 
 
5542
 
 
5543
 
5544
 
5545
  $args = array(
5546
+ 'id' => 'background_color',
5547
+ 'css_id' => $element_index.'_background_coloradd_to_cart',
5548
+ 'parent' => $input_name.'[hr]',
5549
+ 'title' => __('Background color','post-grid'),
5550
+ 'details' => __('Choose background color.','post-grid'),
5551
  'type' => 'colorpicker',
5552
+ 'value' => $background_color,
5553
  'default' => '',
5554
  );
5555
 
5556
  $settings_tabs_field->generate_field($args);
5557
 
5558
 
 
5559
  $args = array(
5560
+ 'id' => 'height',
5561
+ 'css_id' => $element_index.'_height',
5562
+ 'parent' => $input_name.'[hr]',
5563
+ 'title' => __('Height','post-grid'),
5564
+ 'details' => __('Choose height.','post-grid'),
5565
  'type' => 'text',
5566
+ 'value' => $height,
5567
  'default' => '',
5568
+ 'placeholder' => '5px',
5569
  );
5570
 
5571
  $settings_tabs_field->generate_field($args);
5573
  $args = array(
5574
  'id' => 'margin',
5575
  'css_id' => $element_index.'_padding',
5576
+ 'parent' => $input_name.'[hr]',
5577
  'title' => __('Margin','post-grid'),
5578
+ 'details' => __('Choose margin.','post-grid'),
5579
  'type' => 'text',
5580
  'value' => $margin,
5581
  'default' => '',
5584
 
5585
  $settings_tabs_field->generate_field($args);
5586
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5587
  $args = array(
5588
  'id' => 'css',
5589
  'css_id' => $element_index.'_css',
5590
+ 'parent' => $input_name.'[hr]',
5591
  'title' => __('Custom CSS','post-grid'),
5592
  'details' => __('Set csutom CSS.','post-grid'),
5593
  'type' => 'textarea',
5601
  $args = array(
5602
  'id' => 'css_hover',
5603
  'css_id' => $element_index.'_css_hover',
5604
+ 'parent' => $input_name.'[hr]',
5605
  'title' => __('Hover CSS','post-grid'),
5606
  'details' => __('Set hover custom CSS.','post-grid'),
5607
  'type' => 'textarea',
5614
 
5615
  ob_start();
5616
  ?>
5617
+ <textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}</textarea>
 
5618
  <?php
5619
 
5620
  $html = ob_get_clean();
5629
  );
5630
 
5631
  $settings_tabs_field->generate_field($args);
5632
+
5633
+
5634
  ?>
5635
 
5636
  </div>
5639
 
5640
  }
5641
 
5642
+ add_action('post_grid_layout_element_hr', 'post_grid_layout_element_hr');
5643
 
5644
+ function post_grid_layout_element_hr($args){
5645
 
5646
+ $element = isset($args['element']) ? $args['element'] : array();
5647
+ $elementIndex = isset($args['index']) ? $args['index'] : '';
5648
+ $post_id = isset($args['post_id']) ? $args['post_id'] : '';
5649
 
5650
+ if(empty($post_id)) return;
5651
+
5652
+ $custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
5653
+ $link_target = isset($element['link_target']) ? $element['link_target'] : '';
5654
+ $wrapper_html = isset($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
5655
+ $height = isset($element['height']) ? $element['height'] : '';
5656
+ $background_color = isset($element['background_color']) ? $element['background_color'] : '';
5657
+
5658
+
5659
+ ?>
5660
+ <hr class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> hr "></hr>
5661
+ <?php
5662
+ }
5663
+
5664
+
5665
+ add_action('post_grid_layout_element_css_hr', 'post_grid_layout_element_css_hr', 10);
5666
+ function post_grid_layout_element_css_hr($args){
5667
+
5668
+
5669
+ $index = isset($args['index']) ? $args['index'] : '';
5670
+ $element = isset($args['element']) ? $args['element'] : array();
5671
+ $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
5672
+
5673
+ $height = isset($element['height']) ? $element['height'] : '1px';
5674
+
5675
+ $margin = isset($element['margin']) ? $element['margin'] : '';
5676
+ $background_color = isset($element['background_color']) ? $element['background_color'] : '';
5677
+ $css = isset($element['css']) ? $element['css'] : '';
5678
+ $css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
5679
+ ?>
5680
+ <style type="text/css">
5681
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
5682
+ <?php if(!empty($margin)): ?>
5683
+ margin: <?php echo $margin; ?>;
5684
+ <?php endif; ?>
5685
+ <?php if(!empty($background_color)): ?>
5686
+ background-color: <?php echo $background_color; ?>;
5687
+ <?php endif; ?>
5688
+ <?php if(!empty($height)): ?>
5689
+ padding: <?php echo $height; ?>;
5690
+ <?php endif; ?>
5691
+ <?php if(!empty($css)): ?>
5692
+ <?php echo $css; ?>
5693
+ <?php endif; ?>
5694
+ }
5695
+ <?php if(!empty($css_hover)): ?>
5696
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
5697
+ <?php echo $css_hover; ?>
5698
+ }
5699
+ <?php endif; ?>
5700
+ </style>
5701
+ <?php
5702
+ }
5703
+
5704
+
5705
+
5706
+ add_action('post_grid_layout_element_option_five_star','post_grid_layout_element_option_five_star');
5707
+ function post_grid_layout_element_option_five_star($parameters){
5708
 
5709
  $settings_tabs_field = new settings_tabs_field();
5710
 
5712
  $element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
5713
  $element_index = isset($parameters['index']) ? $parameters['index'] : '';
5714
 
 
 
 
 
5715
 
5716
+ $font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
5717
  $color = isset($element_data['color']) ? $element_data['color'] : '';
5718
  $margin = isset($element_data['margin']) ? $element_data['margin'] : '';
5719
  $text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
5720
 
 
 
 
5721
  $css = isset($element_data['css']) ? $element_data['css'] : '';
5722
  $css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
5723
 
5724
+
5725
  ?>
5726
  <div class="item">
5727
  <div class="element-title header ">
5728
  <span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
5729
  <span class="sort"><i class="fas fa-sort"></i></span>
5730
 
5731
+ <span class="expand"><?php echo __('Five star','post-grid'); ?></span>
5732
  </div>
5733
  <div class="element-options options">
5734
 
5735
  <?php
5736
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5737
 
 
5738
 
5739
  $args = array(
5740
  'id' => 'color',
5741
+ 'css_id' => $element_index.'_color',
5742
+ 'parent' => $input_name.'[five_star]',
5743
+ 'title' => __('Text color','post-grid'),
5744
+ 'details' => __('Choose text color.','post-grid'),
5745
  'type' => 'colorpicker',
5746
  'value' => $color,
5747
  'default' => '',
5749
 
5750
  $settings_tabs_field->generate_field($args);
5751
 
5752
+
5753
  $args = array(
5754
  'id' => 'font_size',
5755
  'css_id' => $element_index.'_font_size',
5756
+ 'parent' => $input_name.'[five_star]',
5757
  'title' => __('Font size','post-grid'),
5758
+ 'details' => __('Choose text font size.','post-grid'),
5759
  'type' => 'text',
5760
  'value' => $font_size,
5761
  'default' => '',
5762
+ 'placeholder' => '16px',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5763
  );
5764
 
5765
  $settings_tabs_field->generate_field($args);
5766
 
 
5767
  $args = array(
5768
  'id' => 'margin',
5769
  'css_id' => $element_index.'_margin',
5770
+ 'parent' => $input_name.'[five_star]',
5771
  'title' => __('Margin','post-grid'),
5772
+ 'details' => __('Choose margin.','post-grid'),
5773
  'type' => 'text',
5774
  'value' => $margin,
5775
  'default' => '',
5776
+ 'placeholder' => '5px 10px',
5777
  );
5778
 
5779
  $settings_tabs_field->generate_field($args);
5780
 
 
5781
  $args = array(
5782
  'id' => 'text_align',
5783
  'css_id' => $element_index.'_text_align',
5784
+ 'parent' => $input_name.'[five_star]',
5785
  'title' => __('Text align','post-grid'),
5786
  'details' => __('Choose text align.','post-grid'),
5787
  'type' => 'select',
5795
  $args = array(
5796
  'id' => 'css',
5797
  'css_id' => $element_index.'_css',
5798
+ 'parent' => $input_name.'[five_star]',
5799
  'title' => __('Custom CSS','post-grid'),
5800
  'details' => __('Set csutom CSS.','post-grid'),
5801
  'type' => 'textarea',
5809
  $args = array(
5810
  'id' => 'css_hover',
5811
  'css_id' => $element_index.'_css_hover',
5812
+ 'parent' => $input_name.'[five_star]',
5813
  'title' => __('Hover CSS','post-grid'),
5814
  'details' => __('Set hover custom CSS.','post-grid'),
5815
  'type' => 'textarea',
5820
 
5821
  $settings_tabs_field->generate_field($args);
5822
 
5823
+
5824
  ob_start();
5825
  ?>
5826
+ <textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}</textarea>
 
5827
  <?php
5828
 
5829
  $html = ob_get_clean();
5844
  </div>
5845
  </div>
5846
  <?php
5847
+
5848
+ }
5849
+
5850
+
5851
+ add_action('post_grid_layout_element_five_star', 'post_grid_layout_element_five_star');
5852
+
5853
+ function post_grid_layout_element_five_star($args){
5854
+
5855
+ $element = isset($args['element']) ? $args['element'] : array();
5856
+ $elementIndex = isset($args['index']) ? $args['index'] : '';
5857
+ $post_id = isset($args['post_id']) ? $args['post_id'] : '';
5858
+
5859
+ if(empty($post_id)) return;
5860
+
5861
+ $custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
5862
+ $star_count = isset($element['star_count']) ? $element['star_count'] : 5;
5863
+ $wrapper_html = isset($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
5864
+ $star_icon = isset($element['star_html']) ? $element['star_html'] : '';
5865
+
5866
+ $font_size = isset($element['font_size']) ? $element['font_size'] : '';
5867
+ $font_color = isset($element['color']) ? $element['color'] : '';
5868
+
5869
+
5870
+ if(empty($star_count)) return;
5871
+
5872
+ $load_fontawesome = !empty($post_grid_meta_options['load_fontawesome']) ? $post_grid_meta_options['load_fontawesome'] : 'no';
5873
+ $post_grid_settings = get_option('post_grid_settings');
5874
+ $font_aw_version = isset($post_grid_settings['font_aw_version']) ? $post_grid_settings['font_aw_version'] : '';
5875
+
5876
+ if(empty($star_icon)){
5877
+ if($font_aw_version == 'v_5'){
5878
+ $star_icon = '<i class="fas fa-star"></i>';
5879
+ }elseif ($font_aw_version =='v_4'){
5880
+ $star_icon = '<i class="fa fa-star"></i>';
5881
+ }
5882
+ }
5883
+
5884
+
5885
+
5886
+ $five_star_html = '';
5887
+
5888
+ for($i=1; $i<=$star_count; $i++){
5889
+
5890
+ $five_star_html.= $star_icon;
5891
+ }
5892
+
5893
+ ?>
5894
+ <div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> five_star ">
5895
+ <?php echo sprintf($wrapper_html, $five_star_html); ?>
5896
+ </div>
5897
+ <?php
5898
+ }
5899
+
5900
+
5901
+
5902
+ add_action('post_grid_layout_element_css_five_star', 'post_grid_layout_element_css_five_star', 10);
5903
+ function post_grid_layout_element_css_five_star($args){
5904
+
5905
+
5906
+ $index = isset($args['index']) ? $args['index'] : '';
5907
+ $element = isset($args['element']) ? $args['element'] : array();
5908
+ $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
5909
+
5910
+
5911
+ $font_size = isset($element['font_size']) ? $element['font_size'] : '';
5912
+ $color = isset($element['color']) ? $element['color'] : '';
5913
+ $margin = isset($element['margin']) ? $element['margin'] : '';
5914
+ $text_align = isset($element['text_align']) ? $element['text_align'] : '';
5915
+
5916
+ $css = isset($element['css']) ? $element['css'] : '';
5917
+ $css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
5918
+
5919
+ ?>
5920
+ <style type="text/css">
5921
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
5922
+ <?php if(!empty($color)): ?>
5923
+ color: <?php echo $color; ?>;
5924
+ <?php endif; ?>
5925
+ <?php if(!empty($font_size)): ?>
5926
+ font-size: <?php echo $font_size; ?>;
5927
+ <?php endif; ?>
5928
+ <?php if(!empty($margin)): ?>
5929
+ margin: <?php echo $margin; ?>;
5930
+ <?php endif; ?>
5931
+ <?php if(!empty($text_align)): ?>
5932
+ text-align: <?php echo $text_align; ?>;
5933
+ <?php endif; ?>
5934
+ <?php if(!empty($css)): ?>
5935
+ <?php echo $css; ?>
5936
+ <?php endif; ?>
5937
+ }
5938
+ <?php if(!empty($css_hover)): ?>
5939
+ .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
5940
+ <?php echo $css_hover; ?>
5941
+ }
5942
+ <?php endif; ?>
5943
+ </style>
5944
+ <?php
5945
  }
5946
+
5947
+
5948
+
5949
+
5950
+
5951
+
5952
+
includes/post-grid-meta-box.php DELETED
@@ -1,431 +0,0 @@
1
- <?php
2
- if ( ! defined('ABSPATH')) exit; // if direct access
3
-
4
-
5
- /**
6
- * Adds a box to the main column on the Post and Page edit screens.
7
- */
8
- function meta_boxes_post_grid(){
9
-
10
- $screens = array( 'post_grid' );
11
- global $post;
12
- $post_id = $post->ID;
13
-
14
-
15
-
16
-
17
- foreach ( $screens as $screen ){
18
- add_meta_box('post_grid_metabox',__('Post Grid Options', 'post-grid'),'meta_boxes_post_grid_input', $screen);
19
- add_meta_box('post_grid_metabox_side',__('Post Grid Information', 'post-grid'),'meta_boxes_post_grid_side', $screen,'side');
20
- }
21
-
22
-
23
-
24
- }
25
- add_action( 'add_meta_boxes', 'meta_boxes_post_grid' );
26
-
27
-
28
-
29
-
30
-
31
- function meta_boxes_post_grid_input( $post ) {
32
-
33
- global $post;
34
- wp_nonce_field( 'meta_boxes_post_grid_input', 'meta_boxes_post_grid_input_nonce' );
35
-
36
- $post_id = $post->ID;
37
- $post_grid_meta_options = get_post_meta($post_id, 'post_grid_meta_options', true);
38
-
39
- $grid_type = $post_types = !empty($post_grid_meta_options['grid_type']) ? $post_grid_meta_options['grid_type'] : 'grid';
40
-
41
- $current_tab = isset($post_grid_meta_options['current_tab']) ? $post_grid_meta_options['current_tab'] : 'query_post';
42
-
43
- $settings_tabs_field = new settings_tabs_field();
44
-
45
- $settings_tabs = array();
46
-
47
- //var_dump($current_tab);
48
- //var_dump($grid_type);
49
-
50
-
51
- $settings_tabs[] = array(
52
- 'id' => 'shortcode',
53
- 'title' => sprintf(__('%s Shortcode','post-grid'), '<i class="fas fa-laptop-code"></i>'),
54
- 'priority' => 5,
55
- 'active' => ($current_tab == 'shortcode') ? true : false,
56
- );
57
-
58
- $settings_tabs[] = array(
59
- 'id' => 'general',
60
- 'title' => sprintf(__('%s General','post-grid'), '<i class="fas fa-cogs"></i>'),
61
- 'priority' => 10,
62
- 'active' => ($current_tab == 'general') ? true : false,
63
- );
64
-
65
- $settings_tabs[] = array(
66
- 'id' => 'query_post',
67
- 'title' => sprintf(__('%s Query Post','post-grid'), '<i class="fas fa-cubes"></i>'),
68
- 'priority' => 15,
69
- 'active' => ($current_tab == 'query_post') ? true : false,
70
- );
71
-
72
- $settings_tabs[] = array(
73
- 'id' => 'skin_layout',
74
- 'title' => sprintf(__('%s Skin & Layout (Old)','post-grid'), '<i class="fas fa-magic"></i>'),
75
- 'priority' => 20,
76
- 'active' => ($current_tab == 'skin_layout') ? true : false,
77
- );
78
-
79
- $settings_tabs[] = array(
80
- 'id' => 'layouts',
81
- 'title' => sprintf(__('%s Layouts (New)','post-grid'),'<i class="fas fa-qrcode"></i>'),
82
- 'priority' => 30,
83
- 'active' => ($current_tab == 'layouts') ? true : false,
84
- );
85
-
86
-
87
-
88
- $settings_tabs[] = array(
89
- 'id' => 'grid_settings',
90
- 'title' => sprintf(__('%s Grid settings','post-grid'), '<i class="fas fa-th"></i>'),
91
- 'priority' => 35,
92
- 'active' => ($current_tab == 'grid_settings') ? true : false,
93
- 'data_visible' => 'grid',
94
- 'hidden' => ($grid_type == 'grid')? false : true ,
95
- );
96
-
97
- $settings_tabs[] = array(
98
- 'id' => 'item_style',
99
- 'title' => sprintf(__('%s Item style','post-grid'),'<i class="fas fa-qrcode"></i>'),
100
- 'priority' => 38,
101
- 'active' => ($current_tab == 'item_style') ? true : false,
102
- );
103
-
104
-
105
-
106
- $settings_tabs[] = array(
107
- 'id' => 'masonry',
108
- 'title' => sprintf(__('%s Masonry','post-grid'), '<i class="fas fa-th-large"></i>'),
109
- 'priority' => 40,
110
- 'active' => ($current_tab == 'masonry') ? true : false,
111
- 'data_visible' => 'grid glossary timeline filterable',
112
- 'hidden' => ($grid_type == 'slider')? true : false ,
113
- );
114
-
115
- $settings_tabs[] = array(
116
- 'id' => 'pagination',
117
- 'title' => sprintf(__('%s Pagination','post-grid'), '<i class="fas fa-pager"></i>'),
118
- 'priority' => 45,
119
- 'active' => ($current_tab == 'pagination') ? true : false,
120
- 'data_visible' => ' grid glossary timeline filterable collapsible',
121
- 'hidden' => ($grid_type == 'slider')? true : false ,
122
- );
123
-
124
- $settings_tabs[] = array(
125
- 'id' => 'custom_scripts',
126
- 'title' => sprintf(__('%s Custom Scripts','post-grid'), '<i class="fas fa-code"></i>'),
127
- 'priority' => 50,
128
- 'active' => ($current_tab == 'custom_scripts') ? true : false,
129
- );
130
-
131
- $settings_tabs[] = array(
132
- 'id' => 'search',
133
- 'title' => sprintf(__('%s Search','post-grid'), '<i class="fas fa-search"></i>'),
134
- 'priority' => 55,
135
- 'active' => ($current_tab == 'search') ? true : false,
136
- );
137
-
138
- $settings_tabs = apply_filters('post_grid_metabox_tabs', $settings_tabs);
139
-
140
- //var_dump($settings_tabs);
141
-
142
-
143
- $tabs_sorted = array();
144
- foreach ($settings_tabs as $page_key => $tab) $tabs_sorted[$page_key] = isset( $tab['priority'] ) ? $tab['priority'] : 0;
145
- array_multisort($tabs_sorted, SORT_ASC, $settings_tabs);
146
-
147
-
148
-
149
-
150
- //var_dump($current_tab);
151
-
152
-
153
-
154
- ?>
155
-
156
- <div class="post-grid-meta-box">
157
-
158
- <script>
159
- jQuery(document).ready(function($){
160
- $(document).on('click', '.settings-tabs input[name="post_grid_meta_options[grid_type]"]', function(){
161
- var val = $(this).val();
162
- console.log( val );
163
- $('.settings-tabs .tab-navs li').each(function( index ) {
164
- data_visible = $( this ).attr('data_visible');
165
- if(typeof data_visible != 'undefined'){
166
- n = data_visible.indexOf(val);
167
- if(n<0){
168
- $( this ).hide();
169
- }else{
170
- $( this ).show();
171
- }
172
- }else{
173
- console.log('Not matched: '+ data_visible );
174
- }
175
- });
176
- })
177
- })
178
- </script>
179
-
180
- <div class="settings-tabs vertical">
181
- <input class="current_tab" type="hidden" name="post_grid_meta_options[current_tab]" value="<?php echo $current_tab; ?>">
182
-
183
- <?php
184
-
185
-
186
- $args = array(
187
- 'id' => 'grid_type',
188
- 'parent' => 'post_grid_meta_options',
189
- 'title' => __('View Type','team'),
190
- 'details' => '',
191
- 'type' => 'radio',
192
- 'value' => $grid_type,
193
- 'default' => '',
194
- 'args' => apply_filters('post_grid_view_types', array('grid' => 'Normal grid' )),
195
- );
196
-
197
- $settings_tabs_field->generate_field($args);
198
-
199
- ?>
200
-
201
-
202
- <ul class="tab-navs">
203
- <?php
204
- foreach ($settings_tabs as $tab){
205
- $id = $tab['id'];
206
- $title = $tab['title'];
207
- $active = $tab['active'];
208
- $data_visible = isset($tab['data_visible']) ? $tab['data_visible'] : '';
209
- $hidden = isset($tab['hidden']) ? $tab['hidden'] : false;
210
- ?>
211
- <li <?php if(!empty($data_visible)): ?> data_visible="<?php echo $data_visible; ?>" <?php endif; ?> class="tab-nav <?php if($hidden) echo 'hidden';?> <?php if($active) echo 'active';?>" data-id="<?php echo $id; ?>"><?php echo $title; ?></li>
212
- <?php
213
- }
214
- ?>
215
- </ul>
216
- <?php
217
- foreach ($settings_tabs as $tab){
218
- $id = $tab['id'];
219
- $title = $tab['title'];
220
- $active = $tab['active'];
221
-
222
-
223
- ?>
224
-
225
- <div class="tab-content <?php if($active) echo 'active';?>" id="<?php echo $id; ?>">
226
- <?php
227
- do_action('post_grid_metabox_tabs_content_'.$id, $tab, $post_id);
228
- ?>
229
- </div>
230
- <?php
231
- }
232
- ?>
233
- </div>
234
- <div class="clear clearfix"></div>
235
-
236
- </div>
237
-
238
-
239
-
240
-
241
-
242
-
243
-
244
-
245
-
246
-
247
- <?php
248
-
249
-
250
-
251
- }
252
-
253
-
254
-
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>
333
-
334
- </ul>
335
-
336
- <h3>Try Pro</h3>
337
- <a class="button" href="https://www.pickplugins.com/item/post-grid-create-awesome-grid-from-any-post-type-for-wordpress/?ref=dashboard" target="_blank">Buy Pro</a><p class="description">If you are looking some extra feature you may try our premium version.</p>
338
-
339
- <h3>Documentation</h3>
340
- <a class="button" href="https://www.pickplugins.com/documentation/post-grid/?ref=dashboard" target="_blank">Documentation</a><p class="description">Before asking, submitting reviews please take a look on our documentation, may help your issue fast.</p>
341
-
342
- <h3>Looking for support?</h3>
343
- <a class="button" href="https://www.pickplugins.com/forum/?ref=dashboard" target="_blank">Create Support Ticket</a><p class="description">Its free and you can ask any question about our plugins and get support fast.</p>
344
-
345
- <h3>Provide your feedback</h3>
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
-
352
- <h3>Video Tutorials</h3>
353
- <p class="description">Some tutorial contain pro features.</p>
354
- <div class="faq">
355
- <?php
356
-
357
-
358
- ?>
359
-
360
- </div>
361
-
362
-
363
-
364
-
365
-
366
-
367
-
368
-
369
-
370
-
371
- </div>
372
- <?php
373
-
374
- }
375
-
376
-
377
-
378
-
379
-
380
-
381
-
382
-
383
- /**
384
- * When the post is saved, saves our custom data.
385
- *
386
- * @param int $post_id The ID of the post being saved.
387
- */
388
-
389
-
390
-
391
- function meta_boxes_post_grid_save( $post_id ) {
392
-
393
- /*
394
- * We need to verify this came from the our screen and with proper authorization,
395
- * because save_post can be triggered at other times.
396
- */
397
-
398
- // Check if our nonce is set.
399
- if ( ! isset( $_POST['meta_boxes_post_grid_input_nonce'] ) )
400
- return $post_id;
401
-
402
- $nonce = $_POST['meta_boxes_post_grid_input_nonce'];
403
-
404
- // Verify that the nonce is valid.
405
- if ( ! wp_verify_nonce( $nonce, 'meta_boxes_post_grid_input' ) )
406
- return $post_id;
407
-
408
- // If this is an autosave, our form has not been submitted, so we don't want to do anything.
409
- if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
410
- return $post_id;
411
-
412
-
413
-
414
- /* OK, its safe for us to save the data now. */
415
-
416
- // Sanitize user input.
417
- //$post_grid_collapsible = sanitize_text_field( $_POST['post_grid_collapsible'] );
418
-
419
-
420
- $post_grid_meta_options = stripslashes_deep( $_POST['post_grid_meta_options'] );
421
- update_post_meta( $post_id, 'post_grid_meta_options', $post_grid_meta_options );
422
-
423
-
424
-
425
-
426
-
427
- }
428
- add_action( 'save_post', 'meta_boxes_post_grid_save' );
429
-
430
-
431
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/{functions/functions-settings-hook.php → settings-hook.php} RENAMED
@@ -10,8 +10,10 @@ function post_grid_settings_content_general(){
10
 
11
  $font_aw_version = isset($post_grid_settings['font_aw_version']) ? $post_grid_settings['font_aw_version'] : 'none';
12
  $post_grid_preview = isset($post_grid_settings['post_grid_preview']) ? $post_grid_settings['post_grid_preview'] : 'yes';
 
13
 
14
  //echo '<pre>'.var_export($post_grid_settings, true).'</pre>';
 
15
 
16
  ?>
17
  <div class="section">
@@ -20,7 +22,19 @@ function post_grid_settings_content_general(){
20
 
21
  <?php
22
 
 
 
 
 
 
 
 
 
 
 
 
23
 
 
24
 
25
  $args = array(
26
  'id' => 'font_aw_version',
@@ -155,6 +169,34 @@ if(!function_exists('post_grid_settings_content_help_support')) {
155
 
156
 
157
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
158
 
159
 
160
  add_action('post_grid_settings_content_buy_pro', 'post_grid_settings_content_buy_pro');
@@ -198,6 +240,79 @@ if(!function_exists('post_grid_settings_content_buy_pro')) {
198
  </tr>
199
 
200
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
201
 
202
  <tr>
203
  <th class="col-features"><?php echo __('Features','post-grid'); ?></th>
10
 
11
  $font_aw_version = isset($post_grid_settings['font_aw_version']) ? $post_grid_settings['font_aw_version'] : 'none';
12
  $post_grid_preview = isset($post_grid_settings['post_grid_preview']) ? $post_grid_settings['post_grid_preview'] : 'yes';
13
+ $post_options_post_types = isset($post_grid_settings['post_options_post_types']) ? $post_grid_settings['post_options_post_types'] : array();
14
 
15
  //echo '<pre>'.var_export($post_grid_settings, true).'</pre>';
16
+ $posttypes_array = post_grid_posttypes_array();
17
 
18
  ?>
19
  <div class="section">
22
 
23
  <?php
24
 
25
+ $args = array(
26
+ 'id' => 'post_options_post_types',
27
+ 'parent' => 'post_grid_settings',
28
+ 'title' => __('Post option by post types','post-grid'),
29
+ 'details' => __('Enable post options for selected post types','post-grid'),
30
+ 'type' => 'select',
31
+ 'value' => $post_options_post_types,
32
+ 'default' => array(),
33
+ 'multiple' => true,
34
+ 'args' => $posttypes_array,
35
+ );
36
 
37
+ $settings_tabs_field->generate_field($args);
38
 
39
  $args = array(
40
  'id' => 'font_aw_version',
169
 
170
 
171
 
172
+ add_action('post_grid_settings_content_templates', 'post_grid_settings_content_templates');
173
+
174
+ if(!function_exists('post_grid_settings_content_templates')) {
175
+ function post_grid_settings_content_templates($tab){
176
+
177
+ $settings_tabs_field = new settings_tabs_field();
178
+
179
+ ?>
180
+ <div class="section">
181
+ <div class="section-title"><?php echo __('Templates', 'post-grid'); ?></div>
182
+ <p class="description section-description"><?php echo __('Choose page templates for various page.', 'post-grid'); ?></p>
183
+
184
+ <?php
185
+
186
+
187
+
188
+
189
+ ?>
190
+
191
+
192
+ </div>
193
+ <?php
194
+
195
+
196
+ }
197
+ }
198
+
199
+
200
 
201
 
202
  add_action('post_grid_settings_content_buy_pro', 'post_grid_settings_content_buy_pro');
240
  </tr>
241
 
242
 
243
+ <tr>
244
+ <td colspan="3" class="col-features"><b><?php echo __('3rd Party Plugins','post-grid'); ?></b> </td>
245
+ </tr>
246
+
247
+ <tr>
248
+ <td class="col-features"><?php echo __('kk Star Ratings','post-grid'); ?> </td>
249
+ <td><i class="fas fa-check"></i></td>
250
+ <td><i class="fas fa-check"></i></td>
251
+ </tr>
252
+
253
+ <tr>
254
+ <td class="col-features"><?php echo __('Multi Rating','post-grid'); ?> </td>
255
+ <td><i class="fas fa-check"></i></td>
256
+ <td><i class="fas fa-check"></i></td>
257
+ </tr>
258
+ <tr>
259
+ <td class="col-features"><?php echo __('Rate my Post','post-grid'); ?> </td>
260
+ <td><i class="fas fa-check"></i></td>
261
+ <td><i class="fas fa-check"></i></td>
262
+ </tr>
263
+ <tr>
264
+ <td class="col-features"><?php echo __('Rating-Widget','post-grid'); ?> </td>
265
+ <td><i class="fas fa-check"></i></td>
266
+ <td><i class="fas fa-check"></i></td>
267
+ </tr>
268
+ <tr>
269
+ <td class="col-features"><?php echo __('WP-PostRatings','post-grid'); ?> </td>
270
+ <td><i class="fas fa-check"></i></td>
271
+ <td><i class="fas fa-check"></i></td>
272
+ </tr>
273
+ <tr>
274
+ <td class="col-features"><?php echo __('Yasr – Yet Another Stars Rating','post-grid'); ?> </td>
275
+ <td><i class="fas fa-check"></i></td>
276
+ <td><i class="fas fa-check"></i></td>
277
+ </tr>
278
+ <tr>
279
+ <td class="col-features"><?php echo __('YITH - Add to Wishlist','post-grid'); ?> </td>
280
+ <td><i class="fas fa-check"></i></td>
281
+ <td><i class="fas fa-check"></i></td>
282
+ </tr>
283
+
284
+ <tr>
285
+ <td class="col-features"><?php echo __('Advanced Custom Fields','post-grid'); ?> </td>
286
+ <td><i class="fas fa-times"></i></td>
287
+ <td><i class="fas fa-check"></i></td>
288
+ </tr>
289
+ <tr>
290
+ <td class="col-features"><?php echo __('Easy Digital Download','post-grid'); ?> </td>
291
+ <td><i class="fas fa-times"></i></td>
292
+ <td><i class="fas fa-check"></i></td>
293
+ </tr>
294
+ <tr>
295
+ <td class="col-features"><?php echo __('WooCommerce','post-grid'); ?> </td>
296
+ <td><i class="fas fa-times"></i></td>
297
+ <td><i class="fas fa-check"></i></td>
298
+ </tr>
299
+
300
+
301
+
302
+
303
+
304
+
305
+
306
+
307
+
308
+
309
+
310
+
311
+
312
+
313
+
314
+
315
+
316
 
317
  <tr>
318
  <th class="col-features"><?php echo __('Features','post-grid'); ?></th>
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.57
7
  Author: PickPlugins
8
  Author URI: https://www.pickplugins.com/
9
  License: GPLv2 or later
@@ -21,33 +21,36 @@ 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.57');
 
 
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');
35
- include('includes/class-metabox-post-grid-layout-hook.php');
36
- include('includes/functions-layout-hook.php');
37
  include('includes/functions-data-upgrade.php');
38
  include('includes/functions-single.php');
39
 
40
 
41
  include('includes/classes/class-post-grid-support.php');
42
  include('includes/data-update/class-post-grid-data-update.php');
43
- include('includes/class-functions.php');
44
- include('includes/class-shortcodes.php');
45
- include('includes/class-settings.php');
46
- include('includes/class-post-grid-meta-box.php');
47
- include('includes/class-settings-tabs.php');
48
- include('includes/functions/functions-post-grid-meta-box.php');
49
- include('includes/post-grid-meta-box.php');
50
- include('includes/functions/functions-post-grid.php');
51
  include('includes/functions.php');
52
  include('includes/shortcodes/shortcode-current_user_id.php');
53
 
@@ -136,7 +139,6 @@ if( !class_exists( 'PostGrid' )){
136
  wp_register_style('font-awesome-4', post_grid_plugin_url.'assets/global/css/font-awesome-4.css');
137
  wp_register_style('font-awesome-5', post_grid_plugin_url.'assets/global/css/font-awesome-5.css');
138
 
139
- wp_register_style('jquery-ui', post_grid_plugin_url.'assets/frontend/css/jquery-ui.css');
140
 
141
  }
142
 
@@ -154,6 +156,7 @@ if( !class_exists( 'PostGrid' )){
154
 
155
  wp_enqueue_style('post_grid_skin', post_grid_plugin_url . 'assets/global/css/style.skins.css');
156
 
 
157
 
158
  wp_register_style('font-awesome-4', post_grid_plugin_url.'assets/global/css/font-awesome-4.css');
159
  wp_register_style('font-awesome-5', post_grid_plugin_url.'assets/global/css/font-awesome-5.css');
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.58
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.58');
25
+
26
+
27
 
28
  include('includes/classes/class-post-types.php');
29
+ include('includes/classes/class-meta-boxes.php');
30
+ include('includes/classes/class-functions.php');
31
+ include('includes/classes/class-shortcodes.php');
32
+ include('includes/classes/class-settings.php');
33
+ include('includes/classes/class-settings-tabs.php');
34
+
35
+ include('includes/metabox-post-grid-layout-hook.php');
36
+ include('includes/metabox-post-grid-hook.php');
37
+ include('includes/metabox-post-options-hook.php');
38
+
39
+ include('includes/settings-hook.php');
40
  include('templates/post-grid-hook.php');
41
+ include('includes/post-grid-layout-elements.php');
42
+ include('includes/media-source-options.php');
43
  include('includes/layout-elements/3rd-party.php');
44
 
45
 
 
 
 
46
  include('includes/functions-data-upgrade.php');
47
  include('includes/functions-single.php');
48
 
49
 
50
  include('includes/classes/class-post-grid-support.php');
51
  include('includes/data-update/class-post-grid-data-update.php');
52
+
53
+ include('includes/functions-post-grid.php');
 
 
 
 
 
 
54
  include('includes/functions.php');
55
  include('includes/shortcodes/shortcode-current_user_id.php');
56
 
139
  wp_register_style('font-awesome-4', post_grid_plugin_url.'assets/global/css/font-awesome-4.css');
140
  wp_register_style('font-awesome-5', post_grid_plugin_url.'assets/global/css/font-awesome-5.css');
141
 
 
142
 
143
  }
144
 
156
 
157
  wp_enqueue_style('post_grid_skin', post_grid_plugin_url . 'assets/global/css/style.skins.css');
158
 
159
+ wp_register_style('jquery-ui', post_grid_plugin_url.'assets/admin/css/jquery-ui.css');
160
 
161
  wp_register_style('font-awesome-4', post_grid_plugin_url.'assets/global/css/font-awesome-4.css');
162
  wp_register_style('font-awesome-5', post_grid_plugin_url.'assets/global/css/font-awesome-5.css');
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.57
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -83,9 +83,6 @@ content, Empty thumbnail
83
 
84
  ###Premium features
85
 
86
- * Filterable Grid by custom taxonomy & terms and custom filter.
87
- * Post grid for Archive page(category.php, tags.php, search.php, author.php, custom taxonomy & terms page).
88
-
89
  **View Type**
90
 
91
  * Filterable
@@ -93,6 +90,14 @@ content, Empty thumbnail
93
  * Carousel Slider
94
  * Collapsible
95
 
 
 
 
 
 
 
 
 
96
  **Advance Pagination types**
97
 
98
  * Ajax Pagination
@@ -100,6 +105,8 @@ content, Empty thumbnail
100
  * Filterable pagination
101
  * Ajax Load More
102
 
 
 
103
  **Advance Media Sources**
104
 
105
  * First youtube video from content
@@ -199,6 +206,20 @@ Advanced Custom Fields is #1 custom field's plugin for WordPress and we added fu
199
  * Datetime picker
200
  * Google Map
201
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
202
 
203
 
204
  **The Events Calendar**
@@ -239,6 +260,8 @@ Events Manager is another best event's manager plugin for WordPress and we added
239
 
240
 
241
 
 
 
242
  <strong>Video Tutorial(with premium version interface)</strong>
243
 
244
  * [All tutorials](https://www.youtube.com/watch?v=RKb-B_Q72Ak&list=PL2GPPfgLrfWxAZBQc10XCh5wzDSOfPrKB)
@@ -273,6 +296,13 @@ then paste this shortcode anywhere in your page to display grid<br />
273
 
274
  == Changelog ==
275
 
 
 
 
 
 
 
 
276
  = 2.0.57 =
277
  * 2020-05-15 fix - masonry center align issue fixed.
278
  * 2020-05-15 add - media link target option added.
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.58
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
83
 
84
  ###Premium features
85
 
 
 
 
86
  **View Type**
87
 
88
  * Filterable
90
  * Carousel Slider
91
  * Collapsible
92
 
93
+ **Post grid for Archives**
94
+
95
+ * category.php
96
+ * tags.php
97
+ * search.php
98
+ * author.php
99
+ * Custom taxonomy & terms page
100
+
101
  **Advance Pagination types**
102
 
103
  * Ajax Pagination
105
  * Filterable pagination
106
  * Ajax Load More
107
 
108
+
109
+
110
  **Advance Media Sources**
111
 
112
  * First youtube video from content
206
  * Datetime picker
207
  * Google Map
208
 
209
+ **Custom Field Suite**
210
+ Custom Field Suite is another best custom field's plugin for WordPress and we added full support to display following meta fields for any post types.
211
+
212
+ * Text
213
+ * Textarea
214
+ * Link
215
+ * Taxonomy
216
+ * User
217
+ * Relationship
218
+ * File
219
+ * Wysiwyg
220
+ * Select
221
+ * True / False
222
+ * Date picker
223
 
224
 
225
  **The Events Calendar**
260
 
261
 
262
 
263
+
264
+
265
  <strong>Video Tutorial(with premium version interface)</strong>
266
 
267
  * [All tutorials](https://www.youtube.com/watch?v=RKb-B_Q72Ak&list=PL2GPPfgLrfWxAZBQc10XCh5wzDSOfPrKB)
296
 
297
  == Changelog ==
298
 
299
+ = 2.0.58 =
300
+ * 2020-05-19 add - Element added for "Like Button Rating" plugin
301
+ * 2020-05-19 add - Element added for "WP-PostViews" plugin
302
+ * 2020-05-19 add - Element added for "Post Views Counter" plugin
303
+ * 2020-05-19 add - Element added for "Page Views Count" plugin
304
+ * 2020-05-19 add - Element added for "Page Visit Counter" plugin
305
+
306
  = 2.0.57 =
307
  * 2020-05-15 fix - masonry center align issue fixed.
308
  * 2020-05-15 add - media link target option added.
templates/custom-css.php DELETED
@@ -1,361 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * @Author pickplugins
5
- * Copyright: 2015 pickplugins.com
6
- */
7
-
8
- if ( ! defined('ABSPATH')) exit; // if direct access
9
-
10
-
11
- $class_post_grid_functions = new class_post_grid_functions();
12
- $items_bg_color_values = $class_post_grid_functions->items_bg_color_values();
13
-
14
- //var_dump($items_bg_color_values);
15
-
16
-
17
- $post_grid_layout_content = get_option( 'post_grid_layout_content' );
18
-
19
- if(empty($post_grid_layout_content)){
20
- $layout = $class_post_grid_functions->layout_content($layout_content);
21
- }
22
- else{
23
-
24
- if(!empty($post_grid_layout_content[$layout_content])){
25
- $layout = $post_grid_layout_content[$layout_content];
26
- }
27
- else{
28
- $layout =array();
29
- }
30
-
31
-
32
- }
33
-
34
- ?>
35
- <style type="text/css">
36
- <?php
37
-
38
- foreach($layout as $item_id=>$item_info){
39
- $item_css = $item_info['css'];
40
- $item_key = $item_info['key'];
41
-
42
- //var_dump($item_key);
43
-
44
- if($item_key=='categories' || $item_key=='tags'){
45
-
46
- ?>
47
- #post-grid-<?php echo $grid_id; ?> .element_<?php echo $item_id; ?> a{<?php echo $item_css; ?>}
48
- <?php
49
-
50
- }
51
-
52
- elseif($item_key=='down_arrow'){
53
-
54
- //var_dump($item_info);
55
-
56
- $arrow_size = $item_info['arrow_size'];
57
- $arrow_bg_color = $item_info['arrow_bg_color'];
58
-
59
- ?>
60
- #post-grid-<?php echo $grid_id; ?> .element_<?php echo $item_id; ?>{<?php echo $item_css; ?>}
61
-
62
- #post-grid-<?php echo $grid_id; ?> .element_<?php echo $item_id; ?>{
63
-
64
-
65
- border-left: <?php echo $arrow_size; ?> solid rgba(0, 0, 0, 0);
66
- border-right: <?php echo $arrow_size; ?> solid rgba(0, 0, 0, 0);
67
- border-top: <?php echo $arrow_size; ?> solid <?php echo $arrow_bg_color; ?>;
68
- height: 0;
69
- width: 0;
70
-
71
-
72
- }
73
-
74
-
75
- <?php
76
-
77
- ?>
78
-
79
- <?php
80
-
81
-
82
-
83
- }
84
-
85
-
86
- elseif($item_key=='up_arrow'){
87
-
88
- //var_dump($item_info);
89
-
90
- $arrow_size = $item_info['arrow_size'];
91
- $arrow_bg_color = $item_info['arrow_bg_color'];
92
-
93
- ?>
94
- #post-grid-<?php echo $grid_id; ?> .element_<?php echo $item_id; ?>{<?php echo $item_css; ?>}
95
-
96
- #post-grid-<?php echo $grid_id; ?> .element_<?php echo $item_id; ?>{
97
-
98
-
99
- border-bottom: <?php echo $arrow_size; ?> solid <?php echo $arrow_bg_color; ?>;
100
- border-left: <?php echo $arrow_size; ?> solid transparent;
101
- border-right: <?php echo $arrow_size; ?> solid transparent;
102
- height: 0;
103
- width: 0;
104
-
105
-
106
- }
107
-
108
-
109
- <?php
110
-
111
-
112
-
113
- }
114
-
115
-
116
-
117
-
118
- else{
119
-
120
- ?>
121
- #post-grid-<?php echo $grid_id; ?> .element_<?php echo $item_id; ?>{<?php echo $item_css; ?>}
122
- <?php
123
-
124
-
125
- }
126
-
127
-
128
-
129
- }
130
-
131
- foreach($layout as $item_id=>$item_info){
132
- $item_css_hover = $item_info['css_hover'];
133
-
134
- echo '#post-grid-'.$grid_id.' .element_'.$item_id.':hover{'.$item_css_hover.'}';
135
-
136
- }
137
-
138
- if($items_bg_color_type=='fixed'){
139
-
140
- echo '#post-grid-'.$grid_id.' .item{
141
- background:'.$items_bg_color.';
142
-
143
- }';
144
-
145
- }
146
- elseif($items_bg_color_type=='random'){
147
-
148
- $max_count = count($items_bg_color_values);
149
- $max_count = ($max_count - 1);
150
-
151
- $i=0;
152
- foreach($items_bg_color_values as $value){
153
-
154
-
155
- $rand = rand(0,$max_count);
156
- echo '#post-grid-'.$grid_id.' .item:nth-child('.$i.'){
157
- background:'.$items_bg_color_values[$rand].';
158
-
159
- }';
160
-
161
- $i++;
162
- }
163
-
164
-
165
-
166
- }
167
-
168
-
169
-
170
- echo '</style>';
171
-
172
-
173
-
174
-
175
-
176
-
177
-
178
- if(!empty($custom_css)){
179
- echo '<style type="text/css">'.$custom_css.'</style>';
180
- }
181
-
182
- echo '<style type="text/css">';
183
-
184
-
185
- echo '#post-grid-'.$grid_id.' .pagination .page-numbers, #post-grid-'.$grid_id.' .pagination .pager, #post-grid-'.$grid_id.' .paginate.next-previous a{
186
-
187
- font-size:'.$pagination_font_size.';
188
- color:'.$pagination_font_color.';
189
- background:'.$pagination_bg_color.';
190
-
191
-
192
- }';
193
-
194
-
195
-
196
- echo '#post-grid-'.$grid_id.' .pagination .page-numbers:hover, #post-grid-'.$grid_id.' .pagination .page-numbers.current, #post-grid-'.$grid_id.' .pagination .pager.active{
197
- background:'.$pagination_active_bg_color.';
198
- }';
199
-
200
-
201
-
202
-
203
- echo '#post-grid-'.$grid_id.' {
204
- padding:'.$container_padding.';
205
- background: '.$container_bg_color.' url('.$container_bg_image.') repeat scroll 0 0;
206
- }';
207
-
208
-
209
-
210
-
211
-
212
- if($items_media_height_style == 'auto_height'){
213
- $items_media_height = 'auto';
214
- }elseif($items_media_height_style == 'fixed_height'){
215
- $items_media_height = $items_media_fixed_height;
216
- }elseif($items_media_height_style == 'max_height'){
217
- $items_media_height = $items_media_fixed_height;
218
- }else{
219
- $items_media_height = '220px';
220
- }
221
-
222
-
223
-
224
-
225
-
226
-
227
-
228
-
229
-
230
- echo '#post-grid-'.$grid_id.' .item .layer-media{';
231
-
232
- if($items_media_height_style == 'fixed_height' || $items_media_height_style == 'auto_height'){
233
- echo 'height:'.$items_media_height.';';
234
- }elseif($items_media_height_style=='max_height'){
235
- echo 'max-height:'.$items_media_height.';';
236
- }else{
237
- echo 'height:'.$items_media_height.';';
238
- }
239
-
240
- echo 'overflow: hidden;
241
- }';
242
-
243
-
244
-
245
- if($items_height_style == 'auto_height'){
246
- $items_height = 'auto';
247
- }
248
- elseif($items_height_style == 'fixed_height'){
249
- $items_height = $items_fixed_height;
250
- }
251
-
252
- elseif($items_height_style == 'max_height'){
253
- $items_height = $items_fixed_height;
254
- }
255
-
256
- else{
257
- $items_height = '220px';
258
- }
259
-
260
-
261
-
262
-
263
-
264
- echo '#post-grid-'.$grid_id.' .item{
265
- margin:'.$items_margin.';
266
- padding:'.$item_padding.';
267
- ';
268
-
269
- echo '}';
270
-
271
-
272
- echo '@media only screen and (min-width: 1024px ) {';
273
-
274
- echo '#post-grid-'.$grid_id.' .item{';
275
-
276
- if($items_height_style == 'fixed_height'){
277
- echo 'height:'.$items_height.';';
278
- }elseif($items_height_style=='max_height'){
279
- echo 'max-height:'.$items_height.';';
280
- }elseif($items_height_style=='auto_height'){
281
- echo 'height:auto;';
282
- }else{
283
- echo 'height:auto;';
284
- }
285
-
286
-
287
- echo '}';
288
- echo '}';
289
-
290
-
291
-
292
- echo '@media only screen and ( min-width: 768px ) and ( max-width: 1023px ) {';
293
-
294
- echo '#post-grid-'.$grid_id.' .item{';
295
-
296
- if($items_height_style_tablet == 'fixed_height'){
297
- echo 'height:'.$items_fixed_height_tablet.';';
298
- }elseif($items_height_style_tablet=='max_height'){
299
- echo 'max-height:'.$items_fixed_height_tablet.';';
300
- }elseif($items_height_style_tablet=='auto_height'){
301
- echo 'max-height:auto;';
302
- }else{
303
- echo 'height:auto;';
304
- }
305
-
306
-
307
- echo '}';
308
- echo '}';
309
-
310
-
311
-
312
- echo '@media only screen and ( min-width: 0px ) and ( max-width: 767px ){';
313
-
314
- echo '#post-grid-'.$grid_id.' .item{';
315
-
316
- if($items_height_style_mobile == 'fixed_height'){
317
- echo 'height:'.$items_fixed_height_mobile.';';
318
- }elseif($items_height_style_mobile=='max_height'){
319
- echo 'max-height:'.$items_fixed_height_mobile.';';
320
- }elseif($items_height_style_mobile == 'auto_height'){
321
- echo 'height:auto;';
322
- }else{
323
- echo 'height:auto;';
324
- }
325
-
326
-
327
- echo '}';
328
- echo '}';
329
-
330
-
331
-
332
-
333
-
334
- if($grid_type!='slider'){
335
-
336
-
337
-
338
-
339
-
340
- echo '
341
- @media only screen and (min-width: 1024px ) {
342
- #post-grid-'.$grid_id.' .item{width:'.$items_width_desktop.'}
343
-
344
- }
345
-
346
- @media only screen and ( min-width: 768px ) and ( max-width: 1023px ) {
347
- #post-grid-'.$grid_id.' .item{width:'.$items_width_tablet.'}
348
- }
349
-
350
- @media only screen and ( max-width: 767px ) {
351
- #post-grid-'.$grid_id.' .item{width:'.$items_width_mobile.'}
352
- }';
353
-
354
- }
355
-
356
-
357
-
358
-
359
-
360
- ?>
361
- </style>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
templates/custom-js.php DELETED
@@ -1,15 +0,0 @@
1
- <?php
2
- /*
3
- * @Author pickplugins
4
- * Copyright: 2015 pickplugins.com
5
- */
6
-
7
- if ( ! defined('ABSPATH')) exit; // if direct access
8
-
9
-
10
- ?>
11
-
12
- <script>
13
- <?php echo $custom_js; ?>
14
-
15
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
templates/layer-content.php DELETED
@@ -1,397 +0,0 @@
1
- <?php
2
- /*
3
- * @Author pickplugins
4
- * Copyright: 2015 pickplugins.com
5
- */
6
-
7
- if ( ! defined('ABSPATH')) exit; // if direct access
8
-
9
- $class_post_grid_functions = new class_post_grid_functions();
10
-
11
- $post_grid_layout_content = get_option( 'post_grid_layout_content' );
12
-
13
- if(empty($post_grid_layout_content)){
14
- $layout = $class_post_grid_functions->layout_content($layout_content);
15
- }
16
- else{
17
-
18
- if(!empty($post_grid_layout_content[$layout_content])){
19
- $layout = $post_grid_layout_content[$layout_content];
20
-
21
- }
22
- else{
23
- $layout = array();
24
- }
25
- }
26
-
27
-
28
- $item_post_permalink = apply_filters('post_grid_item_post_permalink', get_permalink($item_post_id));
29
-
30
-
31
- //var_dump(get_the_ID());
32
-
33
-
34
- echo'<div class="layer-content">';
35
-
36
- $active_plugins = get_option('active_plugins');
37
-
38
- foreach($layout as $item_id=>$item_info){
39
-
40
- $item_key = $item_info['key'];
41
- //$layout_items_html = $class_post_grid_functions->layout_items_html($item_id, $item_info );
42
-
43
-
44
-
45
- //var_dump($item_info);
46
-
47
-
48
- $item_key = $item_info['key'];
49
-
50
- if(!empty($item_info['char_limit'])){
51
- $char_limit = $item_info['char_limit'];
52
- }
53
- else{
54
-
55
- $char_limit = 10;
56
-
57
- }
58
-
59
-
60
- if(!empty($item_info['custom_class'])){
61
- $custom_class = $item_info['custom_class'];
62
- }
63
- else{
64
-
65
- $custom_class = '';
66
-
67
- }
68
-
69
-
70
- if(!empty($item_info['taxonomy'])){
71
- $taxonomy = $item_info['taxonomy'];
72
- }
73
- else{
74
- $taxonomy = '';
75
- }
76
-
77
- if(!empty($item_info['taxonomy_term_count'])){
78
- $taxonomy_term_count = $item_info['taxonomy_term_count'];
79
- }
80
- else{
81
- $taxonomy_term_count = '';
82
- }
83
-
84
- //var_dump($taxonomy_term_count);
85
-
86
-
87
- if(!empty($item_info['field_id'])){
88
- $field_id = $item_info['field_id'];
89
- }
90
- else{
91
- $field_id = '';
92
- }
93
-
94
- //var_dump($field_id);
95
-
96
-
97
-
98
-
99
-
100
-
101
-
102
-
103
-
104
- if(!empty($item_info['link_target'])){
105
- $link_target = $item_info['link_target'];
106
- }
107
- else{
108
- $link_target = '_blank';
109
- }
110
-
111
- if(!empty($item_info['read_more_text'])){
112
- $read_more_text = $item_info['read_more_text'];
113
-
114
- //var_dump($read_more_text);
115
- }
116
- else{
117
-
118
- $read_more_text = apply_filters('post_grid_filter_grid_item_read_more', __('Read more.', 'post-grid'));
119
-
120
-
121
- }
122
-
123
-
124
-
125
-
126
- $item['title'] = '<div class="element element_'.$item_id.' '.$item_key.' '.$custom_class.'" >'.apply_filters('post_grid_filter_grid_item_title',wp_trim_words(get_the_title($item_post_id), $char_limit,'')).'</div>';
127
-
128
-
129
- //$item['title'] = '<div class="element element_'.$item_id.' '.$item_key.'" >'.get_the_ID().'</div>';
130
-
131
- $item['title_link'] = '<a target="'.$link_target.'" class="element element_'.$item_id.' '.$item_key.' '.$custom_class.'" href="'.$item_post_permalink.'">'.apply_filters('post_grid_filter_grid_item_title',wp_trim_words(get_the_title($item_post_id), $char_limit,'')).'</a>';
132
-
133
- //$post_content = apply_filters('the_content', get_the_content($item_post_id));
134
- $post_content = wpautop(get_the_content($item_post_id));
135
-
136
- $item['content'] = '<div class="element element_'.$item_id.' '.$item_key.' '.$custom_class.'" >'.apply_filters('post_grid_filter_grid_item_content', $post_content).'</div>';
137
-
138
-
139
- $excerpt_removed_shortcode = preg_replace( '|\[(.+?)\](.+?\[/\\1\])?|s', '', strip_shortcodes(get_the_excerpt($item_post_id)));
140
-
141
-
142
- //$excerpt_post = get_post($item_post_id);
143
- //$excerpt_post_post_excerpt = $excerpt_post->post_excerpt;
144
-
145
-
146
- $item['excerpt'] = '<div class="element element_'.$item_id.' '.$item_key.' '.$custom_class.'" >'.apply_filters('post_grid_filter_grid_item_excerpt',wp_trim_words($excerpt_removed_shortcode, $char_limit,'')).'</div>';
147
-
148
-
149
- $read_more_text = $read_more_text;
150
-
151
-
152
- $item['excerpt_read_more'] = '<div class="element element_'.$item_id.' '.$item_key.' '.$custom_class.'" >'.wp_trim_words(strip_shortcodes(get_the_excerpt($item_post_id)), $char_limit,'').' <a target="'.$link_target.'" class="read-more" href="'.$item_post_permalink.'">'.$read_more_text.'</a></div>';
153
-
154
-
155
-
156
- $item['read_more'] = '<a target="'.$link_target.'" class="element element_'.$item_id.' '.$item_key.' '.$custom_class.'" href="'.$item_post_permalink.'">'.$read_more_text.'</a>';
157
-
158
-
159
- $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($item_post_id), 'full' );
160
-
161
- if(!empty($thumb['0'])){
162
- $thumb_url = $thumb['0'];
163
-
164
- }
165
- else{
166
- $thumb_url = post_grid_plugin_url.'assets/frontend/css/images/placeholder.png';
167
- }
168
-
169
- $item['thumb'] = '<div class="element element_'.$item_id.' '.$item_key.' '.$custom_class.'" ><img src="'.$thumb_url.'" /></div>';
170
-
171
-
172
-
173
- $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($item_post_id), 'full' );
174
-
175
-
176
- if(!empty($thumb['0'])){
177
- $thumb_url = $thumb['0'];
178
-
179
- }
180
- else{
181
- $thumb_url = post_grid_plugin_url.'assets/frontend/css/images/placeholder.png';
182
- }
183
-
184
-
185
-
186
- $item['thumb_link'] = '<div class="element element_'.$item_id.' '.$item_key.' '.$custom_class.'" ><a href="'.$item_post_permalink.'"><img src="'.$thumb_url.'" /></a></div>';
187
-
188
-
189
- $item['post_date'] = '<div class="element element_'.$item_id.' '.$item_key.' '.$custom_class.'" >'.apply_filters('post_grid_filter_grid_item_post_date', get_the_date()).'</div>';
190
-
191
-
192
-
193
- $item['author'] = '<div class="element element_'.$item_id.' '.$item_key.' '.$custom_class.'" >'.apply_filters('post_grid_filter_grid_item_author', get_the_author()).'</div>';
194
-
195
-
196
- $item['author_link'] = '<a class="element element_'.$item_id.' '.$item_key.' '.$custom_class.'" href="'.get_author_posts_url(get_the_author_meta( 'ID' ), get_the_author_meta( 'user_nicename' )).'">'.get_the_author().'</a>';
197
-
198
- $html_categories = '';
199
- $categories = get_the_category();
200
- $separator = ' ';
201
- $output = '';
202
- if ( ! empty( $categories ) ) {
203
- foreach( $categories as $category ) {
204
- $html_categories .= '<a class="'.$category->slug.' category-'.$category->term_id.'" href="' . esc_url( get_category_link( $category->term_id ) ) . '" title="' . esc_attr( sprintf( __( 'View all posts in %s', 'post-grid' ), $category->name ) ) . '">' . esc_html( $category->name ) . '</a>' . $separator;
205
-
206
-
207
- }
208
- $html_categories.= trim( $output, $separator );
209
- }
210
-
211
-
212
- $item['categories'] = '<div class="element element_'.$item_id.' '.$item_key.' '.$custom_class.'" >'.$html_categories.'</div>';
213
-
214
-
215
- $html_tags = '';
216
-
217
- $posttags = get_the_tags();
218
- if ($posttags) {
219
- foreach($posttags as $tag){
220
-
221
- $tag_url = get_term_link($tag->term_id);
222
-
223
- $html_tags.= '<a href="'.esc_url($tag_url).'" class="'.$tag->slug.' category-'.$tag->term_id.'">'.$tag->name . '</a> ';
224
- }
225
- }
226
-
227
- $item['tags'] = '<div class="element element_'.$item_id.' '.$item_key.' '.$custom_class.'" >'.$html_tags.'</div>';
228
-
229
-
230
- if(in_array( 'rating-widget/rating-widget.php', (array) $active_plugins )){
231
-
232
- $item['rating_widget'] = '<div class="element element_'.$item_id.' '.$item_key.' '.$custom_class.'" >'.do_shortcode('[ratingwidget post_id="'.$item_post_id.'"]').'</div>';
233
- }
234
- else{
235
- $item['rating_widget'] = '<div class="element element_'.$item_id.' '.$item_key.' '.$custom_class.'" >'.__('Please activate Rating widget Plugin', 'post-grid').'</div>';
236
- }
237
-
238
-
239
-
240
- $share_button_html = '';
241
-
242
- $share_button_html.= '
243
- <span class="fb">
244
- <a target="_blank" href="https://www.facebook.com/sharer/sharer.php?u='.get_permalink().'"><i class="fab fa-facebook-square"></i></a>
245
- </span>
246
- <span class="twitter">
247
- <a target="_blank" href="https://twitter.com/intent/tweet?url='.get_permalink().'&text='.get_the_title().'"><i class="fab fa-twitter-square"></i></a>
248
- </span>';
249
-
250
- $share_button_html = apply_filters('post_grid_filter_share_buttons', $share_button_html);
251
-
252
-
253
-
254
- $item['share_button'] = '<div class="element element_'.$item_id.' '.$item_key.'">'.$share_button_html.'</div>';
255
-
256
-
257
-
258
- $item['hr'] = '<hr class="element element_'.$item_id.' '.$item_key.'" />';
259
-
260
-
261
-
262
-
263
-
264
- $comments_html = '';
265
- $comments_html.= '<h3 class="comment-content ">'.__('Comments', 'post-grid').'</h3>';
266
-
267
-
268
- $comments_count = wp_count_comments($item_post_id);
269
- $total_comments = $comments_count->approved;
270
-
271
- //var_dump($item_post_id);
272
-
273
-
274
- if($total_comments <= 0)
275
- {
276
-
277
- $comments_html.= '<div class="comment no-comment">';
278
- $comments_html.= '<p class="comment-content ">'.__('No comments yet', 'post-grid').'</p>';
279
-
280
- $comments_html.= '</div>';
281
-
282
- }
283
- else
284
- {
285
-
286
-
287
- $comments = get_comments(array(
288
- 'post_id' => $item_post_id,
289
- 'status' => 'approve',
290
- 'number' => 5,
291
- 'order' => 'ASC',
292
- ));
293
-
294
-
295
-
296
-
297
- if(empty($comments))
298
- {
299
-
300
- $comments_html.= '<div class="comment no-more-comment">';
301
- $comments_html.= '<p class="comment-content ">'.__('No More comments', 'post-grid').'';
302
- $comments_html.= '</p>';
303
- $comments_html.= '</div>';
304
-
305
- }
306
- else
307
- {
308
-
309
- $comments_html.= '<div id="comments" class="comments-area">';
310
- $comments_html.= '<ol class="commentlist">';
311
-
312
- foreach($comments as $comment) :
313
-
314
-
315
- $comment_ID = $comment->comment_ID;
316
- $comment_author = $comment->comment_author;
317
- $comment_author_email = $comment->comment_author_email;
318
- $comment_content = $comment->comment_content;
319
- $comment_date = $comment->comment_date;
320
-
321
-
322
-
323
-
324
- $comments_html.= '<li class="comment">';
325
- $comments_html.= '<article id="" class="comment">';
326
- $comments_html.= '<header class="comment-meta comment-author vcard">';
327
-
328
- $comments_html.= get_avatar($comment_author_email, 50);
329
-
330
- $comments_html.= '<cite><b class="fn">'.$comment_author.'</b></cite>';
331
- $comments_html.= '<time >'.$comment_date.'</time>';
332
-
333
- $comments_html.= '</header>';
334
- $comments_html.= '<section class="comment-content comment">';
335
- $comments_html.= '<p>'.$comment_content.'</p>';
336
- $comments_html.= '</section>';
337
-
338
- $comments_html.= '</article>';
339
-
340
- $comments_html.= '</li>';
341
-
342
- endforeach;
343
-
344
- $comments_html.= '</ol>';
345
- $comments_html.= '</div>';
346
-
347
- }
348
-
349
-
350
-
351
-
352
- }
353
-
354
-
355
-
356
- $item['comments'] = '<div class="element element_'.$item_id.' '.$item_key.' '.$custom_class.'">'.$comments_html.'</div>';
357
-
358
-
359
-
360
-
361
-
362
-
363
-
364
- $comments_number = get_comments_number( $item_post_id );
365
-
366
- $comments_count_html = '';
367
-
368
- if(comments_open()){
369
-
370
-
371
- if ( $comments_number == 0 ) {
372
- $comments_count_html.= __('No Comments', 'post-grid');
373
- } elseif ( $comments_number > 1 ) {
374
- $comments_count_html.= $comments_number . __(' Comments', 'post-grid');
375
- } else {
376
- $comments_count_html.= __('1 Comment', 'post-grid');
377
- }
378
-
379
- $item['comments_count'] = '<div class="element element_'.$item_id.' '.$item_key.' '.$custom_class.'">'.$comments_count_html.'</div>';
380
-
381
- }
382
- else{
383
-
384
- $item['comments_count'] = '';
385
- }
386
-
387
-
388
-
389
-
390
- $item = apply_filters('post_grid_filter_layout_items_html', $item_id, $item, $item_info);
391
-
392
- echo isset($item[$item_key]) ? $item[$item_key] : '';
393
-
394
-
395
- }
396
-
397
- echo'</div>'; // .layer-content
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
templates/layer-media.php DELETED
@@ -1,45 +0,0 @@
1
- <?php
2
- /*
3
- * @Author pickplugins
4
- * Copyright: 2015 pickplugins.com
5
- */
6
-
7
- if ( ! defined('ABSPATH')) exit; // if direct access
8
-
9
-
10
- //var_dump($media_source);
11
- //include post_grid_plugin_dir.'/templates/variables.php';
12
-
13
- $html_media = '';
14
-
15
- $is_image = false;
16
- foreach($media_source as $source_info){
17
-
18
- $media = post_grid_get_media($item_post_id, $source_info['id'], $featured_img_size, $thumb_linked);
19
-
20
- //var_dump($media);
21
-
22
- if ( $is_image ) continue;
23
-
24
- if(!empty($source_info['checked'])){
25
- if(!empty($media)){
26
-
27
- $html_media = post_grid_get_media($item_post_id, $source_info['id'], $featured_img_size, $thumb_linked);
28
- $is_image = true;
29
- }
30
- else{
31
- $html_media = '';
32
- }
33
- }
34
- }
35
-
36
-
37
-
38
- $html_media = apply_filters('post_grid_filter_html_media', $html_media);
39
-
40
-
41
-
42
-
43
- ?>
44
-
45
- <div class="layer-media"><?php echo $html_media; ?></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
templates/lazy.php DELETED
@@ -1,26 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * @Author pickplugins
5
- * Copyright: 2015 pickplugins
6
- */
7
-
8
- if ( ! defined('ABSPATH')) exit; // if direct access
9
-
10
- if($lazy_load_enable=='yes'){
11
-
12
- if( $grid_type=='filterable'){
13
- }
14
- else{
15
- ?>
16
- <div id="post-grid-lazy-<?php echo $grid_id; ?>" class="post-grid-lazy"><img src="<?php echo $lazy_load_image_src; ?>"/></div>
17
- <script>
18
- jQuery('#post-grid-lazy-<?php echo $grid_id; ?>').ready(function($){
19
- jQuery('#post-grid-lazy-<?php echo $grid_id; ?>').fadeOut();
20
- jQuery('#post-grid-<?php echo $grid_id; ?>').fadeIn();
21
- })
22
- </script>
23
- <style type="text/css">#post-grid-<?php echo $grid_id; ?>{display: none;}</style>
24
- <?php
25
- }
26
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
templates/nav-bottom.php DELETED
@@ -1,226 +0,0 @@
1
- <?php
2
- /*
3
- * @Author pickplugins
4
- * Copyright: 2015 pickplugins.com
5
- */
6
-
7
- if ( ! defined('ABSPATH')) exit; // if direct access
8
-
9
-
10
- $class_post_grid_functions = new class_post_grid_functions();
11
- $load_more_text = $class_post_grid_functions->load_more_text();
12
-
13
- ?>
14
- <div class="pagination">
15
- <?php
16
-
17
- //var_dump($max_num_pages);
18
-
19
- if($max_num_pages == 0){
20
- $max_num_pages = $post_grid_wp_query->max_num_pages;
21
- }
22
-
23
-
24
- if($grid_type=='grid'){
25
- if($pagination_type=='normal'){
26
- ?>
27
- <div class="paginate">
28
- <?php
29
-
30
- $big = 999999999; // need an unlikely integer
31
-
32
- echo paginate_links(
33
- array(
34
- 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
35
- 'format' => '?paged=%#%',
36
- 'current' => max( 1, $paged ),
37
- 'total' => $max_num_pages,
38
- 'prev_text' => $pagination_prev_text,
39
- 'next_text' => $pagination_next_text,
40
-
41
- )
42
- );
43
-
44
- ?>
45
- </div >
46
- <?php
47
- }
48
- elseif($pagination_type=='ajax_pagination'){
49
-
50
- ?>
51
-
52
- <div grid-id="<?php echo $grid_id; ?>" id="paginate-ajax-<?php echo $grid_id; ?>" class="paginate-ajax">
53
- <?php
54
- $big = 999999999; // need an unlikely integer
55
- echo paginate_links( array(
56
- 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
57
- 'format' => '?paged=%#%',
58
- 'current' => max( 1, $paged ),
59
- 'total' => $max_num_pages,
60
- 'prev_text' => $pagination_prev_text,
61
- 'next_text' => $pagination_next_text,
62
- ) );
63
- ?>
64
- </div >
65
-
66
- <?php
67
- }
68
- elseif($pagination_type=='next_previous'){
69
-
70
- global $wp_query;
71
- $post_grid_meta_options = get_post_meta($grid_id, 'post_grid_meta_options', true);
72
- $prev_text = !empty($post_grid_meta_options['pagination']['prev_text']) ? $post_grid_meta_options['pagination']['prev_text'] : __('« Previous','post-grid');
73
- $next_text = !empty($post_grid_meta_options['pagination']['next_text']) ? $post_grid_meta_options['pagination']['next_text'] : __('Next »','post-grid');
74
-
75
- ?>
76
- <div class="paginate next-previous">
77
-
78
- <?php
79
- next_posts_link( $prev_text );
80
- previous_posts_link( $next_text );
81
- ?>
82
- </div >
83
- <?php
84
- }
85
- elseif($pagination_type=='jquery'){
86
-
87
-
88
-
89
- ?>
90
- <div class="pager-list pager-list-<?php echo $grid_id; ?>"></div >
91
- <script>
92
- jQuery(document).ready(function($) {
93
- $(function(){
94
- $("#post-grid-<?php echo $grid_id; ?>").mixItUp({
95
- pagination: {
96
- limit: <?php echo $filterable_post_per_page; ?>,
97
- prevButtonHTML: "<?php echo $pagination_prev_text; ?>",
98
- nextButtonHTML: "<?php echo $pagination_next_text; ?>",
99
- },
100
- selectors: {
101
- filter: ".filter",
102
- pagersWrapper: ".pager-list-<?php echo $grid_id; ?>",
103
- },
104
- <?php
105
- if(!empty($active_filter) && $active_filter!= 'all'){
106
- ?>
107
- load: {
108
- filter: ".<?php echo $active_filter; ?>"
109
- },
110
- <?php
111
- }
112
- ?>
113
- controls: {
114
- enable: true
115
- }
116
- });
117
- });
118
- });
119
-
120
- </script>
121
-
122
- <style type="text/css">
123
- #post-grid-<?php echo $grid_id; ?> .grid-items .mix{
124
- display: none;
125
- }
126
- </style>
127
-
128
- <?php
129
- }
130
- elseif($pagination_type=='loadmore'){
131
- if(!empty($paged)){
132
- $paged = $paged+1;
133
- }
134
- $load_more = "load-more-".$grid_id;
135
- ?>
136
- <div id="load-more-<?php echo $grid_id; ?>" grid_id="<?php echo $grid_id; ?>" class="load-more" paged="<?php echo $paged; ?>" per_page="<?php echo $posts_per_page; ?>" >
137
- <span class="load-more-text"><?php echo $load_more_text; ?></span>
138
- <span class="load-more-spinner"><i class="fas fa-spinner fa-pulse"></i></span>
139
- </div >
140
- <?php
141
- }
142
- elseif($pagination_type=='infinite'){
143
- ?>
144
- <div grid_id="<?php echo $grid_id; ?>" class="infinite-scroll" paged="<?php echo $paged; ?>" per_page="<?php echo $posts_per_page; ?>" ><i class="fa fa-arrow-down"></i></div >
145
- <?php
146
- }
147
- }
148
-
149
- elseif($grid_type=='timeline'){
150
-
151
- if($pagination_type=='loadmore'){
152
-
153
- if(!empty($paged))
154
- {
155
- $paged = $paged+1;
156
- }
157
-
158
- ?>
159
- <div grid_id="<?php echo $grid_id; ?>" id="load-more-<?php echo $grid_id; ?>" class="load-more" paged="<?php echo $paged; ?>" per_page="<?php echo $posts_per_page; ?>" ><?php echo $load_more_text; ?></div >
160
- <?php
161
-
162
- }
163
-
164
-
165
-
166
- }
167
-
168
- elseif($grid_type=='filterable' || $grid_type=='glossary'){
169
-
170
- //var_dump($pagination_type);
171
-
172
- $pagination_type = ($pagination_type != 'jquery') ? 'jquery' : $pagination_type;
173
-
174
- if($pagination_type=='jquery'){
175
-
176
- ?>
177
- <div class="pager-list pager-list-<?php echo $grid_id; ?>"></div >
178
- <script>
179
- jQuery(document).ready(function($) {
180
- $(function(){
181
- $("#post-grid-<?php echo $grid_id; ?>").mixItUp({
182
- pagination: {
183
- limit: <?php echo $filterable_post_per_page; ?>,
184
- prevButtonHTML: "<?php echo $pagination_prev_text; ?>",
185
- nextButtonHTML: "<?php echo $pagination_next_text; ?>",
186
- },
187
- selectors: {
188
- filter: ".filter",
189
- pagersWrapper: ".pager-list-<?php echo $grid_id; ?>",
190
- },
191
- <?php
192
- if(!empty($active_filter) && $active_filter!= 'all'){
193
- ?>
194
- load: {
195
- filter: ".<?php echo $active_filter; ?>"
196
- },
197
- <?php
198
- }
199
- ?>
200
- controls: {
201
- enable: true
202
- }
203
- });
204
- });
205
- });
206
- </script>
207
-
208
-
209
-
210
-
211
- <style type="text/css">
212
- #post-grid-<?php echo $grid_id; ?> .grid-items .mix{
213
- display: none;
214
- }
215
- </style>
216
- <?php
217
-
218
-
219
- }
220
-
221
- }
222
-
223
-
224
-
225
- ?>
226
- </div >
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
templates/nav-top.php DELETED
@@ -1,310 +0,0 @@
1
- <?php
2
- /*
3
- * @Author pickplugins
4
- * Copyright: 2015 pickplugins.com
5
- */
6
-
7
- if ( ! defined('ABSPATH')) exit; // if direct access
8
-
9
-
10
-
11
- if($grid_type=='grid'){
12
- if($nav_top_search=='yes'){
13
- if(isset($_GET['keyword'])){
14
- $keyword = sanitize_text_field($_GET['keyword']);
15
- }
16
-
17
- ?>
18
- <div class="nav-search">
19
- <span class="search-icon"><?php echo $nav_top_search_icon; ?></span>
20
- <input grid_id="<?php echo $grid_id; ?>" title="<?php echo __('Press enter to reset', 'post-grid'); ?>" class="search" type="text" placeholder="<?php echo $nav_top_search_placeholder; ?>" value="<?php echo $keyword; ?>">
21
- </div>
22
- <?php
23
- }
24
- }
25
- elseif($grid_type=='filterable'){
26
- ?>
27
- <div class="nav-filter">
28
- <?php
29
- if($nav_top_filter_style=='inline'){
30
- foreach($taxonomies as $taxonomy => $taxonomyData){
31
- $terms = !empty($taxonomyData['terms']) ? $taxonomyData['terms'] : array();
32
- $terms_relation = !empty($taxonomyData['terms_relation']) ? $taxonomyData['terms_relation'] : 'OR';
33
- $checked = !empty($taxonomyData['checked']) ? $taxonomyData['checked'] : '';
34
- if(!empty($terms) && !empty($checked)){
35
- $terms_ids[$taxonomy] = $terms;
36
- }
37
- }
38
-
39
- if(!empty($terms_ids)){
40
- ?>
41
- <div class="filter filter-<?php echo $grid_id; ?>" data-filter="all"><?php echo $filterable_filter_all_text; ?></div>
42
- <?php
43
- foreach($terms_ids as $tax_name => $ids){
44
- foreach($ids as $id){
45
- $term = get_term( $id, $tax_name );
46
- $term_slug = $term->slug;
47
- $term_name = $term->name;
48
- ?>
49
- <div class="filter filter-<?php echo $grid_id; ?>" terms-id="<?php echo $id; ?>" data-filter=".<?php echo $term_slug; ?>" ><?php echo $term_name; ?></div>
50
- <?php
51
- }
52
- }
53
- }
54
- }
55
- elseif($nav_top_filter_style=='dropdown'){
56
- ?>
57
- <select id="FilterSelect">
58
- <?php
59
- if(!empty($taxonomies)){
60
- foreach($taxonomies as $taxonomy => $taxonomyData){
61
- $terms = !empty($taxonomyData['terms']) ? $taxonomyData['terms'] : array();
62
- $terms_relation = !empty($taxonomyData['terms_relation']) ? $taxonomyData['terms_relation'] : 'OR';
63
- $checked = !empty($taxonomyData['checked']) ? $taxonomyData['checked'] : '';
64
- if(!empty($terms) && !empty($checked)){
65
- $terms_ids[$taxonomy] = $terms;
66
- }
67
- }
68
- ?>
69
- <option value="all"><?php echo $filterable_filter_all_text; ?></option>
70
- <?php
71
- foreach($terms_ids as $tax_name => $ids){
72
- foreach($ids as $id){
73
- $term = get_term( $id, $tax_name );
74
- $term_slug = $term->slug;
75
- $term_name = $term->name;
76
- ?>
77
- <option terms-id="<?php echo $term_info[0]; ?>" value=".<?php echo $term_slug; ?>" ><?php echo $term_name; ?></option>
78
- <?php
79
- }
80
- }
81
- }
82
- ?>
83
- </select>
84
-
85
-
86
- <script>
87
- jQuery(function($){
88
- var $filterSelect = $('#FilterSelect'),
89
- $container = $('<?php echo '#post-grid-'.$grid_id; ?>');
90
- $container.mixItUp({
91
- pagination: {
92
- limit: <?php echo $filterable_post_per_page; ?>,
93
- prevButtonHTML: "<?php echo $pagination_prev_text; ?>",
94
- nextButtonHTML: "<?php echo $pagination_next_text; ?>",
95
- },
96
- selectors: {
97
- pagersWrapper: ".pager-list-<?php echo $grid_id; ?>",
98
- filter: ".filter-<?php echo $grid_id; ?>",
99
- },
100
- <?php
101
- if(!empty($active_filter) && $active_filter!= 'all'){
102
- ?>
103
- load: {
104
- filter: document.location.hash == "" ? ".<?php echo $active_filter; ?>" :("." + document.location.hash.substring(1))
105
- },
106
- <?php
107
- }
108
- ?>
109
- controls: {
110
- enable: true
111
- }
112
- });
113
- $filterSelect.on('change', function(){
114
- $container.mixItUp('filter', this.value);
115
- });
116
- });
117
- </script>
118
-
119
- <?php
120
- }
121
- ?>
122
- </div> <!-- .nav-filter -->
123
- <script>
124
- jQuery(document).ready(function($){
125
- $(function(){
126
- $("#post-grid-<?php echo $grid_id; ?>").mixItUp({
127
- pagination: {
128
- limit: <?php echo $filterable_post_per_page; ?>,
129
- prevButtonHTML: "<?php echo $pagination_prev_text; ?>",
130
- nextButtonHTML: "<?php echo $pagination_next_text; ?>",
131
- },
132
- selectors: {
133
- pagersWrapper: ".pager-list-<?php echo $grid_id; ?>",
134
- filter: ".filter-<?php echo $grid_id; ?>",
135
- },
136
- <?php if(!empty($active_filter) && $active_filter!= 'all') { ?>
137
- load: {
138
- filter: document.location.hash == "" ? ".<?php echo $active_filter; ?>" :
139
- ("." + document.location.hash.substring(1))
140
- },
141
- <?php
142
- }
143
- ?>
144
- controls: {
145
- enable: true
146
- },
147
-
148
- callbacks: {
149
- onMixEnd: function(state){
150
-
151
- //var $container = $('#post-grid-<?php //echo $grid_id; ?>// .grid-items');
152
- //
153
- //
154
- //
155
- //$container.masonry({
156
- // itemSelector: '.item',
157
- // columnWidth: '.item', //as you wish , you can use numeric
158
- // isAnimated: true,
159
- // horizontalOrder: true,
160
- // isFitWidth: true,
161
- //});
162
- //$container.masonry('reloadItems');
163
- //$container.masonry('layout');
164
-
165
-
166
-
167
- }
168
- }
169
- });
170
- });
171
- });
172
- </script>
173
- <style type="text/css">
174
- #post-grid-<?php echo $grid_id; ?> .grid-items .mix{
175
- display: none;
176
- }
177
- </style>
178
- <?php
179
- }
180
-
181
-
182
-
183
-
184
-
185
- elseif($grid_type=='glossary'){
186
- ?>
187
- <div class="nav-filter">
188
- <?php
189
- if($nav_top_filter_style=='inline'){
190
-
191
- global $wp_query;
192
- $get_glossary_index = post_grid_get_glossary_index($wp_query);
193
- $count_glossary_index = array_count_values($get_glossary_index);
194
-
195
- //var_dump($count_glossary_index);
196
- ksort($count_glossary_index);
197
-
198
- //var_dump($count_glossary_index);
199
-
200
-
201
- if(!empty($count_glossary_index)){
202
- ?>
203
- <div class="filter filter-<?php echo $grid_id; ?>" data-filter="all"><?php echo $filterable_filter_all_text; ?></div>
204
- <?php
205
- foreach($count_glossary_index as $index => $count){
206
-
207
- if(!empty($index)):
208
- ?>
209
- <div class="filter filter-<?php echo $grid_id; ?>" terms-id="<?php echo $index; ?>" data-filter=".<?php echo $index; ?>" ><?php echo $index; ?></div>
210
- <?php
211
-
212
- endif;
213
-
214
-
215
-
216
- }
217
-
218
- }
219
-
220
- }
221
- ?>
222
- </div> <!-- .nav-filter -->
223
- <script>
224
- jQuery(document).ready(function($){
225
- $(function(){
226
- $("#post-grid-<?php echo $grid_id; ?>").mixItUp({
227
- pagination: {
228
- limit: <?php echo $filterable_post_per_page; ?>,
229
- prevButtonHTML: "<?php echo $pagination_prev_text; ?>",
230
- nextButtonHTML: "<?php echo $pagination_next_text; ?>",
231
- },
232
- selectors: {
233
- pagersWrapper: ".pager-list-<?php echo $grid_id; ?>",
234
- filter: ".filter-<?php echo $grid_id; ?>",
235
- },
236
- <?php if(!empty($active_filter) && $active_filter!= 'all') { ?>
237
- load: {
238
- filter: document.location.hash == "" ? ".<?php echo $active_filter; ?>" :
239
- ("." + document.location.hash.substring(1))
240
- },
241
- <?php
242
- }
243
- ?>
244
- controls: {
245
- enable: true
246
- }
247
- });
248
- });
249
- });
250
- </script>
251
- <style type="text/css">
252
- #post-grid-<?php echo $grid_id; ?> .grid-items .mix{
253
- display: none;
254
- }
255
- </style>
256
- <?php
257
- }
258
-
259
-
260
-
261
-
262
-
263
-
264
-
265
-
266
-
267
- elseif($grid_type=='slider'){
268
- ?>
269
- <script>
270
- jQuery(document).ready(function($){
271
- $("#post-grid-<?php echo $grid_id; ?> .grid-items").owlCarousel({
272
- items : 3,
273
- responsiveClass:true,
274
- responsive:{
275
- 320:{
276
- items:<?php echo $slider_column_mobile; ?>,
277
- },
278
- 768:{
279
- items:<?php echo $slider_column_tablet; ?>,
280
- },
281
- 1024:{
282
- items:<?php echo $slider_column_desktop; ?>,
283
- }
284
- },
285
- loop: <?php echo $slider_loop; ?>,
286
- rewind: <?php echo $slider_rewind; ?>,
287
- center: <?php echo $slider_center; ?>,
288
- autoplay: <?php echo $slider_auto_play; ?>,
289
- autoplaySpeed: <?php echo $slider_auto_play_speed; ?>,
290
- autoplayTimeout: <?php echo $slider_auto_play_timeout; ?>,
291
- autoplayHoverPause: <?php echo $slider_autoplayHoverPause; ?>,
292
- nav: <?php echo $slider_navs; ?>,
293
- navText : ["",""],
294
- dots: <?php echo $slider_dots; ?>,
295
- navSpeed: <?php echo $slider_navSpeed; ?>,
296
- dotsSpeed: <?php echo $slider_dotsSpeed; ?>,
297
- touchDrag : <?php echo $slider_touchDrag; ?>,
298
- mouseDrag : <?php echo $slider_mouseDrag; ?>,
299
- autoHeight: true,
300
- });
301
- $("#post-grid-<?php echo $grid_id; ?> .owl-nav").addClass("<?php echo $slider_navs_positon; ?>");
302
- $("#post-grid-<?php echo $grid_id; ?> .owl-nav").addClass("<?php echo $slider_navs_style; ?>");
303
- $("#post-grid-<?php echo $grid_id; ?> .owl-dots").addClass("<?php echo $slider_dots_style; ?>");
304
- });
305
- </script>
306
- <?php
307
- }
308
-
309
-
310
- //var_dump($grid_type);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
templates/post-grid-hook.php CHANGED
@@ -87,19 +87,28 @@ add_action('post_grid_container', 'post_grid_container_search', 5);
87
 
88
  function post_grid_container_search($args){
89
 
 
90
 
91
  $grid_id = $args['grid_id'];
92
  $post_grid_options = $args['options'];
93
 
 
 
94
 
95
  $nav_top_search = isset($post_grid_options['nav_top']['search']) ? $post_grid_options['nav_top']['search'] : 'no';
96
  $grid_type = isset($post_grid_options['grid_type']) ? $post_grid_options['grid_type'] : 'grid';
97
 
98
  if($nav_top_search !='yes') return;
99
 
100
- $nav_top_search_placeholder = isset($post_grid_options['nav_top']['search_placeholder']) ? $post_grid_options['nav_top']['search_placeholder'] : __('Start typing', 'post-grid');
101
- $nav_top_search_icon = isset($post_grid_options['nav_top']['search_icon']) ? $post_grid_options['nav_top']['search_icon'] : '<i class="fas fa-search"></i>';
102
 
 
 
 
 
 
 
 
 
103
 
104
 
105
  $keyword = isset($_GET['keyword']) ? sanitize_text_field($_GET['keyword']) : '';
@@ -531,7 +540,6 @@ function post_grid_container_old_layout_css($args){
531
  $layout_content = isset($post_grid_options['layout']['content']) ? $post_grid_options['layout']['content'] : 'flat';
532
 
533
  $class_post_grid_functions = new class_post_grid_functions();
534
- $items_bg_color_values = $class_post_grid_functions->items_bg_color_values();
535
 
536
  $post_grid_layout_content = get_option( 'post_grid_layout_content' );
537
 
87
 
88
  function post_grid_container_search($args){
89
 
90
+ $post_grid_settings = get_option('post_grid_settings');
91
 
92
  $grid_id = $args['grid_id'];
93
  $post_grid_options = $args['options'];
94
 
95
+ $font_aw_version = isset($post_grid_settings['font_aw_version']) ? $post_grid_settings['font_aw_version'] : 'v_5';
96
+
97
 
98
  $nav_top_search = isset($post_grid_options['nav_top']['search']) ? $post_grid_options['nav_top']['search'] : 'no';
99
  $grid_type = isset($post_grid_options['grid_type']) ? $post_grid_options['grid_type'] : 'grid';
100
 
101
  if($nav_top_search !='yes') return;
102
 
 
 
103
 
104
+ if($font_aw_version == 'v_5'){
105
+ $nav_top_search_icon = '<i class="fas fa-search"></i>';
106
+ }elseif($font_aw_version == 'v_4'){
107
+ $nav_top_search_icon = '<i class="fa fa-search"></i>';
108
+ }
109
+
110
+ $nav_top_search_placeholder = isset($post_grid_options['nav_top']['search_placeholder']) ? $post_grid_options['nav_top']['search_placeholder'] : __('Start typing', 'post-grid');
111
+ $nav_top_search_icon = isset($post_grid_options['nav_top']['search_icon']) ? $post_grid_options['nav_top']['search_icon'] : $nav_top_search_icon;
112
 
113
 
114
  $keyword = isset($_GET['keyword']) ? sanitize_text_field($_GET['keyword']) : '';
540
  $layout_content = isset($post_grid_options['layout']['content']) ? $post_grid_options['layout']['content'] : 'flat';
541
 
542
  $class_post_grid_functions = new class_post_grid_functions();
 
543
 
544
  $post_grid_layout_content = get_option( 'post_grid_layout_content' );
545
 
templates/post-grid.php DELETED
@@ -1,155 +0,0 @@
1
- <?php
2
- if ( ! defined('ABSPATH')) exit; // if direct access
3
-
4
-
5
-
6
-
7
- include post_grid_plugin_dir.'/templates/variables.php';
8
- include post_grid_plugin_dir.'/templates/query.php';
9
- include post_grid_plugin_dir.'/templates/custom-css.php';
10
- include post_grid_plugin_dir.'/templates/lazy.php';
11
-
12
-
13
-
14
- if($enable_multi_skin=='yes'){
15
- $skin_main = $skin;
16
- }
17
-
18
-
19
- ?>
20
-
21
- <script>
22
- post_grid_masonry_enable = "<?php echo $masonry_enable; ?>";
23
- </script>
24
-
25
- <div id="post-grid-<?php echo $grid_id; ?>" class="post-grid <?php echo $grid_type; ?>">
26
- <div class="grid-nav-top">
27
- <?php
28
- include post_grid_plugin_dir.'templates/nav-top.php';
29
- ?>
30
- </div>
31
-
32
-
33
-
34
- <?php
35
- $odd_even = 0;
36
-
37
- if ( $post_grid_wp_query->have_posts() ) :
38
-
39
- ?>
40
- <div class="grid-items-wrap">
41
- <div class="grid-items">
42
- <?php
43
-
44
- while ( $post_grid_wp_query->have_posts() ) : $post_grid_wp_query->the_post();
45
- $item_post_id = get_the_ID();
46
- //var_dump($item_post_id);
47
- $post_grid_post_settings = get_post_meta( $item_post_id, 'post_grid_post_settings', true );
48
- //var_dump($post_grid_post_settings);
49
- if($enable_multi_skin=='yes'){
50
- if(!empty($post_grid_post_settings['post_skin'])){
51
- $skin = $post_grid_post_settings['post_skin'];
52
- }
53
- else{
54
- $skin = $skin_main;
55
- }
56
- }
57
-
58
- if($odd_even%2==0){
59
- $odd_even_calss = 'even';
60
- }
61
- else{
62
- $odd_even_calss = 'odd';
63
- }
64
- $odd_even++;
65
-
66
-
67
- $item_css_class = array();
68
-
69
- $item_css_class['item'] = 'item';
70
- $item_css_class['item_id'] = 'item-'.$item_post_id;
71
-
72
- $item_css_class['skin'] = 'skin '.$skin;
73
- $item_css_class['odd_even'] = $odd_even_calss;
74
-
75
-
76
-
77
- $item_css_class = apply_filters('post_grid_item_classes', $item_css_class);
78
- $item_css_class = implode(' ', $item_css_class);
79
-
80
-
81
-
82
-
83
- ?><div class="<?php echo $item_css_class; ?>">
84
- <div class="layer-wrapper">
85
- <?php
86
- include post_grid_plugin_dir.'/templates/layer-media.php';
87
- include post_grid_plugin_dir.'/templates/layer-content.php';
88
- //include post_grid_plugin_dir.'/templates/layer-hover.php';
89
- ?>
90
- </div> <!-- .$item_css_class -->
91
- </div> <!-- .layer-wrapper -->
92
- <?php
93
-
94
- $post_grid_ads_loop_meta_options = get_post_meta($grid_id, 'post_grid_ads_loop_meta_options', true);
95
-
96
- if(!empty($post_grid_ads_loop_meta_options['ads_positions'])){
97
-
98
- $ads_positions = $post_grid_ads_loop_meta_options['ads_positions'];
99
- $ads_positions = explode(',',$ads_positions);
100
-
101
- $ads_positions_html = $post_grid_ads_loop_meta_options['ads_positions_html'];
102
-
103
- $post_grid_ads_positions = apply_filters('post_grid_filter_ads_positions', $ads_positions);
104
-
105
- foreach($post_grid_ads_positions as $position){
106
-
107
- if( $post_grid_wp_query->current_post == $position ){
108
-
109
- if(!empty($ads_positions_html[$position]))
110
- echo apply_filters('post_grid_nth_item_html',$ads_positions_html[$position]);
111
-
112
- }
113
- }
114
-
115
- }
116
-
117
-
118
-
119
- endwhile;
120
-
121
- ?>
122
- </div><!-- .grid-items -->
123
- </div><!-- .grid-items-wrap -->
124
- <div class="grid-nav-bottom">
125
- <?php
126
- include post_grid_plugin_dir.'/templates/nav-bottom.php';
127
- ?>
128
- </div> <!-- End .grid-nav-bottom -->
129
- <?php
130
-
131
- wp_reset_query();
132
- wp_reset_postdata();
133
-
134
- else:
135
-
136
- ?>
137
- <div class="no-post-found">
138
- <?php echo apply_filters('post_grid_no_post_text', $no_post_text); ?>
139
- </div>
140
- <?php
141
- endif;
142
-
143
- ?>
144
-
145
-
146
-
147
- <?php
148
-
149
- include post_grid_plugin_dir.'/templates/scripts.php';
150
- include post_grid_plugin_dir.'/templates/custom-js.php';
151
-
152
-
153
-
154
- ?>
155
- </div><!-- End .post-grid -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
templates/query.php DELETED
@@ -1,113 +0,0 @@
1
- <?php
2
- if ( ! defined('ABSPATH')) exit; // if direct access
3
-
4
-
5
- global $wp_query;
6
-
7
-
8
- $default_query_args = array();
9
-
10
-
11
-
12
-
13
- /* ################################ Tax query ######################################*/
14
-
15
- $tax_query = array();
16
-
17
- foreach($taxonomies as $taxonomy => $taxonomyData){
18
-
19
- $terms = !empty($taxonomyData['terms']) ? $taxonomyData['terms'] : array();
20
- $terms_relation = !empty($taxonomyData['terms_relation']) ? $taxonomyData['terms_relation'] : 'OR';
21
- $checked = !empty($taxonomyData['checked']) ? $taxonomyData['checked'] : '';
22
-
23
- if(!empty($terms) && !empty($checked)){
24
- $tax_query[] = array(
25
- 'taxonomy' => $taxonomy,
26
- 'field' => 'term_id',
27
- 'terms' => $terms,
28
- 'operator' => $terms_relation,
29
- );
30
- }
31
- }
32
-
33
-
34
- $tax_query_relation = array( 'relation' => $categories_relation );
35
-
36
- $tax_query = array_merge($tax_query_relation, $tax_query );
37
-
38
-
39
-
40
-
41
-
42
- /* ################################ Keyword query ######################################*/
43
-
44
- if(isset($_GET['keyword'])){
45
-
46
- $keyword = sanitize_text_field($_GET['keyword']);
47
-
48
- }
49
-
50
-
51
-
52
-
53
- /* ################################ Single pages ######################################*/
54
-
55
-
56
- if(is_singular()):
57
- $current_post_id = get_the_ID();
58
- $default_query_args['post__not_in'] = array($current_post_id);
59
- endif;
60
-
61
-
62
-
63
-
64
-
65
-
66
-
67
-
68
-
69
- if(!empty($post_types))
70
- $default_query_args['post_type'] = $post_types;
71
-
72
- if(!empty($post_status))
73
- $default_query_args['post_status'] = $post_status;
74
-
75
- if(!empty($keyword))
76
- $default_query_args['s'] = $keyword;
77
-
78
-
79
- if(!empty($exclude_post_id))
80
- $default_query_args['post__not_in'] = $exclude_post_id;
81
-
82
- if(!empty($query_order))
83
- $default_query_args['order'] = $query_order;
84
-
85
- if(!empty($query_orderby))
86
- $default_query_args['orderby'] = $query_orderby;
87
-
88
- if(!empty($query_orderby_meta_key))
89
- $default_query_args['meta_key'] = $query_orderby_meta_key;
90
-
91
- if(!empty($posts_per_page))
92
- $default_query_args['posts_per_page'] = (int)$posts_per_page;
93
-
94
- if(!empty($paged))
95
- $default_query_args['paged'] = $paged;
96
-
97
- if(!empty($offset))
98
- $default_query_args['offset'] = $offset + ( ($paged-1) * $posts_per_page );
99
-
100
-
101
- if(!empty($tax_query))
102
- $default_query_args['tax_query'] = $tax_query;
103
-
104
- if(!empty($meta_query))
105
- $default_query_args['meta_query'] = $meta_query;
106
-
107
- $query_merge = apply_filters('post_grid_filter_query_args', $default_query_args, $grid_id);
108
-
109
-
110
- $post_grid_wp_query = new WP_Query($query_merge);
111
-
112
- // for global use
113
- $wp_query = $post_grid_wp_query;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
templates/scripts.php DELETED
@@ -1,32 +0,0 @@
1
- <?php
2
- /*
3
- * @Author pickplugins
4
- * Copyright: 2015 pickplugins.com
5
- */
6
-
7
- if ( ! defined('ABSPATH')) exit; // if direct access
8
-
9
-
10
- ?>
11
-
12
- <script>
13
- <?php
14
- if($masonry_enable=='yes' && ($grid_type != 'filterable' && $grid_type != 'glossary')):
15
- ?>
16
- jQuery('#post-grid-lazy-<?php echo $grid_id; ?>').ready(function($){
17
- var $container = $('#post-grid-<?php echo $grid_id; ?> .grid-items');
18
- $container.masonry({
19
- itemSelector: '.item',
20
- columnWidth: '.item', //as you wish , you can use numeric
21
- isAnimated: true,
22
- isFitWidth: true,
23
- horizontalOrder: true,
24
- });
25
- $container.imagesLoaded().done( function() {
26
- $container.masonry('layout');
27
- });
28
- })
29
- <?php
30
- endif;
31
- ?>
32
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
templates/single/single-template-hook.php ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined('ABSPATH')) exit; // if direct access
3
+
4
+
5
+ get_header();
6
+
7
+ ?>
8
+
9
+ <?php
10
+
11
+ $post_id = get_the_id();
12
+ $post_grid_post_settings = get_post_meta($post_id,'post_grid_post_settings', true);
13
+
14
+ $layout_id = !empty($post_grid_post_settings['layout_id']) ? (int) $post_grid_post_settings['layout_id'] : '51851';
15
+
16
+ //var_dump($layout_id);
17
+
18
+ if(!empty($layout_id)){
19
+
20
+
21
+ $layout_elements_data = get_post_meta( $layout_id, 'layout_elements_data', true );
22
+ $layout_custom_scripts = get_post_meta($layout_id,'custom_scripts', true);
23
+ $layout_custom_css = isset($layout_custom_scripts['custom_css']) ? $layout_custom_scripts['custom_css'] : '';
24
+
25
+ ob_start();
26
+
27
+ ?>
28
+ <div class="layout-<?php echo $layout_id; ?>">
29
+ <?php
30
+
31
+ if(!empty($layout_elements_data))
32
+ foreach($layout_elements_data as $elementIndex=>$elementData){
33
+ foreach($elementData as $elementId=>$element) {
34
+
35
+ //var_dump($elementId);
36
+
37
+ $element_args['element'] = $element;
38
+ $element_args['index'] = $elementIndex;
39
+
40
+ $element_args['post_id'] = $post_id;
41
+ $element_args['layout_id'] = $layout_id;
42
+
43
+ do_action('post_grid_layout_element_' . $elementId, $element_args);
44
+ do_action('post_grid_layout_element_css_' . $elementId, $element_args);
45
+
46
+
47
+
48
+ }
49
+
50
+ }
51
+ ?>
52
+ </div>
53
+ <?php if(!empty($layout_custom_css)): ?>
54
+ <style type="text/css">
55
+ <?php
56
+ echo str_replace('__ID__', 'layout-'.$layout_id, $layout_custom_css);
57
+ ?>
58
+ </style>
59
+ <?php endif; ?>
60
+ <?php
61
+ $content = ob_get_clean();
62
+
63
+ echo $content;
64
+
65
+ }
66
+
67
+
68
+ ?>
69
+
70
+
71
+
72
+ <?php
73
+
74
+ get_footer();
75
+
76
+
77
+
78
+
79
+
80
+
81
+
82
+
83
+
84
+
85
+
templates/variables.php DELETED
@@ -1,575 +0,0 @@
1
- <?php
2
- /*
3
- * @Author pickplugins
4
- * Copyright: 2015 pickplugins.com
5
- */
6
-
7
- if ( ! defined('ABSPATH')) exit; // if direct access
8
-
9
- //global $post;
10
- $post_grid_meta_options = get_post_meta( $grid_id, 'post_grid_meta_options', true );
11
-
12
-
13
- $post_types = isset($post_grid_meta_options['post_types']) ? $post_grid_meta_options['post_types'] : array('post');
14
- $taxonomies = !empty($post_grid_meta_options['taxonomies']) ? $post_grid_meta_options['taxonomies'] : array();
15
- $categories_relation = isset($post_grid_meta_options['categories_relation']) ? $post_grid_meta_options['categories_relation'] : 'OR';
16
- $terms_relation = isset($post_grid_meta_options['terms_relation']) ? $post_grid_meta_options['terms_relation'] : 'IN';
17
- $extra_query_parameter = isset($post_grid_meta_options['extra_query_parameter']) ? $post_grid_meta_options['extra_query_parameter'] : '';
18
- $post_status = isset($post_grid_meta_options['post_status']) ? $post_grid_meta_options['post_status'] : 'publish';
19
- $offset = isset($post_grid_meta_options['offset']) ? (int)$post_grid_meta_options['offset'] : '';
20
- $posts_per_page = isset($post_grid_meta_options['posts_per_page']) ? $post_grid_meta_options['posts_per_page'] : '10';
21
- $exclude_post_id = isset($post_grid_meta_options['exclude_post_id']) ? $post_grid_meta_options['exclude_post_id'] : '';
22
- $query_order = isset($post_grid_meta_options['query_order']) ? $post_grid_meta_options['query_order'] : 'DESC';
23
- $query_orderby = isset($post_grid_meta_options['query_orderby']) ? $post_grid_meta_options['query_orderby'] : array('date');
24
- $query_orderby = implode(' ', $query_orderby);
25
-
26
- $query_orderby_meta_key = isset($post_grid_meta_options['query_orderby_meta_key']) ? $post_grid_meta_options['query_orderby_meta_key'] : '';
27
- $meta_query_relation = isset($post_grid_meta_options['meta_query_relation'])? $post_grid_meta_options['meta_query_relation'] : 'OR';
28
-
29
- if(!empty($post_grid_meta_options['meta_query'])){
30
- $meta_query = $post_grid_meta_options['meta_query'];
31
- $meta_query_args = array();
32
- if(!empty($meta_query)):
33
- $i = 0;
34
- foreach ($meta_query as $meta_queryIndex=>$meta_queryData):
35
- $arg_type = $meta_queryData['arg_type'];
36
- $relation = $meta_queryData['relation'];
37
-
38
- if($arg_type == 'single'):
39
- $meta_query_args[$meta_queryIndex]['key'] = $meta_queryData['key'];
40
- $meta_query_args[$meta_queryIndex]['value'] = $meta_queryData['value'];
41
- $meta_query_args[$meta_queryIndex]['compare'] = $meta_queryData['compare'];
42
- $meta_query_args[$meta_queryIndex]['type'] = $meta_queryData['type'];
43
-
44
- elseif($arg_type == 'group'):
45
- $args = isset($meta_queryData['args']) ? $meta_queryData['args'] : array();
46
-
47
- if(!empty($args)):
48
- $meta_query_args[$meta_queryIndex]['relation'] = $relation;
49
- foreach ($args as $argIndex=>$arg):
50
- $meta_query_args[$meta_queryIndex][$argIndex]['key'] = $arg['key'];
51
- $meta_query_args[$meta_queryIndex][$argIndex]['value'] = $arg['value'];
52
- $meta_query_args[$meta_queryIndex][$argIndex]['compare'] = $arg['compare'];
53
- $meta_query_args[$meta_queryIndex][$argIndex]['type'] = $arg['type'];
54
- endforeach;
55
- endif;
56
- endif;
57
- endforeach;
58
- endif;
59
-
60
- $meta_query = $meta_query_args;
61
- if(!empty($meta_query)){
62
- $meta_query_relation = array('relation' => $meta_query_relation);
63
- $meta_query = array_merge($meta_query_relation, $meta_query );
64
- }
65
- }
66
- else{
67
- $meta_query = array();
68
- }
69
-
70
- $no_post_text = isset($post_grid_meta_options['no_post_text']) ? $post_grid_meta_options['no_post_text'] : __('No post found','post-grid');
71
-
72
-
73
- $sticky_post_query_type = isset($post_grid_meta_options['sticky_post_query']['type']) ? $post_grid_meta_options['sticky_post_query']['type'] : 'none';
74
- $ignore_sticky_posts = isset($post_grid_meta_options['sticky_post_query']['ignore_sticky_posts']) ? $post_grid_meta_options['sticky_post_query']['ignore_sticky_posts'] : 0;
75
- $date_query_type = isset($post_grid_meta_options['date_query']['type']) ? $post_grid_meta_options['date_query']['type'] : 'none';
76
- $extact_date_year = isset($post_grid_meta_options['date_query']['extact_date']['year']) ? $post_grid_meta_options['date_query']['extact_date']['year'] : '';
77
-
78
- $extact_date_month = isset($post_grid_meta_options['date_query']['extact_date']['month']) ? $post_grid_meta_options['date_query']['extact_date']['month'] : '';
79
- $extact_date_day = isset($post_grid_meta_options['date_query']['extact_date']['day']) ? $post_grid_meta_options['date_query']['extact_date']['day'] : '';
80
- $between_two_date_after_year = isset($post_grid_meta_options['date_query']['between_two_date']['after']['year']) ? $post_grid_meta_options['date_query']['between_two_date']['after']['year'] :'';
81
-
82
- $between_two_date_after_month = isset($post_grid_meta_options['date_query']['between_two_date']['after']['month']) ? $post_grid_meta_options['date_query']['between_two_date']['after']['month'] : '';
83
- $between_two_date_after_day = isset($post_grid_meta_options['date_query']['between_two_date']['after']['day']) ? $post_grid_meta_options['date_query']['between_two_date']['after']['day'] : '';
84
- $between_two_date_before_year = isset($post_grid_meta_options['date_query']['between_two_date']['before']['year']) ? $post_grid_meta_options['date_query']['between_two_date']['before']['year'] : '';
85
- $between_two_date_before_month = isset($post_grid_meta_options['date_query']['between_two_date']['before']['month']) ? $post_grid_meta_options['date_query']['between_two_date']['before']['month'] : '';
86
- $between_two_date_before_day = isset($post_grid_meta_options['date_query']['between_two_date']['before']['day']) ? $post_grid_meta_options['date_query']['between_two_date']['before']['day'] : '';
87
- $between_two_date_inclusive = isset($post_grid_meta_options['date_query']['between_two_date']['inclusive']) ? $post_grid_meta_options['date_query']['between_two_date']['inclusive'] : '';
88
- $author_query_type = isset($post_grid_meta_options['author_query']['type']) ? $post_grid_meta_options['author_query']['type'] : '';
89
-
90
- $author__in = isset($post_grid_meta_options['author_query']['author__in']) ? $post_grid_meta_options['author_query']['author__in'] : '';
91
- $author__not_in = isset($post_grid_meta_options['author_query']['author__not_in']) ? $post_grid_meta_options['author_query']['author__not_in'] : '';
92
-
93
- $password_query_type = isset($post_grid_meta_options['password_query']['type']) ? $post_grid_meta_options['password_query']['type'] : 'none';
94
-
95
- $password_query_has_password = isset( $post_grid_meta_options['password_query']['has_password']) ? $post_grid_meta_options['password_query']['has_password'] : 'null';
96
-
97
- $password_query_post_password = isset($post_grid_meta_options['password_query']['post_password']) ? $post_grid_meta_options['password_query']['post_password'] : '';
98
-
99
- $permission_query = isset($post_grid_meta_options['permission_query']) ? $post_grid_meta_options['permission_query'] : 'disable';
100
- $ignore_archive = isset($post_grid_meta_options['ignore_archive']) ? $post_grid_meta_options['ignore_archive'] : 'no';
101
- $keyword = isset($post_grid_meta_options['keyword']) ? $post_grid_meta_options['keyword'] : '';
102
-
103
-
104
- $grid_layout_name = isset($post_grid_meta_options['grid_layout']['name']) ? $post_grid_meta_options['grid_layout']['name'] : 'layout_grid';
105
-
106
-
107
- $grid_layout_col_multi = isset($post_grid_meta_options['grid_layout']['col_multi']) ? $post_grid_meta_options['grid_layout']['col_multi'] : '2';
108
-
109
- $layout_content = isset($post_grid_meta_options['layout']['content']) ? $post_grid_meta_options['layout']['content'] : 'flat';
110
-
111
- $layout_hover = isset($post_grid_meta_options['layout']['hover']) ? $post_grid_meta_options['layout']['hover'] : 'flat';
112
-
113
-
114
- $enable_multi_skin = isset($post_grid_meta_options['enable_multi_skin']) ? $post_grid_meta_options['enable_multi_skin'] : 'no';
115
-
116
- $skin = isset($post_grid_meta_options['skin']) ? $post_grid_meta_options['skin'] : 'flat';
117
-
118
- $custom_js = isset($post_grid_meta_options['custom_js']) ? $post_grid_meta_options['custom_js'] : '';
119
-
120
- $custom_css = isset($post_grid_meta_options['custom_css']) ? $post_grid_meta_options['custom_css'] : '';
121
-
122
-
123
-
124
-
125
- $masonry_enable = isset($post_grid_meta_options['masonry_enable']) ? $post_grid_meta_options['masonry_enable'] : 'no';
126
-
127
-
128
- $lazy_load_enable = isset($post_grid_meta_options['lazy_load_enable']) ? $post_grid_meta_options['lazy_load_enable'] : 'no';
129
-
130
-
131
- $lazy_load_image_src = isset($post_grid_meta_options['lazy_load_image_src']) ? $post_grid_meta_options['lazy_load_image_src'] : post_grid_plugin_url.'assets/admin/gif/ajax-loader-1.gif';
132
-
133
-
134
-
135
-
136
- $items_width_desktop = isset($post_grid_meta_options['width']['desktop']) ? $post_grid_meta_options['width']['desktop'] : '';
137
-
138
- $items_width_tablet = isset($post_grid_meta_options['width']['tablet']) ? $post_grid_meta_options['width']['tablet'] : '';
139
- $items_width_mobile = isset($post_grid_meta_options['width']['mobile']) ? $post_grid_meta_options['width']['mobile'] : '';
140
-
141
-
142
- $items_bg_color_type = isset($post_grid_meta_options['items_bg_color_type']) ? $post_grid_meta_options['items_bg_color_type'] : '';
143
- $items_bg_color = isset($post_grid_meta_options['items_bg_color']) ? $post_grid_meta_options['items_bg_color'] : '#fff';
144
-
145
-
146
-
147
-
148
-
149
- $items_height_style = !empty($post_grid_meta_options['item_height']['style']) ? $post_grid_meta_options['item_height']['style'] : 'auto_height';
150
- $items_height_style_tablet = !empty($post_grid_meta_options['item_height']['style_tablet']) ? $post_grid_meta_options['item_height']['style_tablet'] : 'auto_height';
151
- $items_height_style_mobile = !empty($post_grid_meta_options['item_height']['style_mobile']) ?$post_grid_meta_options['item_height']['style_mobile'] : 'auto_height';
152
-
153
-
154
-
155
-
156
- $items_fixed_height = !empty($post_grid_meta_options['item_height']['fixed_height']) ? $post_grid_meta_options['item_height']['fixed_height'] : '220px';
157
- $items_fixed_height_tablet = !empty($post_grid_meta_options['item_height']['fixed_height_tablet']) ? $post_grid_meta_options['item_height']['fixed_height_tablet'] : '220px';
158
- $items_fixed_height_mobile = !empty($post_grid_meta_options['item_height']['fixed_height_mobile']) ? $post_grid_meta_options['item_height']['fixed_height_mobile'] : '220px';
159
-
160
-
161
-
162
- $items_media_height_style = !empty($post_grid_meta_options['media_height']['style']) ? $post_grid_meta_options['media_height']['style'] : 'auto_height';
163
- $items_media_fixed_height = !empty($post_grid_meta_options['media_height']['fixed_height']) ? $post_grid_meta_options['media_height']['fixed_height'] : '';
164
-
165
-
166
-
167
-
168
-
169
-
170
-
171
-
172
-
173
- $media_source = !empty($post_grid_meta_options['media_source']) ? $post_grid_meta_options['media_source'] : array();
174
- $featured_img_size = !empty($post_grid_meta_options['featured_img_size']) ? $post_grid_meta_options['featured_img_size'] : 'full';
175
- $thumb_linked = !empty($post_grid_meta_options['thumb_linked']) ? $post_grid_meta_options['thumb_linked'] : 'yes';
176
-
177
-
178
-
179
-
180
-
181
-
182
- $items_margin = isset($post_grid_meta_options['margin']) ? $post_grid_meta_options['margin'] : '';
183
- $item_padding = isset($post_grid_meta_options['item_padding']) ? $post_grid_meta_options['item_padding'] : '';
184
- $container_padding = isset($post_grid_meta_options['container']['padding']) ? $post_grid_meta_options['container']['padding'] : '';
185
- $container_bg_color = isset($post_grid_meta_options['container']['bg_color']) ? $post_grid_meta_options['container']['bg_color'] : '';
186
-
187
- $container_bg_image = isset($post_grid_meta_options['container']['bg_image']) ? $post_grid_meta_options['container']['bg_image'] : '';
188
- $grid_type = isset($post_grid_meta_options['grid_type']) ? $post_grid_meta_options['grid_type'] : 'grid';
189
-
190
- $nav_top_filter = isset($post_grid_meta_options['nav_top']['filter']) ? $post_grid_meta_options['nav_top']['filter'] : 'none';
191
-
192
- $nav_top_filter_style = isset($post_grid_meta_options['nav_top']['filter_style']) ? $post_grid_meta_options['nav_top']['filter_style'] : 'inline';
193
-
194
-
195
- $filterable_post_per_page = isset($post_grid_meta_options['nav_top']['filterable_post_per_page']) ? $post_grid_meta_options['nav_top']['filterable_post_per_page'] : '3';
196
-
197
-
198
-
199
-
200
-
201
-
202
-
203
- if(!empty($post_grid_meta_options['nav_top']['filter_all_text'])){
204
-
205
- $filterable_filter_all_text = $post_grid_meta_options['nav_top']['filter_all_text'];
206
- }
207
- else{
208
- $filterable_filter_all_text = __('All', 'post-grid');
209
-
210
- }
211
-
212
-
213
-
214
- if(!empty($post_grid_meta_options['nav_top']['filterable_font_size'])){
215
-
216
- $filterable_font_size = $post_grid_meta_options['nav_top']['filterable_font_size'];
217
- }
218
- else{
219
- $filterable_font_size = '17px';
220
-
221
- }
222
-
223
-
224
- $filterable_navs_margin = isset($post_grid_meta_options['nav_top']['filterable_navs_margin']) ? $post_grid_meta_options['nav_top']['filterable_navs_margin'] : '5px';
225
-
226
-
227
-
228
-
229
- if(!empty($post_grid_meta_options['nav_top']['filterable_font_color'])){
230
-
231
- $filterable_font_color = $post_grid_meta_options['nav_top']['filterable_font_color'];
232
- }
233
- else{
234
- $filterable_font_color = '#fff';
235
-
236
- }
237
-
238
-
239
- if(!empty($post_grid_meta_options['nav_top']['filterable_bg_color'])){
240
-
241
- $filterable_bg_color = $post_grid_meta_options['nav_top']['filterable_bg_color'];
242
- }
243
- else{
244
- $filterable_bg_color = '#646464';
245
-
246
- }
247
-
248
-
249
- if(!empty($post_grid_meta_options['nav_top']['filterable_active_bg_color'])){
250
-
251
- $filterable_active_bg_color = $post_grid_meta_options['nav_top']['filterable_active_bg_color'];
252
- }
253
- else{
254
- $filterable_active_bg_color = '#4b4b4b';
255
-
256
- }
257
-
258
-
259
-
260
-
261
-
262
-
263
-
264
- if(!empty($post_grid_meta_options['nav_top']['active_filter'])){
265
-
266
- $active_filter = $post_grid_meta_options['nav_top']['active_filter'];
267
-
268
- if(isset($_GET['filter'])){
269
-
270
- $active_filter = sanitize_text_field($_GET['filter']);
271
- }
272
- else{
273
- $active_filter = $active_filter;
274
- }
275
- }
276
- else{
277
- $active_filter = 'all';
278
-
279
- }
280
-
281
-
282
- //var_dump($active_filter);
283
-
284
-
285
-
286
- $nav_top_search = isset($post_grid_meta_options['nav_top']['search']) ? $post_grid_meta_options['nav_top']['search'] : 'no';
287
- $nav_top_search_placeholder = isset($post_grid_meta_options['nav_top']['search_placeholder']) ? $post_grid_meta_options['nav_top']['search_placeholder'] : __('Start typing', 'post-grid');
288
- $nav_top_search_icon = isset($post_grid_meta_options['nav_top']['search_icon']) ? $post_grid_meta_options['nav_top']['search_icon'] : '<i class="fas fa-search"></i>';
289
-
290
-
291
-
292
-
293
- if(!empty($post_grid_meta_options['slider_navs'])){
294
-
295
- $slider_navs = $post_grid_meta_options['slider_navs'];
296
- }
297
- else{
298
- $slider_navs = 'true';
299
-
300
- }
301
-
302
-
303
- if(!empty($post_grid_meta_options['slider_navs_positon'])){
304
-
305
- $slider_navs_positon = $post_grid_meta_options['slider_navs_positon'];
306
- }
307
- else{
308
- $slider_navs_positon = 'middle';
309
-
310
- }
311
-
312
- if(!empty($post_grid_meta_options['slider_navs_style'])){
313
-
314
- $slider_navs_style = $post_grid_meta_options['slider_navs_style'];
315
- }
316
- else{
317
- $slider_navs_style = 'round';
318
-
319
- }
320
-
321
-
322
-
323
- if(!empty($post_grid_meta_options['slider_dots'])){
324
-
325
- $slider_dots = $post_grid_meta_options['slider_dots'];
326
- }
327
- else{
328
- $slider_dots = 'true';
329
-
330
- }
331
-
332
-
333
- if(!empty($post_grid_meta_options['slider_dots_style'])){
334
-
335
- $slider_dots_style = $post_grid_meta_options['slider_dots_style'];
336
- }
337
- else{
338
- $slider_dots_style = 'round';
339
-
340
- }
341
-
342
-
343
- if(!empty($post_grid_meta_options['slider_dots_bg_color'])){
344
-
345
- $slider_dots_bg_color = $post_grid_meta_options['slider_dots_bg_color'];
346
- }
347
- else{
348
- $slider_dots_bg_color = '#e6e6e6';
349
-
350
- }
351
-
352
-
353
-
354
- if(!empty($post_grid_meta_options['slider_auto_play'])){
355
-
356
- $slider_auto_play = $post_grid_meta_options['slider_auto_play'];
357
- }
358
- else{
359
- $slider_auto_play = 'true';
360
-
361
- }
362
-
363
- if(!empty($post_grid_meta_options['slider_auto_play_timeout'])){
364
-
365
- $slider_auto_play_timeout = $post_grid_meta_options['slider_auto_play_timeout'];
366
- }
367
- else{
368
- $slider_auto_play_timeout = '3000';
369
-
370
- }
371
-
372
-
373
-
374
-
375
-
376
-
377
-
378
- if(!empty($post_grid_meta_options['slider_auto_play_speed'])){
379
-
380
- $slider_auto_play_speed = $post_grid_meta_options['slider_auto_play_speed'];
381
- }
382
- else{
383
- $slider_auto_play_speed = 2000;
384
-
385
- }
386
-
387
-
388
-
389
-
390
-
391
-
392
- if(!empty($post_grid_meta_options['slider_rewind'])){
393
-
394
- $slider_rewind = $post_grid_meta_options['slider_rewind'];
395
- }
396
- else{
397
- $slider_rewind = 'false';
398
-
399
- }
400
-
401
-
402
- if(!empty($post_grid_meta_options['slider_loop'])){
403
-
404
- $slider_loop = $post_grid_meta_options['slider_loop'];
405
- }
406
- else{
407
- $slider_loop = 'true';
408
-
409
- }
410
-
411
-
412
- if(!empty($post_grid_meta_options['slider_center'])){
413
-
414
- $slider_center = $post_grid_meta_options['slider_center'];
415
- }
416
- else{
417
- $slider_center = 'false';
418
-
419
- }
420
-
421
-
422
- if(!empty($post_grid_meta_options['slider_autoplayHoverPause'])){
423
-
424
- $slider_autoplayHoverPause = $post_grid_meta_options['slider_autoplayHoverPause'];
425
- }
426
- else{
427
- $slider_autoplayHoverPause = 'true';
428
-
429
- }
430
-
431
-
432
- if(!empty($post_grid_meta_options['slider_dotsSpeed'])){
433
-
434
- $slider_dotsSpeed = $post_grid_meta_options['slider_dotsSpeed'];
435
- }
436
- else{
437
- $slider_dotsSpeed = '1000';
438
-
439
- }
440
-
441
-
442
- if(!empty($post_grid_meta_options['slider_navSpeed'])){
443
-
444
- $slider_navSpeed = $post_grid_meta_options['slider_navSpeed'];
445
- }
446
- else{
447
- $slider_navSpeed = '1000';
448
-
449
- }
450
-
451
- if(!empty($post_grid_meta_options['slider_mouseDrag'])){
452
-
453
- $slider_mouseDrag = $post_grid_meta_options['slider_mouseDrag'];
454
- }
455
- else{
456
- $slider_mouseDrag = 'true';
457
-
458
- }
459
-
460
- if(!empty($post_grid_meta_options['slider_touchDrag'])){
461
-
462
- $slider_touchDrag = $post_grid_meta_options['slider_touchDrag'];
463
- }
464
- else{
465
- $slider_touchDrag = 'true';
466
-
467
- }
468
-
469
-
470
- if(!empty($post_grid_meta_options['slider_column_desktop'])){
471
-
472
- $slider_column_desktop = $post_grid_meta_options['slider_column_desktop'];
473
- }
474
- else{
475
- $slider_column_desktop = 4;
476
-
477
- }
478
-
479
-
480
- if(!empty($post_grid_meta_options['slider_column_tablet'])){
481
-
482
- $slider_column_tablet = $post_grid_meta_options['slider_column_tablet'];
483
- }
484
- else{
485
- $slider_column_tablet = 2;
486
-
487
- }
488
-
489
- if(!empty($post_grid_meta_options['slider_column_mobile'])){
490
-
491
- $slider_column_mobile = $post_grid_meta_options['slider_column_mobile'];
492
- }
493
- else{
494
- $slider_column_mobile = 1;
495
-
496
- }
497
-
498
-
499
-
500
-
501
-
502
- if(!empty($post_grid_meta_options['nav_bottom']['pagination_type'])){
503
-
504
- $pagination_type = $post_grid_meta_options['nav_bottom']['pagination_type'];
505
- }
506
- else{
507
- $pagination_type = 'normal';
508
-
509
- }
510
-
511
-
512
- if(!empty($post_grid_meta_options['pagination']['max_num_pages'])){
513
-
514
- $max_num_pages = $post_grid_meta_options['pagination']['max_num_pages'];
515
- }
516
- else{
517
- $max_num_pages = 0;
518
-
519
- }
520
-
521
- $pagination_prev_text = !empty($post_grid_meta_options['pagination']['prev_text']) ? $post_grid_meta_options['pagination']['prev_text'] : __('« Previous', 'post-grid');
522
- $pagination_next_text = !empty($post_grid_meta_options['pagination']['next_text']) ? $post_grid_meta_options['pagination']['next_text'] : __('Next »', 'post-grid');
523
-
524
-
525
-
526
- $pagination_font_size = !empty($post_grid_meta_options['pagination']['font_size']) ? $post_grid_meta_options['pagination']['font_size'] : '17px';
527
- $pagination_font_color = !empty($post_grid_meta_options['pagination']['font_color']) ? $post_grid_meta_options['pagination']['font_color'] : '#646464';
528
- $pagination_bg_color = !empty($post_grid_meta_options['pagination']['bg_color']) ? $post_grid_meta_options['pagination']['bg_color'] : '#646464';
529
- $pagination_active_bg_color = !empty($post_grid_meta_options['pagination']['active_bg_color']) ?$post_grid_meta_options['pagination']['active_bg_color'] : '#4b4b4b';
530
-
531
-
532
-
533
-
534
-
535
-
536
- //$glossary_load_type = isset($post_grid_meta_options['glossary']['load_type']) ? $post_grid_meta_options['glossary']['load_type'] : 'refresh';
537
- $timeline_arrow_bg_color = !empty($post_grid_meta_options['timeline']['arrow_bg_color']) ? $post_grid_meta_options['timeline']['arrow_bg_color'] : '#eee';
538
- $timeline_arrow_size = !empty($post_grid_meta_options['timeline']['arrow_size']) ? $post_grid_meta_options['timeline']['arrow_size'] : '13px';
539
- $timeline_bg_color = !empty($post_grid_meta_options['timeline']['timeline_bg_color']) ? $post_grid_meta_options['timeline']['timeline_bg_color'] : '#eee';
540
-
541
-
542
- $timeline_bubble_bg_color = !empty($post_grid_meta_options['timeline']['bubble_bg_color']) ? $post_grid_meta_options['timeline']['bubble_bg_color'] : '#ddd';
543
- $timeline_bubble_border_color = !empty($post_grid_meta_options['timeline']['bubble_border_color']) ? $post_grid_meta_options['timeline']['bubble_border_color'] : '#fff';
544
-
545
-
546
- if(empty($exclude_post_id))
547
- {
548
- $exclude_post_id = array();
549
- }
550
- else
551
- {
552
- $exclude_post_id = array_map('intval',explode(',',$exclude_post_id));
553
- }
554
-
555
-
556
-
557
- if ( get_query_var('paged') ) {
558
-
559
- $paged = get_query_var('paged');
560
-
561
- } elseif ( get_query_var('page') ) {
562
-
563
- $paged = get_query_var('page');
564
-
565
- } else {
566
-
567
- $paged = 1;
568
-
569
- }
570
-
571
-
572
-
573
-
574
-
575
-