Post Grid - Version 2.0.68

Version Description

  • 2020-07-04 add - Layouts library added.
Download this release

Release Info

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

Code changes from version 2.0.67 to 2.0.68

assets/admin/js/scripts-layouts.js ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function($){
2
+
3
+ $(document).on('click','.import-layout',function(){
4
+ _this = this;
5
+ post_id = $(this).attr('post_id');
6
+
7
+ $(_this).addClass('updating-message');
8
+
9
+ $.ajax({
10
+ type: 'POST',
11
+ context: _this,
12
+ url:post_grid_ajax.post_grid_ajaxurl,
13
+ data: {
14
+ "action" : "post_grid_ajax_fetch_block_hub_by_id",
15
+ "post_grid_ajax_nonce" : post_grid_ajax.ajax_nonce,
16
+ "post_id" : post_id,
17
+ },
18
+ success: function( response ) {
19
+ var data = JSON.parse( response );
20
+ is_saved = data['is_saved'];
21
+
22
+ console.log(data);
23
+
24
+ if(is_saved == 'yes'){
25
+ $(this).addClass('saved');
26
+ $(this).text('Saved');
27
+ }else{
28
+ $(this).addClass('saved');
29
+ $(this).text('Not Saved');
30
+ }
31
+
32
+
33
+
34
+ $(_this).removeClass('updating-message');
35
+ }
36
+ });
37
+
38
+ })
39
+
40
+ });
includes/classes/class-admin-notices.php CHANGED
@@ -5,7 +5,7 @@ class class_post_grid_notices{
5
 
6
  public function __construct(){
7
 
8
- add_action('admin_notices', array( $this, 'import_layouts' ));
9
 
10
  }
11
 
5
 
6
  public function __construct(){
7
 
8
+ //add_action('admin_notices', array( $this, 'import_layouts' ));
9
 
10
  }
11
 
includes/classes/class-functions.php CHANGED
@@ -70,9 +70,9 @@ class class_post_grid_functions{
70
 
71
  $media_source = array(
72
 
73
- 'featured_image' =>array('id'=>'featured_image','title'=>__('Featured Image', 'woocommerce-products-slider'),'checked'=>'yes'),
74
- 'first_image'=>array('id'=>'first_image','title'=>__('First images from content', 'woocommerce-products-slider'),'checked'=>'yes'),
75
- 'empty_thumb'=>array('id'=>'empty_thumb','title'=>__('Empty thumbnail', 'woocommerce-products-slider'),'checked'=>'yes'),
76
 
77
 
78
  );
70
 
71
  $media_source = array(
72
 
73
+ 'featured_image' =>array('id'=>'featured_image','title'=>__('Featured Image', 'post-grid'),'checked'=>'yes'),
74
+ 'first_image'=>array('id'=>'first_image','title'=>__('First images from content', 'post-grid'),'checked'=>'yes'),
75
+ 'empty_thumb'=>array('id'=>'empty_thumb','title'=>__('Empty thumbnail', 'post-grid'),'checked'=>'yes'),
76
 
77
 
78
  );
includes/classes/class-meta-boxes.php CHANGED
@@ -346,7 +346,7 @@ class post_grid_meta_boxs{
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,
346
  $args = array(
347
  'id' => 'grid_type',
348
  'parent' => 'post_grid_meta_options',
349
+ 'title' => __('View Type','post-grid'),
350
  'details' => '',
351
  'type' => 'radio',
352
  'value' => $grid_type,
includes/classes/class-settings-tabs.php CHANGED
@@ -570,7 +570,7 @@ class settings_tabs_field{
570
  </div>
571
  <input type="text" placeholder="<?php echo $placeholder; ?>" name="<?php echo $field_name; ?>" id="media_input_<?php echo $css_id; ?>" value="<?php echo $value; ?>" />
572
  <div class="media-upload button" id="media_upload_<?php echo $css_id; ?>"><?php echo __('Upload', $this->textdomain);?></div>
573
- <div class="clear button" id="media_clear_<?php echo $css_id; ?>"><?php echo __('Clear','accordions');?></div>
574
  <div class="error-mgs"></div>
575
  </div>
576
 
@@ -671,7 +671,7 @@ class settings_tabs_field{
671
 
672
  <div id="input-wrapper-<?php echo $css_id; ?>" class=" input-wrapper field-repeatable-wrapper
673
  field-repeatable-wrapper-<?php echo $css_id; ?>">
674
- <div add_html="<?php echo esc_attr($fieldHtml); ?>" class="add-repeat-field"><i class="far fa-plus-square"></i> <?php _e('Add','accordions'); ?></div>
675
  <div class="repeatable-field-list sortable" id="<?php echo $css_id; ?>">
676
  <?php
677
  if(!empty($values)):
570
  </div>
571
  <input type="text" placeholder="<?php echo $placeholder; ?>" name="<?php echo $field_name; ?>" id="media_input_<?php echo $css_id; ?>" value="<?php echo $value; ?>" />
572
  <div class="media-upload button" id="media_upload_<?php echo $css_id; ?>"><?php echo __('Upload', $this->textdomain);?></div>
573
+ <div class="clear button" id="media_clear_<?php echo $css_id; ?>"><?php echo __('Clear','post-grid');?></div>
574
  <div class="error-mgs"></div>
575
  </div>
576
 
671
 
672
  <div id="input-wrapper-<?php echo $css_id; ?>" class=" input-wrapper field-repeatable-wrapper
673
  field-repeatable-wrapper-<?php echo $css_id; ?>">
674
+ <div add_html="<?php echo esc_attr($fieldHtml); ?>" class="add-repeat-field"><i class="far fa-plus-square"></i> <?php _e('Add','post-grid'); ?></div>
675
  <div class="repeatable-field-list sortable" id="<?php echo $css_id; ?>">
676
  <?php
677
  if(!empty($values)):
includes/classes/class-settings.php CHANGED
@@ -29,6 +29,9 @@ class class_post_grid_settings{
29
  add_submenu_page('edit.php?post_type=post_grid', __('Settings', 'post-grid'), __('Settings', 'post-grid'), 'manage_options', 'post-grid-settings', array( $this, 'settings' ));
30
  add_submenu_page('edit.php?post_type=post_grid', __('Addons', 'post-grid'), __('Addons', 'post-grid'), 'manage_options', 'post-grid-addons', array( $this, 'addons' ));
31
 
 
 
 
32
  if($data_update_status == 'pending'):
33
  add_submenu_page('edit.php?post_type=post_grid', __('Data Update', 'post-grid'), __('Data Update', 'post-grid'), 'manage_options', 'data-update', array( $this, 'data_update' ));
34
 
@@ -54,12 +57,13 @@ class class_post_grid_settings{
54
  include(post_grid_plugin_dir.'includes/menu/data-update.php');
55
  }
56
 
 
 
57
  public function import_layouts(){
58
- include( post_grid_plugin_dir.'includes/menu/import-layouts.php' );
 
59
 
60
  }
61
-
62
-
63
 
64
 
65
 
29
  add_submenu_page('edit.php?post_type=post_grid', __('Settings', 'post-grid'), __('Settings', 'post-grid'), 'manage_options', 'post-grid-settings', array( $this, 'settings' ));
30
  add_submenu_page('edit.php?post_type=post_grid', __('Addons', 'post-grid'), __('Addons', 'post-grid'), 'manage_options', 'post-grid-addons', array( $this, 'addons' ));
31
 
32
+ add_submenu_page( 'edit.php?post_type=post_grid', __( 'Layouts library', 'post-grid' ), __( 'Layouts library', 'post-grid' ), 'manage_options', 'import_layouts', array( $this, 'import_layouts' ) );
33
+
34
+
35
  if($data_update_status == 'pending'):
36
  add_submenu_page('edit.php?post_type=post_grid', __('Data Update', 'post-grid'), __('Data Update', 'post-grid'), 'manage_options', 'data-update', array( $this, 'data_update' ));
37
 
57
  include(post_grid_plugin_dir.'includes/menu/data-update.php');
58
  }
59
 
60
+
61
+
62
  public function import_layouts(){
63
+ include(post_grid_plugin_dir.'includes/menu/import-layouts.php');
64
+
65
 
66
  }
 
 
67
 
68
 
69
 
includes/functions-layout-api.php ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined('ABSPATH')) exit; // if direct access
3
+
4
+
5
+ add_shortcode('post_grid_ajax_fetch_block_hub_by_id', 'post_grid_ajax_fetch_block_hub_by_id');
6
+
7
+ /*
8
+ * Ajax Function to fetch block from http://post_grid.com/ server
9
+ *
10
+ * */
11
+ function post_grid_ajax_fetch_block_hub_by_id(){
12
+
13
+
14
+
15
+ check_ajax_referer( 'post_grid_ajax_nonce', 'post_grid_ajax_nonce' );
16
+
17
+ if(!current_user_can('manage_options')) return;
18
+
19
+
20
+ $responses = array();
21
+
22
+ $post_id = isset($_POST['post_id']) ? sanitize_text_field($_POST['post_id']) : 51616;
23
+
24
+ $post_grid_settings = get_option('post_grid_license');
25
+ $license_key = isset($post_grid_settings['license_key']) ? $post_grid_settings['license_key'] : '';
26
+
27
+ $api_params = array(
28
+ 'post_grid_remote_action' => 'layoutSearchByID',
29
+ 'post_id' => $post_id,
30
+ 'license_key' => $license_key,
31
+
32
+ );
33
+
34
+
35
+
36
+
37
+ // Send query to the license manager server
38
+ $server_response = wp_remote_get(add_query_arg($api_params, post_grid_server_url), array('timeout' => 20, 'sslverify' => false));
39
+
40
+
41
+ /*
42
+ * Check is there any server error occurred
43
+ *
44
+ * */
45
+ if (is_wp_error($server_response)){
46
+ $responses['error'] = __('There is a server error', 'post-grid');
47
+ }
48
+ else{
49
+
50
+ $response_data = json_decode(wp_remote_retrieve_body($server_response), true);
51
+
52
+ //$response_data = json_decode($response_data);
53
+ //error_log(serialize($response_data));
54
+
55
+
56
+
57
+
58
+
59
+ $post_title = isset($response_data['post_title']) ? ($response_data['post_title']) : '';
60
+
61
+ $layout_elements_data = isset($response_data['layout_elements_data']) ? ($response_data['layout_elements_data']) : array();
62
+ $custom_scripts = isset($response_data['custom_scripts']) ? ($response_data['custom_scripts']) : array();
63
+ $layout_options = isset($response_data['layout_options']) ? ($response_data['layout_options']) : array();
64
+ $post_found = isset($response_data['post_found']) ? ($response_data['post_found']) : 'no';
65
+
66
+ //echo '<pre>'.var_export($post_found, true).'</pre>';
67
+
68
+ //error_log(serialize($post_title));
69
+
70
+
71
+ // $post_found = isset($response_data->post_found) ? sanitize_text_field($response_data->post_found) : 'no';
72
+
73
+ if($post_found == 'yes'){
74
+ // Create post object
75
+ $my_post = array(
76
+ 'post_title' => $post_title,
77
+ 'post_status' => 'publish',
78
+ 'post_author' => 1,
79
+ 'post_type' => 'post_grid_layout',
80
+ );
81
+ //
82
+ // // Insert the post into the database
83
+ $new_post_id = wp_insert_post( $my_post );
84
+ //
85
+ update_post_meta($new_post_id, 'layout_options', $layout_options);
86
+ update_post_meta($new_post_id, 'layout_elements_data', $layout_elements_data);
87
+ update_post_meta($new_post_id, 'custom_scripts', $custom_scripts);
88
+
89
+
90
+ $responses['is_saved'] = 'yes';
91
+ //$responses['post_title'] = $post_title;
92
+ $responses['post_id'] = $post_id;
93
+ $responses['response_data'] = $response_data;
94
+ }else{
95
+ $responses['is_saved'] = 'no';
96
+ }
97
+
98
+
99
+
100
+
101
+
102
+
103
+ }
104
+
105
+
106
+ echo json_encode( $responses );
107
+ die();
108
+ }
109
+
110
+
111
+ add_action('wp_ajax_post_grid_ajax_fetch_block_hub_by_id', 'post_grid_ajax_fetch_block_hub_by_id');
112
+ //add_action('wp_ajax_nopriv_post_grid_ajax_fetch_block_hub_by_id', 'post_grid_ajax_fetch_block_hub_by_id');
includes/menu/import-layouts.php ADDED
@@ -0,0 +1,516 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined('ABSPATH')) exit; // if direct access
3
+
4
+ if(!current_user_can('manage_options')) return;
5
+
6
+ $keyword = isset($_GET['keyword']) ? sanitize_text_field($_GET['keyword']) : '';
7
+ $paged = isset($_GET['paged']) ? sanitize_text_field($_GET['paged']) : '';
8
+ $tabs = isset($_GET['tabs']) ? sanitize_text_field($_GET['tabs']) : 'latest';
9
+
10
+ $post_grid_settings = get_option('post_grid_license');
11
+ $license_key = isset($post_grid_settings['license_key']) ? $post_grid_settings['license_key'] : '';
12
+
13
+ $max_num_pages = 0;
14
+
15
+ wp_enqueue_script('post_grid_layouts');
16
+
17
+
18
+ //var_dump($_SERVER);
19
+
20
+ ?>
21
+ <div class="wrap">
22
+ <h2><?php _e('Post Grid - Layouts library', 'post-grid'); ?></h2>
23
+
24
+ <div class="wpblockhub-search">
25
+
26
+ <div class="wp-filter">
27
+ <ul class="filter-links">
28
+ <li class=""><a href="<?php echo $_SERVER['REQUEST_URI']; ?>&tabs=latest" class="<?php if($tabs == 'latest') echo 'current'; ?>" aria-current="page"><?php _e('Latest', 'post-grid'); ?></a> </li>
29
+ <li class=""><a href="<?php echo $_SERVER['REQUEST_URI']; ?>&tabs=free" class="<?php if($tabs == 'free') echo 'current'; ?>" aria-current="page"><?php _e('Free', 'post-grid'); ?></a> </li>
30
+ <li class=""><a href="<?php echo $_SERVER['REQUEST_URI']; ?>&tabs=pro" class="<?php if($tabs == 'pro') echo 'current'; ?>" aria-current="page"><?php _e('Premium', 'post-grid'); ?></a> </li>
31
+ </ul>
32
+ <form class="block-search-form">
33
+ <span class="loading"></span>
34
+ <input id="block-keyword" type="search" placeholder="<?php _e('Start typing...', 'wp-block-hub'); ?>"
35
+ value="<?php echo $keyword; ?>">
36
+ </form>
37
+ </div>
38
+
39
+ <?php
40
+
41
+ $api_params = array(
42
+ 'post_grid_remote_action' => 'layoutSearch',
43
+ 'keyword' => $keyword,
44
+ 'paged' => $paged,
45
+ 'tabs' => $tabs,
46
+ );
47
+
48
+ // Send query to the license manager server
49
+ $response = wp_remote_get(add_query_arg($api_params, post_grid_server_url), array('timeout' => 20, 'sslverify' => false));
50
+
51
+
52
+ //echo '<pre>'.var_export($response, true).'</pre>';
53
+
54
+ /*
55
+ * Check is there any server error occurred
56
+ *
57
+ * */
58
+ if (is_wp_error($response)){
59
+
60
+ ?>
61
+ <div class="return-empty">
62
+ <ul>
63
+ <li><?php echo __("Unexpected Error! The query returned with an error.", 'post-grid'); ?></li>
64
+ <li><?php echo __("Make sure your internet connection is up.", 'post-grid'); ?></li>
65
+ </ul>
66
+ </div>
67
+ <?php
68
+
69
+
70
+ }
71
+ else{
72
+
73
+ $response_data = json_decode(wp_remote_retrieve_body($response));
74
+ $post_data = isset($response_data->posts) ? $response_data->posts : array();
75
+ $post_found = isset($response_data->post_found) ? sanitize_text_field($response_data->post_found) : array();
76
+ $max_num_pages = isset($response_data->max_num_pages) ? sanitize_text_field($response_data->max_num_pages) : 0;
77
+
78
+ //echo '<pre>'.var_export($response_data, true).'</pre>';
79
+ //var_dump($response_data->ajax_nonce);
80
+ }
81
+
82
+ ?>
83
+
84
+ <div class="block-list-items">
85
+ <?php
86
+
87
+ if(!empty($post_data)):
88
+
89
+ foreach ($post_data as $item_index=>$item):
90
+
91
+
92
+ //var_dump($item);
93
+
94
+ $post_id = isset($item->post_id) ? $item->post_id : '';
95
+ $block_title = isset($item->title) ? $item->title : __('No title', 'post-grid');
96
+ $post_url = isset($item->post_url) ? $item->post_url : '';
97
+ $download_count = isset($item->download_count) ? $item->download_count : 0;
98
+
99
+ $layout_options = isset($item->layout_options) ? unserialize($item->layout_options) : '';
100
+ $is_pro = isset($item->is_pro) ? $item->is_pro : '';
101
+
102
+ $layout_preview_img = isset($layout_options['layout_preview_img']) ? $layout_options['layout_preview_img'] : '';
103
+
104
+
105
+ //echo '<pre>'.var_export($is_pro, true).'</pre>';
106
+
107
+
108
+ ?>
109
+
110
+ <div class="item">
111
+ <div class="item-top-area">
112
+
113
+ <?php if(!empty($layout_preview_img)):?>
114
+ <div class="block-thumb">
115
+ <img src="<?php echo $layout_preview_img; ?>">
116
+ </div>
117
+ <?php endif; ?>
118
+
119
+
120
+ <div class="block-content">
121
+ <div class="block-name"><?php echo $block_title; ?></div>
122
+
123
+ </div>
124
+ <div class="actions">
125
+
126
+ <?php
127
+ if ($is_pro == 'yes' && empty($license_key)) {
128
+
129
+ }else{
130
+ ?>
131
+ <span class="button import-layout" post_id="<?php echo $post_id; ?>"><i class="fas fa-download"></i> Import (<?php echo $download_count; ?>)</span>
132
+ <?php
133
+ }
134
+
135
+ ?>
136
+
137
+
138
+ <?php if($is_pro == 'yes'): ?>
139
+ <span title="Enter license key to import" class="is_pro button"><i class="fas fa-crown"></i> Pro</span>
140
+ <?php else: ?>
141
+ <span class="is_free button"><i class="far fa-lightbulb"></i> Free</span>
142
+ <?php endif; ?>
143
+
144
+
145
+
146
+ </div>
147
+ </div>
148
+ <div class="clear"></div>
149
+ </div>
150
+ <?php
151
+ endforeach;
152
+
153
+ else:
154
+
155
+ echo 'Server return empty. please try again later.';
156
+ endif;
157
+
158
+ ?>
159
+
160
+
161
+
162
+ </div>
163
+
164
+ <div class="paginate">
165
+ <?php
166
+
167
+
168
+ $big = 999999999; // need an unlikely integer
169
+ //$max_num_pages = 4;
170
+
171
+
172
+ //var_dump(get_pagenum_link( $big ));
173
+
174
+ echo paginate_links(
175
+ array(
176
+ 'base' => preg_replace('/\?.*/', '', get_pagenum_link()) . '%_%',
177
+ //'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
178
+ 'format' => '?paged=%#%',
179
+ 'current' => max( 1, $paged ),
180
+ 'total' => $max_num_pages ,
181
+ 'prev_text' => '« Previous',
182
+ 'next_text' => 'Next »',
183
+
184
+
185
+
186
+ ));
187
+ ?>
188
+ </div>
189
+
190
+
191
+
192
+ </div>
193
+
194
+ </div>
195
+
196
+ <script>
197
+ jQuery(document).ready(function($) {
198
+
199
+ var delay = (function(){
200
+ var timer = 0;
201
+ return function(callback, ms){
202
+ clearTimeout (timer);
203
+ timer = setTimeout(callback, ms);
204
+ };
205
+ })();
206
+
207
+
208
+ $(document).on('keyup','#block-keyword',function(){
209
+ _this = this;
210
+ keyword = $(this).val();
211
+
212
+ url = window.location.href
213
+ //console.log();
214
+ var url = new URL(url);
215
+
216
+
217
+ delay(function(){
218
+ $(_this).parent().children('.loading').addClass('button updating-message');
219
+
220
+ url.searchParams.append('keyword', keyword);
221
+ url.searchParams.delete('paged');
222
+ window.location.href = url.href;
223
+
224
+ }, 1000 );
225
+
226
+
227
+ })
228
+ })
229
+ </script>
230
+
231
+ <style type="text/css">
232
+
233
+ .block-search-form{
234
+ float: right;
235
+ padding: 10px;
236
+ }
237
+ .block-search-form input[type="search"]{
238
+ width: 225px;
239
+ padding: 0 10px;
240
+ }
241
+ .block-list-items{}
242
+ .block-list-items a{ text-decoration: none}
243
+ .block-list-items .item{
244
+ display: inline-block;
245
+ vertical-align: top;
246
+ width: 18%;
247
+ background: #fff;
248
+ margin: 10px;
249
+ }
250
+
251
+ @media (max-width: 1199.98px) {
252
+
253
+ .block-list-items .item{
254
+ width: 46%;
255
+
256
+ }
257
+ }
258
+
259
+ @media (max-width: 767.98px) {
260
+
261
+ .block-list-items .item{
262
+ width: 46%;
263
+
264
+ }
265
+
266
+ }
267
+
268
+ @media (max-width: 575.98px) {
269
+ .block-list-items .item{
270
+ width: 95%;
271
+
272
+ }
273
+ }
274
+
275
+
276
+
277
+
278
+
279
+ .block-list-items .item-top-area{}
280
+ .block-list-items .block-thumb{
281
+ /* float: left; */
282
+ overflow: hidden;
283
+ /* margin-right: 15px; */
284
+ height: 280px;
285
+ border-bottom: 1px solid #ddd;
286
+ }
287
+ .block-list-items .block-thumb img{
288
+ width: 100%;
289
+ }
290
+
291
+ .block-list-items .block-name{
292
+ font-weight: 600;
293
+ font-size: 18px;
294
+ }
295
+ .block-list-items .block-content{
296
+ padding: 15px;
297
+ }
298
+ .item .actions{
299
+ margin: 10px;
300
+ }
301
+
302
+ .item .is_pro{
303
+ background: #3f51b5;
304
+ color: #fff;
305
+ }
306
+ .item .is_free{
307
+ background: #449862;
308
+ color: #fff;
309
+ }
310
+
311
+ .block-save{}
312
+ .block-save.saved{
313
+ color: #00a04f;
314
+ }
315
+
316
+ .block-save span{
317
+ line-height: normal;
318
+ display: inline-block;
319
+ }
320
+
321
+ .block-list-items .demo-wrap{}
322
+ .block-list-items .block-action{
323
+ float: right;
324
+ display: inline-block;
325
+ padding: 15px;
326
+ text-align: right;
327
+ }
328
+ .plugin-required{}
329
+ .plugin-required a{
330
+ text-decoration: none;
331
+ }
332
+
333
+
334
+ .plugin-required .installed {
335
+ color: #00a04f;
336
+ }
337
+
338
+ .plugin-required .not-installed {
339
+ color: #e02102;
340
+ }
341
+
342
+
343
+
344
+ .block-list-items .item-bottom-area{
345
+ padding: 10px;
346
+ background: #f7f7f7;
347
+ border-top: 1px solid #ddd;
348
+ }
349
+ .item-bottom-area .col-left{
350
+ width: 49%;
351
+ display: inline-block;
352
+ vertical-align: top;
353
+ }
354
+ .item-bottom-area .col-right{
355
+ width: 49%;
356
+ display: inline-block;
357
+ text-align: right;
358
+ }
359
+ .item-bottom-area .col-left .star-rate{
360
+ margin-bottom: 10px;
361
+ }
362
+ .item-bottom-area .col-left .star-rate .dashicons{
363
+ color: #ffb900;
364
+ }
365
+ .item-bottom-area .col-left .download-count{}
366
+
367
+ .item-bottom-area .col-right .author-link{
368
+ margin-bottom: 10px;
369
+ }
370
+
371
+
372
+
373
+ .paginate{
374
+ text-align: center;
375
+ margin: 40px;
376
+ }
377
+
378
+ .paginate .page-numbers{
379
+ background: #f7f7f7;
380
+ padding: 10px 15px;
381
+ margin: 5px;
382
+ text-decoration: none;
383
+ }
384
+ .paginate .page-numbers.current{
385
+ background: #e4e4e4;
386
+ }
387
+
388
+
389
+
390
+
391
+
392
+
393
+
394
+
395
+
396
+
397
+
398
+ /*wpblockhub-import-container*/
399
+
400
+ .wpblockhub-import-container{
401
+ position: relative;
402
+ }
403
+ .wpblockhub-import-btn{}
404
+ .wpblockhub-import-container button {
405
+ background: #3f51b5;
406
+ color: #fff;
407
+ }
408
+ .wpblockhub-import-container .item-list-wrap.active{
409
+ display: block;
410
+ }
411
+
412
+ .item-list-wrap{
413
+ position: absolute;
414
+ width: 300px;
415
+ background: #fff;
416
+ border: 1px solid #ddd;
417
+ padding: 10px;
418
+ box-shadow: 0px 4px 6px 0px rgba(210, 210, 210, 0.4);
419
+ left: -188px;
420
+ max-height: 400px;
421
+ overflow: hidden;
422
+ overflow-y: scroll;
423
+ margin-top: 9px;
424
+ display: none;
425
+ }
426
+
427
+
428
+
429
+
430
+
431
+ .item-list-wrap .item {
432
+ position: relative;
433
+ transition: ease all 1s;
434
+ }
435
+
436
+ .item-list-wrap .item img{}
437
+ .item-list-wrap .item:hover img{}
438
+
439
+ /*.item-list-wrap .item img:before {*/
440
+ /* transition: ease all 1s;*/
441
+ /* content: "";*/
442
+ /* width: 100%;*/
443
+ /* height: 100%;*/
444
+ /* background: #1d1d1d78;*/
445
+ /* position: absolute;*/
446
+ /* top: 0;*/
447
+ /* left: 0;*/
448
+ /* display: none;*/
449
+ /* transform: scale(.5);*/
450
+ /*}*/
451
+
452
+ /*.item-list-wrap .item:hover img:before {*/
453
+
454
+ /* display: block;*/
455
+ /* transform: scale(1);*/
456
+ /*}*/
457
+
458
+ .item-list-wrap .item .item-import {
459
+ position: absolute;
460
+ top: 50%;
461
+ left: 50%;
462
+ transform: translate(-50%, -50%);
463
+ display: none;
464
+ z-index: 99999;
465
+ }
466
+
467
+ .item-list-wrap .item:hover .item-import{
468
+
469
+ display: block;
470
+ }
471
+
472
+ .item-list-wrap .item img{
473
+ transition: ease all 1s;
474
+ }
475
+ .item-list-wrap .item:hover img{
476
+ opacity: 0.3;
477
+ }
478
+
479
+ .item-list-wrap .item.loading{}
480
+ .item-list-wrap .item.loading:before {
481
+ content: "Loading...";
482
+ }
483
+ .item-list-wrap .categories{
484
+ width: 100%;
485
+ margin-bottom: 10px;
486
+ }
487
+ .item-list-wrap .keyword, .item-list-wrap .loading{
488
+ width: 100%;
489
+ }
490
+
491
+
492
+
493
+ .item-list-wrap .load-more{
494
+ width: 100%;
495
+ text-align: center;
496
+ }
497
+
498
+
499
+ .item-list-wrap .plugins-required{}
500
+ .item-list-wrap .plugins-required a{
501
+ text-decoration: none;
502
+ }
503
+
504
+
505
+
506
+ /*Sidebar .wpblockhub-import-wrap*/
507
+
508
+ .wpblockhub-import-wrap{}
509
+ .wpblockhub-import-header-wrap{
510
+ padding: 15px;
511
+ }
512
+
513
+ .wpblockhub-import-header{
514
+
515
+ }
516
+ </style>
includes/metabox-post-grid-hook.php CHANGED
@@ -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','woocommerce-products-slider'),
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', '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,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','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,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','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,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','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,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', 'woocommerce-products-slider'); ?></div>
179
- <p class="description section-description"><?php echo __('Choose container options.', 'woocommerce-products-slider'); ?></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','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,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','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,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','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,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', '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
 
@@ -319,8 +319,8 @@ function post_grid_metabox_tabs_content_query_post($tab, $post_id){
319
  $args = array(
320
  'id' => 'post_types',
321
  'parent' => 'post_grid_meta_options',
322
- 'title' => __('Post types','woocommerce-products-slider'),
323
- 'details' => __('Select your desired post types here you want to display post from, you can choose multiple post type.','woocommerce-products-slider'),
324
  'type' => 'select2',
325
  'multiple' => true,
326
  'value' => $post_types,
@@ -374,8 +374,8 @@ function post_grid_metabox_tabs_content_query_post($tab, $post_id){
374
  'id' => 'terms',
375
  'css_id' => 'terms-'.$taxonomyIndex,
376
  'parent' => 'post_grid_meta_options[taxonomies]['.$taxonomy.']',
377
- 'title' => __('Categories or Terms','woocommerce-products-slider'),
378
- 'details' => __('Select post terms or categories','woocommerce-products-slider'),
379
  'type' => 'select2',
380
  'multiple' => true,
381
  'value' => $terms,
@@ -388,19 +388,19 @@ function post_grid_metabox_tabs_content_query_post($tab, $post_id){
388
  $args = array(
389
  'id' => 'terms_relation',
390
  'parent' => 'post_grid_meta_options[taxonomies]['.$taxonomy.']',
391
- 'title' => __('Terms relation','woocommerce-products-slider'),
392
- 'details' => __('Choose term relation. some option only available in pro','woocommerce-products-slider'),
393
  'type' => 'radio',
394
  'for' => $taxonomy,
395
  'multiple' => true,
396
  'value' => $terms_relation,
397
  'default' => 'IN',
398
  'args' => array(
399
- 'IN'=>__('IN','woocommerce-products-slider'),
400
- 'NOT IN'=>__('NOT IN','woocommerce-products-slider'),
401
- 'AND'=>__('AND','woocommerce-products-slider'),
402
- 'EXISTS'=>__('EXISTS','woocommerce-products-slider'),
403
- 'NOT EXISTS'=>__('NOT EXISTS','woocommerce-products-slider'),
404
  ),
405
  );
406
 
@@ -410,11 +410,11 @@ function post_grid_metabox_tabs_content_query_post($tab, $post_id){
410
  </div>
411
  <?php
412
  }else:
413
- echo __('Please choose at least one post types. save/update post grid','woocommerce-products-slider');
414
  endif;
415
  ?>
416
  </div>
417
- <p class="description"><?php echo __('Select post categories & terms.', 'woocommerce-products-slider'); ?></p>
418
  </div>
419
  </div>
420
 
@@ -422,16 +422,16 @@ function post_grid_metabox_tabs_content_query_post($tab, $post_id){
422
  $args = array(
423
  'id' => 'categories_relation',
424
  'parent' => 'post_grid_meta_options',
425
- 'title' => __('Taxonomies relation','woocommerce-products-slider'),
426
- 'details' => __('Choose Taxonomies relation.','woocommerce-products-slider'),
427
  'type' => 'radio',
428
  //'for' => $taxonomy,
429
  'multiple' => true,
430
  'value' => $categories_relation,
431
  'default' => 'IN',
432
  'args' => array(
433
- 'OR'=>__('OR','woocommerce-products-slider'),
434
- 'AND'=>__('AND','woocommerce-products-slider'),
435
  ),
436
  );
437
 
@@ -440,8 +440,8 @@ function post_grid_metabox_tabs_content_query_post($tab, $post_id){
440
  $args = array(
441
  'id' => 'post_status',
442
  'parent' => 'post_grid_meta_options',
443
- 'title' => __('Post status','woocommerce-products-slider'),
444
- 'details' => __('Display post from following post status.','woocommerce-products-slider'),
445
  'type' => 'select2',
446
  'multiple' => true,
447
  'value' => $post_status,
@@ -455,16 +455,16 @@ function post_grid_metabox_tabs_content_query_post($tab, $post_id){
455
  $args = array(
456
  'id' => 'query_order',
457
  'parent' => 'post_grid_meta_options',
458
- 'title' => __('Post query order','woocommerce-products-slider'),
459
- 'details' => __('Query order ascending or descending.','woocommerce-products-slider'),
460
  'type' => 'select',
461
  //'for' => $taxonomy,
462
  //'multiple' => true,
463
  'value' => $query_order,
464
  'default' => 'DESC',
465
  'args' => array(
466
- 'ASC'=>__('Ascending','woocommerce-products-slider'),
467
- 'DESC'=>__('Descending','woocommerce-products-slider'),
468
  ),
469
  );
470
 
@@ -474,8 +474,8 @@ function post_grid_metabox_tabs_content_query_post($tab, $post_id){
474
  $args = array(
475
  'id' => 'query_orderby',
476
  'parent' => 'post_grid_meta_options',
477
- 'title' => __('Post query orderby','woocommerce-products-slider'),
478
- 'details' => __('Select post query orderby','woocommerce-products-slider'),
479
  'type' => 'select2',
480
  'multiple' => true,
481
  'value' => $query_orderby,
@@ -489,8 +489,8 @@ function post_grid_metabox_tabs_content_query_post($tab, $post_id){
489
  $args = array(
490
  'id' => 'query_orderby_meta_key',
491
  'parent' => 'post_grid_meta_options',
492
- 'title' => __('Query orderby meta key','woocommerce-products-slider'),
493
- 'details' => __('You can use custom meta field key for orderby meta key','woocommerce-products-slider'),
494
  'type' => 'text',
495
  'value' => $query_orderby_meta_key,
496
  'default' => '',
@@ -502,8 +502,8 @@ function post_grid_metabox_tabs_content_query_post($tab, $post_id){
502
  $args = array(
503
  'id' => 'posts_per_page',
504
  'parent' => 'post_grid_meta_options',
505
- 'title' => __('Posts per page','woocommerce-products-slider'),
506
- 'details' => __('Number of post each pagination. -1 to display all. default is 10 if you left empty.','woocommerce-products-slider'),
507
  'type' => 'text',
508
  'value' => $posts_per_page,
509
  'default' => '',
@@ -515,8 +515,8 @@ function post_grid_metabox_tabs_content_query_post($tab, $post_id){
515
  $args = array(
516
  'id' => 'offset',
517
  'parent' => 'post_grid_meta_options',
518
- 'title' => __('Offset','woocommerce-products-slider'),
519
- 'details' => __('Display posts from the n\'th, if you set Posts per page to -1 will not work offset.','woocommerce-products-slider'),
520
  'type' => 'text',
521
  'value' => $offset,
522
  'default' => '',
@@ -528,16 +528,16 @@ function post_grid_metabox_tabs_content_query_post($tab, $post_id){
528
  $args = array(
529
  'id' => 'ignore_paged',
530
  'parent' => 'post_grid_meta_options',
531
- 'title' => __('Ignore paged/page query','woocommerce-products-slider'),
532
- 'details' => __('Ignore paged/page variable from query.','woocommerce-products-slider'),
533
  'type' => 'select',
534
  //'for' => $taxonomy,
535
  //'multiple' => true,
536
  'value' => $ignore_paged,
537
  'default' => 'no',
538
  'args' => array(
539
- 'no'=>__('No','woocommerce-products-slider'),
540
- 'yes'=>__('Yes','woocommerce-products-slider'),
541
  ),
542
  );
543
 
@@ -547,8 +547,8 @@ function post_grid_metabox_tabs_content_query_post($tab, $post_id){
547
  $args = array(
548
  'id' => 'exclude_post_id',
549
  'parent' => 'post_grid_meta_options',
550
- 'title' => __('Exclude by post ID','woocommerce-products-slider'),
551
- 'details' => __('You can exclude any post by ids here, use comma separate post id value, ex: 45,48','woocommerce-products-slider'),
552
  'type' => 'text',
553
  'value' => $exclude_post_id,
554
  'default' => '',
@@ -561,8 +561,8 @@ function post_grid_metabox_tabs_content_query_post($tab, $post_id){
561
  $args = array(
562
  'id' => 'include_post_id',
563
  'parent' => 'post_grid_meta_options',
564
- 'title' => __('Include by post ID','woocommerce-products-slider'),
565
- 'details' => __('You can include any post by ids here, use comma separate post id value, ex: 45,48','woocommerce-products-slider'),
566
  'type' => 'text',
567
  'value' => $include_post_id,
568
  'default' => '',
@@ -574,8 +574,8 @@ function post_grid_metabox_tabs_content_query_post($tab, $post_id){
574
  $args = array(
575
  'id' => 'keyword',
576
  'parent' => 'post_grid_meta_options',
577
- 'title' => __('Search parameter','woocommerce-products-slider'),
578
- 'details' => __('Query post by search keyword, please follow the reference https://codex.wordpress.org/Class_Reference/WP_Query#Search_Parameter','woocommerce-products-slider'),
579
  'type' => 'text',
580
  'value' => $keyword,
581
  'default' => '',
@@ -588,8 +588,8 @@ function post_grid_metabox_tabs_content_query_post($tab, $post_id){
588
  $args = array(
589
  'id' => 'no_post_text',
590
  'parent' => 'post_grid_meta_options',
591
- 'title' => __('No post found text','woocommerce-products-slider'),
592
- 'details' => __('Custom text for no post found. default: No post found','woocommerce-products-slider'),
593
  'type' => 'text',
594
  'value' => $no_post_text,
595
  'default' => '',
@@ -626,8 +626,8 @@ function post_grid_metabox_tabs_content_layouts($tab, $post_id){
626
 
627
  ?>
628
  <div class="section">
629
- <div class="section-title"><?php echo __('Layouts', 'woocommerce-products-slider'); ?></div>
630
- <p class="description section-description"><?php echo __('Choose item layouts.', 'woocommerce-products-slider'); ?></p>
631
 
632
 
633
  <?php
@@ -639,15 +639,15 @@ function post_grid_metabox_tabs_content_layouts($tab, $post_id){
639
  ob_start();
640
 
641
  ?>
642
- <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>
643
- <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>
644
- <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>
645
  <?php
646
  if($import_layouts != 'done'):
647
 
648
 
649
  ?>
650
- <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>
651
  <?php
652
  endif;
653
 
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
 
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
  $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
  $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
  $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
  </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
  $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
  $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
  $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
  </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
 
319
  $args = array(
320
  'id' => 'post_types',
321
  'parent' => 'post_grid_meta_options',
322
+ 'title' => __('Post types','post-grid'),
323
+ 'details' => __('Select your desired post types here you want to display post from, you can choose multiple post type.','post-grid'),
324
  'type' => 'select2',
325
  'multiple' => true,
326
  'value' => $post_types,
374
  'id' => 'terms',
375
  'css_id' => 'terms-'.$taxonomyIndex,
376
  'parent' => 'post_grid_meta_options[taxonomies]['.$taxonomy.']',
377
+ 'title' => __('Categories or Terms','post-grid'),
378
+ 'details' => __('Select post terms or categories','post-grid'),
379
  'type' => 'select2',
380
  'multiple' => true,
381
  'value' => $terms,
388
  $args = array(
389
  'id' => 'terms_relation',
390
  'parent' => 'post_grid_meta_options[taxonomies]['.$taxonomy.']',
391
+ 'title' => __('Terms relation','post-grid'),
392
+ 'details' => __('Choose term relation. some option only available in pro','post-grid'),
393
  'type' => 'radio',
394
  'for' => $taxonomy,
395
  'multiple' => true,
396
  'value' => $terms_relation,
397
  'default' => 'IN',
398
  'args' => array(
399
+ 'IN'=>__('IN','post-grid'),
400
+ 'NOT IN'=>__('NOT IN','post-grid'),
401
+ 'AND'=>__('AND','post-grid'),
402
+ 'EXISTS'=>__('EXISTS','post-grid'),
403
+ 'NOT EXISTS'=>__('NOT EXISTS','post-grid'),
404
  ),
405
  );
406
 
410
  </div>
411
  <?php
412
  }else:
413
+ echo __('Please choose at least one post types. save/update post grid','post-grid');
414
  endif;
415
  ?>
416
  </div>
417
+ <p class="description"><?php echo __('Select post categories & terms.', 'post-grid'); ?></p>
418
  </div>
419
  </div>
420
 
422
  $args = array(
423
  'id' => 'categories_relation',
424
  'parent' => 'post_grid_meta_options',
425
+ 'title' => __('Taxonomies relation','post-grid'),
426
+ 'details' => __('Choose Taxonomies relation.','post-grid'),
427
  'type' => 'radio',
428
  //'for' => $taxonomy,
429
  'multiple' => true,
430
  'value' => $categories_relation,
431
  'default' => 'IN',
432
  'args' => array(
433
+ 'OR'=>__('OR','post-grid'),
434
+ 'AND'=>__('AND','post-grid'),
435
  ),
436
  );
437
 
440
  $args = array(
441
  'id' => 'post_status',
442
  'parent' => 'post_grid_meta_options',
443
+ 'title' => __('Post status','post-grid'),
444
+ 'details' => __('Display post from following post status.','post-grid'),
445
  'type' => 'select2',
446
  'multiple' => true,
447
  'value' => $post_status,
455
  $args = array(
456
  'id' => 'query_order',
457
  'parent' => 'post_grid_meta_options',
458
+ 'title' => __('Post query order','post-grid'),
459
+ 'details' => __('Query order ascending or descending.','post-grid'),
460
  'type' => 'select',
461
  //'for' => $taxonomy,
462
  //'multiple' => true,
463
  'value' => $query_order,
464
  'default' => 'DESC',
465
  'args' => array(
466
+ 'ASC'=>__('Ascending','post-grid'),
467
+ 'DESC'=>__('Descending','post-grid'),
468
  ),
469
  );
470
 
474
  $args = array(
475
  'id' => 'query_orderby',
476
  'parent' => 'post_grid_meta_options',
477
+ 'title' => __('Post query orderby','post-grid'),
478
+ 'details' => __('Select post query orderby','post-grid'),
479
  'type' => 'select2',
480
  'multiple' => true,
481
  'value' => $query_orderby,
489
  $args = array(
490
  'id' => 'query_orderby_meta_key',
491
  'parent' => 'post_grid_meta_options',
492
+ 'title' => __('Query orderby meta key','post-grid'),
493
+ 'details' => __('You can use custom meta field key for orderby meta key','post-grid'),
494
  'type' => 'text',
495
  'value' => $query_orderby_meta_key,
496
  'default' => '',
502
  $args = array(
503
  'id' => 'posts_per_page',
504
  'parent' => 'post_grid_meta_options',
505
+ 'title' => __('Posts per page','post-grid'),
506
+ 'details' => __('Number of post each pagination. -1 to display all. default is 10 if you left empty.','post-grid'),
507
  'type' => 'text',
508
  'value' => $posts_per_page,
509
  'default' => '',
515
  $args = array(
516
  'id' => 'offset',
517
  'parent' => 'post_grid_meta_options',
518
+ 'title' => __('Offset','post-grid'),
519
+ 'details' => __('Display posts from the n\'th, if you set Posts per page to -1 will not work offset.','post-grid'),
520
  'type' => 'text',
521
  'value' => $offset,
522
  'default' => '',
528
  $args = array(
529
  'id' => 'ignore_paged',
530
  'parent' => 'post_grid_meta_options',
531
+ 'title' => __('Ignore paged/page query','post-grid'),
532
+ 'details' => __('Ignore paged/page variable from query.','post-grid'),
533
  'type' => 'select',
534
  //'for' => $taxonomy,
535
  //'multiple' => true,
536
  'value' => $ignore_paged,
537
  'default' => 'no',
538
  'args' => array(
539
+ 'no'=>__('No','post-grid'),
540
+ 'yes'=>__('Yes','post-grid'),
541
  ),
542
  );
543
 
547
  $args = array(
548
  'id' => 'exclude_post_id',
549
  'parent' => 'post_grid_meta_options',
550
+ 'title' => __('Exclude by post ID','post-grid'),
551
+ 'details' => __('You can exclude any post by ids here, use comma separate post id value, ex: 45,48','post-grid'),
552
  'type' => 'text',
553
  'value' => $exclude_post_id,
554
  'default' => '',
561
  $args = array(
562
  'id' => 'include_post_id',
563
  'parent' => 'post_grid_meta_options',
564
+ 'title' => __('Include by post ID','post-grid'),
565
+ 'details' => __('You can include any post by ids here, use comma separate post id value, ex: 45,48','post-grid'),
566
  'type' => 'text',
567
  'value' => $include_post_id,
568
  'default' => '',
574
  $args = array(
575
  'id' => 'keyword',
576
  'parent' => 'post_grid_meta_options',
577
+ 'title' => __('Search parameter','post-grid'),
578
+ 'details' => __('Query post by search keyword, please follow the reference https://codex.wordpress.org/Class_Reference/WP_Query#Search_Parameter','post-grid'),
579
  'type' => 'text',
580
  'value' => $keyword,
581
  'default' => '',
588
  $args = array(
589
  'id' => 'no_post_text',
590
  'parent' => 'post_grid_meta_options',
591
+ 'title' => __('No post found text','post-grid'),
592
+ 'details' => __('Custom text for no post found. default: No post found','post-grid'),
593
  'type' => 'text',
594
  'value' => $no_post_text,
595
  'default' => '',
626
 
627
  ?>
628
  <div class="section">
629
+ <div class="section-title"><?php echo __('Layouts', 'post-grid'); ?></div>
630
+ <p class="description section-description"><?php echo __('Choose item layouts.', 'post-grid'); ?></p>
631
 
632
 
633
  <?php
639
  ob_start();
640
 
641
  ?>
642
+ <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>
643
+ <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>
644
+ <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>
645
  <?php
646
  if($import_layouts != 'done'):
647
 
648
 
649
  ?>
650
+ <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>
651
  <?php
652
  endif;
653
 
includes/post-grid-layout-elements.php CHANGED
@@ -5243,12 +5243,13 @@ function post_grid_layout_element_tags($args){
5243
  $custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
5244
  $link_target = isset($element['link_target']) ? $element['link_target'] : '';
5245
  $max_count = isset($element['max_count']) ? (int) $element['max_count'] : 3;
5246
- $wrapper_html = isset($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
5247
  $separator = isset($element['separator']) ? $element['separator'] : ', ';
5248
 
5249
 
5250
  $term_list = wp_get_post_terms( $post_id, 'post_tag', array( 'fields' => 'all' ) );
5251
 
 
5252
  $categories_html = '';
5253
  $term_total_count = count($term_list);
5254
  $max_term_limit = ($term_total_count < $max_count) ? $term_total_count : $max_count ;
5243
  $custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
5244
  $link_target = isset($element['link_target']) ? $element['link_target'] : '';
5245
  $max_count = isset($element['max_count']) ? (int) $element['max_count'] : 3;
5246
+ $wrapper_html = !empty($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
5247
  $separator = isset($element['separator']) ? $element['separator'] : ', ';
5248
 
5249
 
5250
  $term_list = wp_get_post_terms( $post_id, 'post_tag', array( 'fields' => 'all' ) );
5251
 
5252
+
5253
  $categories_html = '';
5254
  $term_total_count = count($term_list);
5255
  $max_term_limit = ($term_total_count < $max_count) ? $term_total_count : $max_count ;
includes/settings-hook.php CHANGED
@@ -106,59 +106,6 @@ if(!function_exists('post_grid_settings_content_help_support')) {
106
 
107
  <?php
108
 
109
- ob_start();
110
- ?>
111
-
112
- <p><b>Post Gird</b> provide some ready layouts to get started, please follow the steps bellow to import default layouts.</p>
113
-
114
- <p><?php echo __('Import free layouts', 'post-grid'); ?></p>
115
-
116
- <a class="button" href="<?php echo esc_url_raw($layouts_free_url); ?>"><?php echo __('Download XML', 'post-grid'); ?></a>
117
- <a class="button post-grid-import-layouts" href="<?php echo esc_url_raw($layouts_free_url_json); ?>"><?php echo __('Import automatically', 'post-grid'); ?></a>
118
- <a class="button post-grid-import-layouts" skip="yes" href="<?php echo esc_url_raw($layouts_free_url_json); ?>"><?php echo __('Skip', 'post-grid'); ?></a>
119
-
120
-
121
-
122
- <p>Import manually</p>
123
-
124
- <ul>
125
- <li>Step - 1: Go to <a href="<?php echo admin_url(); ?>import.php">import</a> menu and install & activate <b>WordPress</b> Importer plugin. click to "Install Now" button to install.</li>
126
- <li>Step - 2: Download following xml file by clicking button bellow, save the file on your local machine.</li>
127
- <li>Step - 3: Go to importer page <a href="<?php echo admin_url(); ?>import.php?import=wordpress">Import WordPress</a> and chose the downloaded file and then click to <b>Upload file and import</b>.</li>
128
- <li>Step - 4: Go to <a href="<?php echo admin_url(); ?>edit.php?post_type=post_grid_layout">Post Grid layouts</a> page to see imported layouts.</li>
129
- </ul>
130
-
131
-
132
-
133
- <?php
134
- if($layouts_pro_url):
135
- ?>
136
- <p><?php echo __('Download premium layouts', 'post-grid'); ?></p>
137
- <a class="button" href="<?php echo esc_url_raw($layouts_pro_url); ?>"><?php echo __('Download Pro XML', 'post-grid'); ?></a>
138
- <a class="button post-grid-import-layouts" href="<?php echo esc_url_raw($layouts_pro_url_json); ?>"><?php echo __('Import automatically', 'post-grid'); ?></a>
139
- <a class="button post-grid-import-layouts" skip="yes" href="<?php echo esc_url_raw($layouts_pro_url_json); ?>"><?php echo __('Skip', 'post-grid'); ?></a>
140
-
141
- <?php
142
- endif;
143
- ?>
144
-
145
-
146
- <?php
147
-
148
- $html = ob_get_clean();
149
-
150
- $args = array(
151
- 'id' => 'import_layouts',
152
- //'parent' => '',
153
- 'title' => __('Import layouts','post-grid'),
154
- 'details' => '',
155
- 'type' => 'custom_html',
156
- 'html' => $html,
157
-
158
- );
159
-
160
- $settings_tabs_field->generate_field($args);
161
-
162
 
163
 
164
  ob_start();
106
 
107
  <?php
108
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
109
 
110
 
111
  ob_start();
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.67
7
  Author: PickPlugins
8
  Author URI: https://www.pickplugins.com/
9
  License: GPLv2 or later
@@ -21,7 +21,9 @@ 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.67');
 
 
25
 
26
 
27
 
@@ -45,6 +47,7 @@ if( !class_exists( 'PostGrid' )){
45
  include('includes/post-grid-layout-elements.php');
46
  include('includes/media-source-options.php');
47
  include('includes/layout-elements/3rd-party.php');
 
48
 
49
 
50
  include('includes/functions-data-upgrade.php');
@@ -186,6 +189,14 @@ if( !class_exists( 'PostGrid' )){
186
 
187
  wp_register_style('post-grid-addons', post_grid_plugin_url.'assets/admin/css/addons.css');
188
 
 
 
 
 
 
 
 
 
189
  if ($screen->id == 'post_grid'){
190
 
191
  wp_enqueue_script('post_grid_admin_js');
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.68
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.68');
25
+ //define('post_grid_server_url', 'http://localhost/wp/');
26
+ define('post_grid_server_url', 'https://www.pickplugins.com/demo/post-grid/');
27
 
28
 
29
 
47
  include('includes/post-grid-layout-elements.php');
48
  include('includes/media-source-options.php');
49
  include('includes/layout-elements/3rd-party.php');
50
+ include('includes/functions-layout-api.php');
51
 
52
 
53
  include('includes/functions-data-upgrade.php');
189
 
190
  wp_register_style('post-grid-addons', post_grid_plugin_url.'assets/admin/css/addons.css');
191
 
192
+ wp_register_script('post_grid_layouts', post_grid_plugin_url.'assets/admin/js/scripts-layouts.js', array('jquery'));
193
+
194
+ wp_localize_script('post_grid_layouts', 'post_grid_ajax', array(
195
+ 'post_grid_ajaxurl' => admin_url('admin-ajax.php'),
196
+ 'ajax_nonce' => wp_create_nonce('post_grid_ajax_nonce'),
197
+ )
198
+ );
199
+
200
  if ($screen->id == 'post_grid'){
201
 
202
  wp_enqueue_script('post_grid_admin_js');
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.67
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -216,6 +216,9 @@ then paste this shortcode anywhere in your page to display grid<br />
216
 
217
  == Changelog ==
218
 
 
 
 
219
  = 2.0.67 =
220
  * 2020-06-16 remove - remove request popup for reviews.
221
 
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.68
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
216
 
217
  == Changelog ==
218
 
219
+ = 2.0.68 =
220
+ * 2020-07-04 add - Layouts library added.
221
+
222
  = 2.0.67 =
223
  * 2020-06-16 remove - remove request popup for reviews.
224