Post Grid - Version 2.0.57

Version Description

  • 2020-05-15 fix - masonry center align issue fixed.
    • 2020-05-15 add - media link target option added.
    • 2020-05-15 fix - rate-my-post missing issue fixed.
Download this release

Release Info

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

Code changes from version 2.0.55 to 2.0.57

includes/functions-layout-hook.php CHANGED
@@ -646,6 +646,8 @@ 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
  $link_target = isset($element_data['link_target']) ? $element_data['link_target'] : '';
650
  $char_limit = isset($element_data['char_limit']) ? $element_data['char_limit'] : 0;
651
  $read_more_text = isset($element_data['read_more_text']) ? $element_data['read_more_text'] : __('Read more', 'post-grid');
@@ -673,6 +675,26 @@ function post_grid_layout_element_option_excerpt_read_more($parameters){
673
 
674
  <?php
675
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
676
  $args = array(
677
  'id' => 'char_limit',
678
  'css_id' => $element_index.'_char_limit',
@@ -1817,7 +1839,6 @@ function post_grid_layout_element_option_content($parameters){
1817
  $element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
1818
  $element_index = isset($parameters['index']) ? $parameters['index'] : '';
1819
 
1820
- $content_source = isset($element_data['content_source']) ? $element_data['content_source'] : '';
1821
  $word_count = isset($element_data['word_count']) ? $element_data['word_count'] : 15;
1822
  $read_more_text = isset($element_data['read_more_text']) ? $element_data['read_more_text'] : __('Read more','post-grid');
1823
  $read_more_color = isset($element_data['read_more_color']) ? $element_data['read_more_color'] : '';
@@ -1844,19 +1865,7 @@ function post_grid_layout_element_option_content($parameters){
1844
 
1845
  <?php
1846
 
1847
- $args = array(
1848
- 'id' => 'content_source',
1849
- 'css_id' => $element_index.'_content_source',
1850
- 'parent' => $input_name.'[content]',
1851
- 'title' => __('Content source','post-grid'),
1852
- 'details' => __('Choose content source.','post-grid'),
1853
- 'type' => 'select',
1854
- 'value' => $content_source,
1855
- 'default' => 'excerpt',
1856
- 'args' => array('short_description'=> __('Short description', 'post-grid'),'excerpt'=> __('Auto Excerpt', 'post-grid'), 'content'=> __('Content', 'post-grid')),
1857
- );
1858
 
1859
- $settings_tabs_field->generate_field($args);
1860
 
1861
  $args = array(
1862
  'id' => 'word_count',
@@ -2072,6 +2081,8 @@ function post_grid_layout_element_option_excerpt($parameters){
2072
  $color = isset($element_data['color']) ? $element_data['color'] : '';
2073
  $text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
2074
 
 
 
2075
  $link_target = isset($element_data['link_target']) ? $element_data['link_target'] : '';
2076
  $char_limit = isset($element_data['char_limit']) ? $element_data['char_limit'] : 0;
2077
  $read_more_text = isset($element_data['read_more_text']) ? $element_data['read_more_text'] : '';
@@ -2092,6 +2103,25 @@ function post_grid_layout_element_option_excerpt($parameters){
2092
 
2093
  <?php
2094
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2095
 
2096
  $args = array(
2097
  'id' => 'char_limit',
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');
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',
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'] : '';
1865
 
1866
  <?php
1867
 
 
 
 
 
 
 
 
 
 
 
 
1868
 
 
1869
 
1870
  $args = array(
1871
  'id' => 'word_count',
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'] : '';
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',
includes/functions-single.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  if ( ! defined('ABSPATH')) exit; // if direct access
3
 
4
- add_action('the_content','post_grid_single_post');
5
 
6
  function post_grid_single_post($content){
7
 
1
  <?php
2
  if ( ! defined('ABSPATH')) exit; // if direct access
3
 
4
+ //add_action('the_content','post_grid_single_post');
5
 
6
  function post_grid_single_post($content){
7
 
includes/functions.php CHANGED
@@ -515,6 +515,7 @@ function post_grid_media($post_id, $args ){
515
 
516
  $image_size = isset($source_args['image_size']) ? $source_args['image_size'] : 'large';
517
  $link_to = isset($source_args['link_to']) ? $source_args['link_to'] : 'post_link';
 
518
 
519
  $thumb_custom_url = isset($post_settings['thumb_custom_url']) ? $post_settings['thumb_custom_url'] : '';
520
 
@@ -526,10 +527,10 @@ function post_grid_media($post_id, $args ){
526
  if(!empty($thumb_url)){
527
  if($link_to=='post_link'){
528
  if(!empty($thumb_custom_url)){
529
- $html_thumb.= '<a href="'.$thumb_custom_url.'"><img alt="'.$alt_text.'" src="'.$thumb_url.'" /></a>';
530
  }
531
  else{
532
- $html_thumb.= '<a href="'.$item_post_permalink.'"><img alt="'.$alt_text.'" src="'.$thumb_url.'" /></a>';
533
  }
534
  }
535
  else{
@@ -546,11 +547,13 @@ function post_grid_media($post_id, $args ){
546
  elseif($source_id == 'empty_thumb'){
547
 
548
  $link_to = isset($source_args['link_to']) ? $source_args['link_to'] : 'post_link';
 
 
549
  $default_thumb_src = isset($source_args['default_thumb_src']) ? $source_args['default_thumb_src'] : post_grid_plugin_url.'assets/frontend/css/images/placeholder.png';
550
 
551
 
552
  if($link_to=='post_link'){
553
- $html_thumb.= '<a class="custom" href="'.$item_post_permalink.'"><img src="'.$default_thumb_src.'" /></a>';
554
  }
555
  else{
556
  $html_thumb.= '<img class="custom" src="'.$default_thumb_src.'" />';
@@ -561,6 +564,7 @@ function post_grid_media($post_id, $args ){
561
  elseif($source_id == 'first_image'){
562
 
563
  $link_to = isset($source_args['link_to']) ? $source_args['link_to'] : 'post_link';
 
564
 
565
 
566
  //global $post, $posts;
@@ -580,7 +584,7 @@ function post_grid_media($post_id, $args ){
580
  else{
581
 
582
  if($link_to=='post_link'){
583
- $html_thumb.= '<a href="'.$item_post_permalink.'"><img src="'.$first_img.'" /></a>';
584
  }
585
  else{
586
  $html_thumb.= '<img src="'.$first_img.'" />';
@@ -590,6 +594,7 @@ function post_grid_media($post_id, $args ){
590
  elseif($source_id == 'siteorigin_first_image'){
591
 
592
  $link_to = isset($source_args['link_to']) ? $source_args['link_to'] : 'post_link';
 
593
 
594
  //global $post, $posts;
595
  $post = get_post($post_id);
@@ -656,7 +661,7 @@ function post_grid_media($post_id, $args ){
656
  else{
657
 
658
  if($link_to=='post_link'){
659
- $html_thumb.= '<a href="'.$item_post_permalink.'"><img src="'.$first_img.'" /></a>';
660
  }
661
  else{
662
  $html_thumb.= '<img src="'.$first_img.'" />';
515
 
516
  $image_size = isset($source_args['image_size']) ? $source_args['image_size'] : 'large';
517
  $link_to = isset($source_args['link_to']) ? $source_args['link_to'] : 'post_link';
518
+ $link_target = isset($source_args['link_target']) ? $source_args['link_target'] : '';
519
 
520
  $thumb_custom_url = isset($post_settings['thumb_custom_url']) ? $post_settings['thumb_custom_url'] : '';
521
 
527
  if(!empty($thumb_url)){
528
  if($link_to=='post_link'){
529
  if(!empty($thumb_custom_url)){
530
+ $html_thumb.= '<a target="'.$link_target.'" href="'.$thumb_custom_url.'"><img alt="'.$alt_text.'" src="'.$thumb_url.'" /></a>';
531
  }
532
  else{
533
+ $html_thumb.= '<a target="'.$link_target.'" href="'.$item_post_permalink.'"><img alt="'.$alt_text.'" src="'.$thumb_url.'" /></a>';
534
  }
535
  }
536
  else{
547
  elseif($source_id == 'empty_thumb'){
548
 
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'){
556
+ $html_thumb.= '<a target="'.$link_target.'" class="custom" href="'.$item_post_permalink.'"><img src="'.$default_thumb_src.'" /></a>';
557
  }
558
  else{
559
  $html_thumb.= '<img class="custom" src="'.$default_thumb_src.'" />';
564
  elseif($source_id == 'first_image'){
565
 
566
  $link_to = isset($source_args['link_to']) ? $source_args['link_to'] : 'post_link';
567
+ $link_target = isset($source_args['link_target']) ? $source_args['link_target'] : '';
568
 
569
 
570
  //global $post, $posts;
584
  else{
585
 
586
  if($link_to=='post_link'){
587
+ $html_thumb.= '<a target="'.$link_target.'" href="'.$item_post_permalink.'"><img src="'.$first_img.'" /></a>';
588
  }
589
  else{
590
  $html_thumb.= '<img src="'.$first_img.'" />';
594
  elseif($source_id == 'siteorigin_first_image'){
595
 
596
  $link_to = isset($source_args['link_to']) ? $source_args['link_to'] : 'post_link';
597
+ $link_target = isset($source_args['link_target']) ? $source_args['link_target'] : '';
598
 
599
  //global $post, $posts;
600
  $post = get_post($post_id);
661
  else{
662
 
663
  if($link_to=='post_link'){
664
+ $html_thumb.= '<a target="'.$link_target.'" href="'.$item_post_permalink.'"><img src="'.$first_img.'" /></a>';
665
  }
666
  else{
667
  $html_thumb.= '<img src="'.$first_img.'" />';
includes/functions/functions-post-grid-meta-box.php CHANGED
@@ -243,12 +243,6 @@ function post_grid_metabox_tabs_content_general($tab, $post_id){
243
  'left'=>__('Left','post-grid'),
244
  'center'=>__('Center','post-grid'),
245
  'right'=>__('Right','post-grid'),
246
- 'start'=>__('Start','post-grid'),
247
- 'end'=>__('End','post-grid'),
248
- 'initial'=>__('Initial','post-grid'),
249
- 'justify'=>__('Justify','post-grid'),
250
-
251
-
252
  ),
253
  );
254
 
243
  'left'=>__('Left','post-grid'),
244
  'center'=>__('Center','post-grid'),
245
  'right'=>__('Right','post-grid'),
 
 
 
 
 
 
246
  ),
247
  );
248
 
includes/functions/media-source-options.php CHANGED
@@ -6,7 +6,6 @@ add_action('media_source_options_featured_image', 'media_source_options_featured
6
  function media_source_options_featured_image($media_source){
7
  $settings_tabs_field = new settings_tabs_field();
8
 
9
- $post_grid_settings = get_option('post_grid_settings');
10
 
11
  $index = isset($media_source['index']) ? $media_source['index'] : '';
12
  $input_name = isset($media_source['input_name']) ? $media_source['input_name'] : '';
@@ -18,6 +17,7 @@ function media_source_options_featured_image($media_source){
18
  $enable = isset($source_data['enable']) ? $source_data['enable'] : '';
19
  $image_size = isset($source_data['image_size']) ? $source_data['image_size'] : '';
20
  $link_to = isset($source_data['link_to']) ? $source_data['link_to'] : '';
 
21
 
22
 
23
  $args = array(
@@ -68,6 +68,26 @@ function media_source_options_featured_image($media_source){
68
  $settings_tabs_field->generate_field($args);
69
 
70
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
 
72
  }
73
 
@@ -76,7 +96,6 @@ add_action('media_source_options_first_image', 'media_source_options_first_image
76
  function media_source_options_first_image($media_source){
77
  $settings_tabs_field = new settings_tabs_field();
78
 
79
- $post_grid_settings = get_option('post_grid_settings');
80
 
81
  $index = isset($media_source['index']) ? $media_source['index'] : '';
82
  $input_name = isset($media_source['input_name']) ? $media_source['input_name'] : '';
@@ -84,6 +103,7 @@ function media_source_options_first_image($media_source){
84
 
85
  $enable = isset($source_data['enable']) ? $source_data['enable'] : '';
86
  $link_to = isset($source_data['link_to']) ? $source_data['link_to'] : '';
 
87
 
88
 
89
 
@@ -120,6 +140,26 @@ function media_source_options_first_image($media_source){
120
 
121
  $settings_tabs_field->generate_field($args);
122
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
123
  }
124
 
125
 
@@ -129,7 +169,6 @@ add_action('media_source_options_siteorigin_first_image', 'media_source_options_
129
  function media_source_options_siteorigin_first_image($media_source){
130
  $settings_tabs_field = new settings_tabs_field();
131
 
132
- $post_grid_settings = get_option('post_grid_settings');
133
 
134
  $index = isset($media_source['index']) ? $media_source['index'] : '';
135
  $input_name = isset($media_source['input_name']) ? $media_source['input_name'] : '';
@@ -137,6 +176,7 @@ function media_source_options_siteorigin_first_image($media_source){
137
 
138
  $enable = isset($source_data['enable']) ? $source_data['enable'] : '';
139
  $link_to = isset($source_data['link_to']) ? $source_data['link_to'] : '';
 
140
 
141
 
142
 
@@ -173,6 +213,26 @@ function media_source_options_siteorigin_first_image($media_source){
173
 
174
  $settings_tabs_field->generate_field($args);
175
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
176
  }
177
 
178
 
@@ -188,7 +248,6 @@ add_action('media_source_options_empty_thumb', 'media_source_options_empty_thumb
188
  function media_source_options_empty_thumb($media_source){
189
  $settings_tabs_field = new settings_tabs_field();
190
 
191
- $post_grid_settings = get_option('post_grid_settings');
192
 
193
  $index = isset($media_source['index']) ? $media_source['index'] : '';
194
  $input_name = isset($media_source['input_name']) ? $media_source['input_name'] : '';
@@ -197,6 +256,7 @@ function media_source_options_empty_thumb($media_source){
197
  $enable = isset($source_data['enable']) ? $source_data['enable'] : '';
198
  $default_thumb_src = isset($source_data['default_thumb_src']) ? $source_data['default_thumb_src'] : '';
199
  $link_to = isset($source_data['link_to']) ? $source_data['link_to'] : '';
 
200
 
201
 
202
 
@@ -235,6 +295,25 @@ function media_source_options_empty_thumb($media_source){
235
 
236
  $settings_tabs_field->generate_field($args);
237
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
238
 
239
  $args = array(
240
  'id' => 'default_thumb_src',
6
  function media_source_options_featured_image($media_source){
7
  $settings_tabs_field = new settings_tabs_field();
8
 
 
9
 
10
  $index = isset($media_source['index']) ? $media_source['index'] : '';
11
  $input_name = isset($media_source['input_name']) ? $media_source['input_name'] : '';
17
  $enable = isset($source_data['enable']) ? $source_data['enable'] : '';
18
  $image_size = isset($source_data['image_size']) ? $source_data['image_size'] : '';
19
  $link_to = isset($source_data['link_to']) ? $source_data['link_to'] : '';
20
+ $link_target = isset($source_data['link_target']) ? $source_data['link_target'] : '';
21
 
22
 
23
  $args = array(
68
  $settings_tabs_field->generate_field($args);
69
 
70
 
71
+ $args = array(
72
+ 'id' => 'link_target',
73
+ 'css_id' => $index.'_link_target',
74
+ 'parent' => $input_name.'[media][media_source][featured_image]',
75
+ 'title' => __('Link target','post-grid'),
76
+ 'details' => __('Choose link target.','post-grid'),
77
+ 'type' => 'select',
78
+ 'value' => $link_target,
79
+ 'default' => '_self',
80
+ 'args' => array(
81
+ '_blank'=> __('_blank', 'post-grid'),
82
+ '_parent'=> __('_parent', 'post-grid'),
83
+ '_self'=> __('_self', 'post-grid'),
84
+ '_top'=> __('_top', 'post-grid'),
85
+
86
+ ),
87
+ );
88
+
89
+ $settings_tabs_field->generate_field($args);
90
+
91
 
92
  }
93
 
96
  function media_source_options_first_image($media_source){
97
  $settings_tabs_field = new settings_tabs_field();
98
 
 
99
 
100
  $index = isset($media_source['index']) ? $media_source['index'] : '';
101
  $input_name = isset($media_source['input_name']) ? $media_source['input_name'] : '';
103
 
104
  $enable = isset($source_data['enable']) ? $source_data['enable'] : '';
105
  $link_to = isset($source_data['link_to']) ? $source_data['link_to'] : '';
106
+ $link_target = isset($source_data['link_target']) ? $source_data['link_target'] : '';
107
 
108
 
109
 
140
 
141
  $settings_tabs_field->generate_field($args);
142
 
143
+
144
+ $args = array(
145
+ 'id' => 'link_target',
146
+ 'css_id' => $index.'_link_target',
147
+ 'parent' => $input_name.'[media][media_source][first_image]',
148
+ 'title' => __('Link target','post-grid'),
149
+ 'details' => __('Choose link target.','post-grid'),
150
+ 'type' => 'select',
151
+ 'value' => $link_target,
152
+ 'default' => '_self',
153
+ 'args' => array(
154
+ '_blank'=> __('_blank', 'post-grid'),
155
+ '_parent'=> __('_parent', 'post-grid'),
156
+ '_self'=> __('_self', 'post-grid'),
157
+ '_top'=> __('_top', 'post-grid'),
158
+
159
+ ),
160
+ );
161
+
162
+ $settings_tabs_field->generate_field($args);
163
  }
164
 
165
 
169
  function media_source_options_siteorigin_first_image($media_source){
170
  $settings_tabs_field = new settings_tabs_field();
171
 
 
172
 
173
  $index = isset($media_source['index']) ? $media_source['index'] : '';
174
  $input_name = isset($media_source['input_name']) ? $media_source['input_name'] : '';
176
 
177
  $enable = isset($source_data['enable']) ? $source_data['enable'] : '';
178
  $link_to = isset($source_data['link_to']) ? $source_data['link_to'] : '';
179
+ $link_target = isset($source_data['link_target']) ? $source_data['link_target'] : '';
180
 
181
 
182
 
213
 
214
  $settings_tabs_field->generate_field($args);
215
 
216
+ $args = array(
217
+ 'id' => 'link_target',
218
+ 'css_id' => $index.'_link_target',
219
+ 'parent' => $input_name.'[media][media_source][siteorigin_first_image]',
220
+ 'title' => __('Link target','post-grid'),
221
+ 'details' => __('Choose link target.','post-grid'),
222
+ 'type' => 'select',
223
+ 'value' => $link_target,
224
+ 'default' => '_self',
225
+ 'args' => array(
226
+ '_blank'=> __('_blank', 'post-grid'),
227
+ '_parent'=> __('_parent', 'post-grid'),
228
+ '_self'=> __('_self', 'post-grid'),
229
+ '_top'=> __('_top', 'post-grid'),
230
+
231
+ ),
232
+ );
233
+
234
+ $settings_tabs_field->generate_field($args);
235
+
236
  }
237
 
238
 
248
  function media_source_options_empty_thumb($media_source){
249
  $settings_tabs_field = new settings_tabs_field();
250
 
 
251
 
252
  $index = isset($media_source['index']) ? $media_source['index'] : '';
253
  $input_name = isset($media_source['input_name']) ? $media_source['input_name'] : '';
256
  $enable = isset($source_data['enable']) ? $source_data['enable'] : '';
257
  $default_thumb_src = isset($source_data['default_thumb_src']) ? $source_data['default_thumb_src'] : '';
258
  $link_to = isset($source_data['link_to']) ? $source_data['link_to'] : '';
259
+ $link_target = isset($source_data['link_target']) ? $source_data['link_target'] : '';
260
 
261
 
262
 
295
 
296
  $settings_tabs_field->generate_field($args);
297
 
298
+ $args = array(
299
+ 'id' => 'link_target',
300
+ 'css_id' => $index.'_link_target',
301
+ 'parent' => $input_name.'[media][media_source][empty_thumb]',
302
+ 'title' => __('Link target','post-grid'),
303
+ 'details' => __('Choose link target.','post-grid'),
304
+ 'type' => 'select',
305
+ 'value' => $link_target,
306
+ 'default' => '_self',
307
+ 'args' => array(
308
+ '_blank'=> __('_blank', 'post-grid'),
309
+ '_parent'=> __('_parent', 'post-grid'),
310
+ '_self'=> __('_self', 'post-grid'),
311
+ '_top'=> __('_top', 'post-grid'),
312
+
313
+ ),
314
+ );
315
+
316
+ $settings_tabs_field->generate_field($args);
317
 
318
  $args = array(
319
  'id' => 'default_thumb_src',
includes/functions/post-grid-layout-elements.php CHANGED
@@ -416,30 +416,60 @@ function post_grid_layout_element_excerpt($args){
416
  if(empty($post_id)) return;
417
 
418
  $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
419
- $the_post = get_post($post_id);
420
 
421
 
422
- $post_content = isset($the_post->post_content) ? $the_post->post_content : '';
423
-
424
- $post_content = strip_shortcodes( $post_content );
425
- $post_content = excerpt_remove_blocks( $post_content );
426
 
427
 
428
  //$post_excerpt = get_the_excerpt($post_id);
429
 
430
 
431
  $post_link = get_permalink($post_id);
 
432
 
433
  $link_target = isset($element['link_target']) ? $element['link_target'] : '';
434
  $custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
435
  $char_limit = !empty($element['char_limit']) ? (int) $element['char_limit'] : 50;
436
  $read_more_text = isset($element['read_more_text']) ? $element['read_more_text'] : '';
437
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
438
 
439
  if($char_limit > 0){
440
- $post_excerpt = wp_trim_words($post_content, $char_limit, '');
441
  }
442
 
 
 
443
 
444
  ?>
445
  <div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> excerpt ">
@@ -530,12 +560,11 @@ function post_grid_layout_element_excerpt_read_more($args){
530
 
531
  $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
532
 
533
- $post_excerpt = get_the_excerpt($post_id);
534
 
535
- if(empty($post_excerpt)) return;
536
 
537
  $post_link = get_permalink($post_id);
538
 
 
539
 
540
  $custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
541
  $char_limit = isset($element['char_limit']) ? (int) $element['char_limit'] : 0;
@@ -543,6 +572,33 @@ function post_grid_layout_element_excerpt_read_more($args){
543
  $link_target = isset($element['link_target']) ? $element['link_target'] : '';
544
 
545
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
546
  if($char_limit > 0){
547
  $post_excerpt = wp_trim_words($post_excerpt, $char_limit, '');
548
  }
@@ -671,7 +727,7 @@ function post_grid_layout_element_css_read_more($args){
671
  <style type="text/css">
672
  .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
673
  <?php if(!empty($color)): ?>
674
- color: <?php echo $color; ?>;
675
  <?php endif; ?>
676
  <?php if(!empty($font_size)): ?>
677
  font-size: <?php echo $font_size; ?>;
@@ -696,13 +752,13 @@ function post_grid_layout_element_css_read_more($args){
696
  <?php endif; ?>
697
  .layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?> a{
698
  <?php if(!empty($color)): ?>
699
- color: <?php echo $color; ?>;
700
  <?php endif; ?>
701
  <?php if(!empty($font_size)): ?>
702
- font-size: <?php echo $font_size; ?>;
703
  <?php endif; ?>
704
  <?php if(!empty($font_family)): ?>
705
- font-family: <?php echo $font_family; ?>;
706
  <?php endif; ?>
707
  }
708
  </style>
@@ -1090,7 +1146,7 @@ function post_grid_layout_element_post_date($args){
1090
  if(empty($post_id)) return;
1091
 
1092
  $custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
1093
- $link_to = isset($element['link_to']) ? $element['link_to'] : 'post_link';
1094
  $link_target = isset($element['link_target']) ? $element['link_target'] : '';
1095
  $date_format = isset($element['date_format']) ? $element['date_format'] : 'd-m-Y';
1096
  $wrapper_html = !empty($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
@@ -1188,7 +1244,7 @@ function post_grid_layout_element_author($args){
1188
  if(empty($post_id)) return;
1189
 
1190
  $custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
1191
- $link_to = isset($element['link_to']) ? $element['link_to'] : 'post_link';
1192
  $link_target = isset($element['link_target']) ? $element['link_target'] : '';
1193
  $wrapper_html = !empty($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
1194
 
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 ">
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;
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
  }
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; ?>;
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>
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';
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
 
includes/layout-elements/3rd-party.php CHANGED
@@ -28,7 +28,10 @@ if ( is_plugin_active( 'kk-star-ratings/index.php' ) ) {
28
  }
29
 
30
 
 
31
 
 
 
32
 
33
 
34
  if ( is_plugin_active( 'wp-postratings/wp-postratings.php' ) ) {
28
  }
29
 
30
 
31
+ if ( is_plugin_active( 'rate-my-post/rate-my-post.php' ) ) {
32
 
33
+ require_once( post_grid_plugin_dir . 'includes/layout-elements/rate-my-post/layout-elements.php');
34
+ }
35
 
36
 
37
  if ( is_plugin_active( 'wp-postratings/wp-postratings.php' ) ) {
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.55
7
  Author: PickPlugins
8
  Author URI: https://www.pickplugins.com/
9
  License: GPLv2 or later
@@ -21,7 +21,7 @@ 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.55');
25
 
26
  include('includes/classes/class-post-types.php');
27
  include('includes/functions/functions-settings-hook.php');
3
  Plugin Name: Post Grid by PickPlugins
4
  Plugin URI: https://www.pickplugins.com/item/post-grid-create-awesome-grid-from-any-post-type-for-wordpress/
5
  Description: Awesome post grid for query post from any post type and display on grid.
6
+ Version: 2.0.57
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.57');
25
 
26
  include('includes/classes/class-post-types.php');
27
  include('includes/functions/functions-settings-hook.php');
readme.txt CHANGED
@@ -4,7 +4,7 @@
4
  Tags: post grid, grid, custom post grid, post type grid, grid display, category filter, custom post, filter, filtering, grid, layout, list, masonry, post, post filter, post layout, taxonomy, taxonomy filter,
5
  Requires at least: 3.8
6
  Tested up to: 5.4
7
- Stable tag: 2.0.55
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -76,33 +76,167 @@ max height.
76
  * Lazy load - you can enable lazy load to hide grid on page load.
77
  * Featured image custom size selection.
78
  * Custom media source - there is 3 different source available in free version. Featured Image, First images from
79
- content,
80
- Empty thumbnail
81
  * Masonry style grid also available.
82
 
83
 
84
 
85
  ###Premium features
86
 
87
- <strong>Variety of media display</strong>
88
- you can display YouTube, vimeo, dailymotion, soundcloud, mp3, gallery, Font Awesome icons on thumbnail area. linked to custom link on thumbnail image.
89
-
90
- * 29+ ready skin.
91
- * Query post by taxonomy(multiple) & terms(multiple).
92
- * support for WooCommerce, Easy Digital Downloads, WP eCommerce.
93
- * Display Meta Fields. Custom wrapper (HTML) for meta values display.
94
- * Display Short-code via Meta Fields.
95
- * Display YouTube, vimeo video, soundcloud, mp3, gallery, Font Awesome icons on thumbnail area.
96
- * Filterable Grid by custom taxonomy & terms.
97
- * Ajax load more.
98
- * Extend grid skin by filter hook.
99
- * Pagination custom Next , Previous text.
100
- * Add custom HTML(Shortcodes) via layout editor.
101
- * Create unlimited layout via layout editor.
102
- * Post grid for Archive page(category.php, tags.php , custom taxonomy & terms page).
103
- * Extra query parameter.
104
- * Create unlimited layout via layout editor.
105
- * Add custom HTML(Shortcodes) via layout editor.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
106
 
107
 
108
  <strong>Video Tutorial(with premium version interface)</strong>
@@ -139,7 +273,13 @@ then paste this shortcode anywhere in your page to display grid<br />
139
 
140
  == Changelog ==
141
 
 
 
 
 
142
 
 
 
143
 
144
  = 2.0.55 =
145
  * 2020-05-4 fix - remove empty read more text to avoid conflict old layout.
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
 
76
  * Lazy load - you can enable lazy load to hide grid on page load.
77
  * Featured image custom size selection.
78
  * Custom media source - there is 3 different source available in free version. Featured Image, First images from
79
+ content, Empty thumbnail
 
80
  * Masonry style grid also available.
81
 
82
 
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
92
+ * Glossary
93
+ * Carousel Slider
94
+ * Collapsible
95
+
96
+ **Advance Pagination types**
97
+
98
+ * Ajax Pagination
99
+ * Next-Previous
100
+ * Filterable pagination
101
+ * Ajax Load More
102
+
103
+ **Advance Media Sources**
104
+
105
+ * First youtube video from content
106
+ * Custom youtube video
107
+ * First vimeo video from content
108
+ * Custom vimeo video
109
+ * First dailymotion video from content
110
+ * Custom dailymotion video
111
+ * First MP3 from content
112
+ * Custom MP3
113
+ * First SoundCloud from content
114
+ * Custom SoundCloud
115
+ * Custom Thumbnail
116
+ * Font Awesome
117
+ * Custom Video
118
+
119
+ **Filterable Features**
120
+
121
+ * Display navs by taxonomies & terms or Custom filters.
122
+ * Navs style - Font size, Font color, Background color, Margin, display post count.
123
+ * Navs view style - Inline, Dropdown, Radio, Checkbox.
124
+ * Custom text for All navs.
125
+ * Custom default active filter
126
+ * Single or group filter navs.
127
+ * Sorting filter
128
+
129
+
130
+
131
+ **Advance Query**
132
+
133
+ * Meta query - Single field and multiple field query
134
+ * Extra query parameter - you can provide your own query parameter like `post__in=1,2,3&post__not_in=1,2,3`
135
+ * Permission parameters - Show posts if user has the appropriate capability
136
+ * Sticky post query - Include sticky post or Exclude sticky post
137
+ * Date parameters - by Exact date, Between two date.
138
+ * Author parameters - Include authors by ids, Exclude authors by ids.
139
+ * Password parameters - Display only password protected posts, Display only posts without passwords, Display only posts with and without passwords, Posts with particular password.
140
+
141
+
142
+ ## 3rd party plugins support
143
+
144
+ **WooCommerce**
145
+ WooCommerce is #1 ecommerce plugin for WordPress and we provide full support to display following elements for products on the post grid.
146
+
147
+ * Add to cart
148
+ * Full price
149
+ * Sale price
150
+ * Regular price
151
+ * Star rating
152
+ * Text rating
153
+ * Product categories
154
+ * Product tags
155
+ * Product gallery
156
+ * Product SKU
157
+
158
+
159
+ **Easy Digital Download**
160
+ Easy Digital Download is another best ecommerce for digital products and we provide full support to display following elements for downloads on the post grid.
161
+
162
+ * Price
163
+ * Variable prices
164
+ * Sales stats
165
+ * Earnings stats
166
+ * Add to cart
167
+ * Text rating
168
+ * download categories
169
+ * download tags
170
+
171
+
172
+ **Advanced Custom Fields**
173
+ Advanced Custom Fields is #1 custom field's plugin for WordPress and we added full support to display following meta fields for any post types.
174
+
175
+ * Text
176
+ * Textarea
177
+ * Number
178
+ * Range
179
+ * Email
180
+ * URL
181
+ * Password
182
+ * Link
183
+ * Post object
184
+ * Page link
185
+ * Taxonomy
186
+ * User
187
+ * Relationship
188
+ * Image
189
+ * File
190
+ * Wysiwyg
191
+ * oEmbed
192
+ * Select
193
+ * Checkbox
194
+ * Radio
195
+ * Button group
196
+ * True / False
197
+ * Date picker
198
+ * Time picker
199
+ * Datetime picker
200
+ * Google Map
201
+
202
+
203
+
204
+ **The Events Calendar**
205
+ The Events Calendar is #1 event's manager plugin for WordPress and we added full support to display following elements for event post type
206
+
207
+ * Event categories
208
+ * Event tags
209
+ * Event start date
210
+ * Event end date
211
+ * Event URL
212
+ * Event cost
213
+ * Venue address
214
+ * Venue city
215
+ * Venue country
216
+ * Venue province
217
+ * Venue zip
218
+ * Venue phone
219
+ * Venue URL
220
+ * Venue Map
221
+ * Organizer Phone
222
+ * Organizer Website
223
+ * Organizer Email
224
+
225
+
226
+ **Events Manager**
227
+ Events Manager is another best event's manager plugin for WordPress and we added full support to display following elements for event post type
228
+
229
+ * Event categories
230
+ * Event tags
231
+ * Event start date
232
+ * Event end date
233
+ * Event start time
234
+ * Event end time
235
+ * Event spaces
236
+ * Max Spaces
237
+ * Cut-Off Date
238
+ * Cut-Off time
239
+
240
 
241
 
242
  <strong>Video Tutorial(with premium version interface)</strong>
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.
279
+ * 2020-05-15 fix - rate-my-post missing issue fixed.
280
 
281
+ = 2.0.56 =
282
+ * 2020-05-15 fix - Excerpt element output issue fixed.
283
 
284
  = 2.0.55 =
285
  * 2020-05-4 fix - remove empty read more text to avoid conflict old layout.
templates/post-grid-hook.php CHANGED
@@ -1100,8 +1100,10 @@ function post_grid_main_scripts($args){
1100
  var $container = $('#post-grid-<?php echo $grid_id; ?> .grid-items');
1101
  $container.masonry({
1102
  itemSelector: '.item',
1103
- columnWidth: '.item',
1104
- horizontalOrder: true, // new!
 
 
1105
  });
1106
  $container.imagesLoaded().done( function() {
1107
  $container.masonry('layout');
1100
  var $container = $('#post-grid-<?php echo $grid_id; ?> .grid-items');
1101
  $container.masonry({
1102
  itemSelector: '.item',
1103
+ columnWidth: '.item', //as you wish , you can use numeric
1104
+ isAnimated: true,
1105
+ isFitWidth: true,
1106
+ horizontalOrder: true,
1107
  });
1108
  $container.imagesLoaded().done( function() {
1109
  $container.masonry('layout');