Content Views – Post Grid & List for WordPress - Version 1.7.1

Version Description

  • Bug fixed: Fix error in some one-page themes
  • Update: Add woff2 file of Bootstrap font
  • Improvement: Code cleanup & remove no more used filters
  • Tweak: Add some filter actions
Download this release

Release Info

Developer PT Guy
Plugin Icon 128x128 Content Views – Post Grid & List for WordPress
Version 1.7.1
Comparing to
See all releases

Code changes from version 1.7.0 to 1.7.1

README.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
  Tags: post, display, recent, posts, recent post, page, pages, query, queries, search, display, show, grid, column, layout, author, blog, categories, category, comment, content, custom, editor, filter, Formatting, image, list, meta, plugin, responsive, shortcode, excerpt, title, tag, term, Taxonomy, thumbnail, pagination, date, scrollable, slider, collapsible
5
  Requires at least: 3.3
6
  Tested up to: 4.3.1
7
- Stable tag: 1.7.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -162,6 +162,12 @@ function my_session_start() {
162
 
163
  == Changelog ==
164
 
 
 
 
 
 
 
165
  = 1.7.0 =
166
  * Improvement: Completely avoid layout issues or style conflict with theme
167
  * Bug fixed: Collapsible layout does not animate smoothly
4
  Tags: post, display, recent, posts, recent post, page, pages, query, queries, search, display, show, grid, column, layout, author, blog, categories, category, comment, content, custom, editor, filter, Formatting, image, list, meta, plugin, responsive, shortcode, excerpt, title, tag, term, Taxonomy, thumbnail, pagination, date, scrollable, slider, collapsible
5
  Requires at least: 3.3
6
  Tested up to: 4.3.1
7
+ Stable tag: 1.7.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
162
 
163
  == Changelog ==
164
 
165
+ = 1.7.1 =
166
+ * Bug fixed: Fix error in some one-page themes
167
+ * Update: Add woff2 file of Bootstrap font
168
+ * Improvement: Code cleanup & remove no more used filters
169
+ * Tweak: Add some filter actions
170
+
171
  = 1.7.0 =
172
  * Improvement: Completely avoid layout issues or style conflict with theme
173
  * Bug fixed: Collapsible layout does not animate smoothly
admin/assets/css/admin.css CHANGED
@@ -39,7 +39,7 @@ html {
39
 
40
  .pt-wrap .text-muted {
41
  clear: both;
42
- margin: 2px 0;
43
  float: left;
44
  }
45
 
@@ -128,7 +128,7 @@ html {
128
  }
129
 
130
  .pt-cv-group .panel-body {
131
- padding: 10px 15px;
132
  }
133
 
134
  .pt-cv-group .control-label, .pt-form-group .pt-form-group .control-label {
39
 
40
  .pt-wrap .text-muted {
41
  clear: both;
42
+ margin: 0px 0 2px;
43
  float: left;
44
  }
45
 
128
  }
129
 
130
  .pt-cv-group .panel-body {
131
+ padding: 5px 15px;
132
  }
133
 
134
  .pt-cv-group .control-label, .pt-form-group .pt-form-group .control-label {
admin/assets/images/icon1.png DELETED
Binary file
admin/views/view.php CHANGED
@@ -59,7 +59,7 @@ PT_CV_Functions::view_submit();
59
  'type' => 'html',
60
  'name' => 'preview',
61
  'content' => PT_CV_Html::html_preview_box(),
62
- 'desc' => __( 'Click "Show Preview" or "Update Preview" button to show, "Hide Preview" button to hide the output', PT_CV_TEXTDOMAIN ),
63
  ),
64
  ),
65
  ),
@@ -189,7 +189,7 @@ PT_CV_Functions::view_submit();
189
  'type' => 'text',
190
  'name' => 'post__in',
191
  'std' => '',
192
- 'desc' => __( 'List of post ids to include (comma-separated values, e.g. 1,2,3)', PT_CV_TEXTDOMAIN ),
193
  ),
194
  ),
195
  ),
@@ -204,7 +204,7 @@ PT_CV_Functions::view_submit();
204
  'type' => 'text',
205
  'name' => 'post__not_in',
206
  'std' => '',
207
- 'desc' => __( 'List of post ids to exclude (comma-separated values, e.g. 1,2,3)', PT_CV_TEXTDOMAIN ),
208
  ),
209
  ),
210
  ),
59
  'type' => 'html',
60
  'name' => 'preview',
61
  'content' => PT_CV_Html::html_preview_box(),
62
+ 'desc' => __( 'Click <strong>Show Preview</strong> or <strong>Update Preview</strong> button to show, <strong>Hide Preview</strong> button to hide the output', PT_CV_TEXTDOMAIN ),
63
  ),
64
  ),
65
  ),
189
  'type' => 'text',
190
  'name' => 'post__in',
191
  'std' => '',
192
+ 'desc' => apply_filters( PT_CV_PREFIX_ . 'setting_post_in', __( 'List of post ids to include (comma-separated values, e.g. 1,2,3)', PT_CV_TEXTDOMAIN ) ),
193
  ),
194
  ),
195
  ),
204
  'type' => 'text',
205
  'name' => 'post__not_in',
206
  'std' => '',
207
+ 'desc' => apply_filters( PT_CV_PREFIX_ . 'setting_post_not_in', __( 'List of post ids to exclude (comma-separated values, e.g. 1,2,3)', PT_CV_TEXTDOMAIN ) ),
208
  ),
209
  ),
210
  ),
assets/bootstrap/fonts/glyphicons-halflings-regular.woff2 ADDED
Binary file
content-views.php CHANGED
@@ -11,7 +11,7 @@
11
  * Plugin Name: Content Views
12
  * Plugin URI: http://wordpress.org/plugins/content-views-query-and-display-post-page/
13
  * Description: Query and display <strong>posts, pages</strong> in awesome layouts (<strong>grid, scrollable list, collapsible list</strong>) easier than ever, without coding!
14
- * Version: 1.7.0
15
  * Author: PT Guy
16
  * Author URI: http://profiles.wordpress.org/pt-guy
17
  * Text Domain: content-views-query-and-display-post-page
@@ -27,7 +27,7 @@ if ( !defined( 'WPINC' ) ) {
27
  /*
28
  * Define Constant
29
  */
30
- define( 'PT_CV_VERSION', '1.7.0' );
31
  define( 'PT_CV_FILE', __FILE__ );
32
  $pt_cv_path = plugin_dir_path( __FILE__ );
33
  include_once( $pt_cv_path . 'includes/defines.php' );
11
  * Plugin Name: Content Views
12
  * Plugin URI: http://wordpress.org/plugins/content-views-query-and-display-post-page/
13
  * Description: Query and display <strong>posts, pages</strong> in awesome layouts (<strong>grid, scrollable list, collapsible list</strong>) easier than ever, without coding!
14
+ * Version: 1.7.1
15
  * Author: PT Guy
16
  * Author URI: http://profiles.wordpress.org/pt-guy
17
  * Text Domain: content-views-query-and-display-post-page
27
  /*
28
  * Define Constant
29
  */
30
+ define( 'PT_CV_VERSION', '1.7.1' );
31
  define( 'PT_CV_FILE', __FILE__ );
32
  $pt_cv_path = plugin_dir_path( __FILE__ );
33
  include_once( $pt_cv_path . 'includes/defines.php' );
includes/functions.php CHANGED
@@ -764,8 +764,9 @@ if ( !class_exists( 'PT_CV_Functions' ) ) {
764
  // Hide empty result
765
  $html = '';
766
  } else {
767
- $current_page = self::get_current_page( $pargs );
768
- $html = PT_CV_Html::content_items_wrap( $content_items, $current_page, $args[ 'posts_per_page' ], $view_id );
 
769
 
770
  // Append Pagination HTML if this is first page, or not Ajax calling
771
  if ( $pt_query && $args[ 'posts_per_page' ] > 0 && PT_CV_Functions::nonpaging_or_firstpage( $dargs, $current_page ) ) {
@@ -1368,7 +1369,6 @@ if ( !class_exists( 'PT_CV_Functions' ) ) {
1368
  * Callback function for ajax Pagination action 'pagination_request'
1369
  */
1370
  static function ajax_callback_pagination_request() {
1371
-
1372
  // Validate request
1373
  check_ajax_referer( PT_CV_PREFIX_ . 'ajax_nonce', 'ajax_nonce' );
1374
 
@@ -1574,7 +1574,7 @@ if ( !class_exists( 'PT_CV_Functions' ) ) {
1574
  // Reset WP query
1575
  static function reset_query() {
1576
  if ( apply_filters( PT_CV_PREFIX_ . 'reset_query', true ) ) {
1577
- wp_reset_query();
1578
  }
1579
  }
1580
 
764
  // Hide empty result
765
  $html = '';
766
  } else {
767
+ $current_page = self::get_current_page( $pargs );
768
+ $pt_cv_glb[ $pt_cv_id ][ 'current_page' ] = $current_page;
769
+ $html = PT_CV_Html::content_items_wrap( $content_items, $current_page, $args[ 'posts_per_page' ], $view_id );
770
 
771
  // Append Pagination HTML if this is first page, or not Ajax calling
772
  if ( $pt_query && $args[ 'posts_per_page' ] > 0 && PT_CV_Functions::nonpaging_or_firstpage( $dargs, $current_page ) ) {
1369
  * Callback function for ajax Pagination action 'pagination_request'
1370
  */
1371
  static function ajax_callback_pagination_request() {
 
1372
  // Validate request
1373
  check_ajax_referer( PT_CV_PREFIX_ . 'ajax_nonce', 'ajax_nonce' );
1374
 
1574
  // Reset WP query
1575
  static function reset_query() {
1576
  if ( apply_filters( PT_CV_PREFIX_ . 'reset_query', true ) ) {
1577
+ wp_reset_postdata();
1578
  }
1579
  }
1580
 
includes/html-viewtype.php CHANGED
@@ -88,7 +88,7 @@ if ( !class_exists( 'PT_CV_Html_ViewType' ) ) {
88
  $list_item = implode( "\n", $row_html );
89
 
90
  // Only wrap in row if shuffle filter is not enable
91
- if ( PT_CV_Functions::get_global_variable( 'enable_shuffle_filter' ) != 'yes' ) {
92
  $list_item = sprintf( '<div class="%s">%s</div>', esc_attr( $row_class ), $list_item );
93
  }
94
 
88
  $list_item = implode( "\n", $row_html );
89
 
90
  // Only wrap in row if shuffle filter is not enable
91
+ if ( apply_filters( PT_CV_PREFIX_ . 'wrap_in_row', PT_CV_Functions::get_global_variable( 'enable_shuffle_filter' ) != 'yes' ) ) {
92
  $list_item = sprintf( '<div class="%s">%s</div>', esc_attr( $row_class ), $list_item );
93
  }
94
 
includes/html.php CHANGED
@@ -583,7 +583,8 @@ if ( !class_exists( 'PT_CV_Html' ) ) {
583
  // Get thumbnail settings
584
  $fargs = $fargs[ 'thumbnail' ];
585
 
586
- $html = '';
 
587
 
588
  // Get post ID
589
  $post_id = $post->ID;
@@ -593,7 +594,9 @@ if ( !class_exists( 'PT_CV_Html' ) ) {
593
  $thumbnail_class[] = PT_CV_PREFIX . 'thumbnail';
594
  $thumbnail_class[] = isset( $fargs[ 'style' ] ) ? $fargs[ 'style' ] : '';
595
  if ( $layout_format === '2-col' ) {
596
- $thumbnail_class[] = isset( $fargs[ 'position' ] ) ? 'pull-' . $fargs[ 'position' ] : 'pull-left';
 
 
597
  }
598
  $gargs = array(
599
  'class' => apply_filters( PT_CV_PREFIX_ . 'field_thumbnail_class', implode( ' ', array_filter( $thumbnail_class ) ) ),
@@ -617,7 +620,7 @@ if ( !class_exists( 'PT_CV_Html' ) ) {
617
 
618
  // Add link to thumbnail
619
  $oargs = isset( $dargs[ 'other-settings' ] ) ? $dargs[ 'other-settings' ] : array();
620
- $html = self::_field_href( $oargs, $post, $html, PT_CV_PREFIX . 'href-thumbnail' );
621
 
622
  return $html;
623
  }
@@ -792,40 +795,6 @@ if ( !class_exists( 'PT_CV_Html' ) ) {
792
  // Mark as processed
793
  $pt_cv_glb[ $pt_cv_id ][ 'applied_assets' ] = 1;
794
 
795
- // Print inline view styles & scripts
796
- if ( apply_filters( PT_CV_PREFIX_ . 'assets_verbose_loading', 1 ) ) {
797
- $assets = array( 'css', 'js' );
798
- $assets_output = $assets_files = array();
799
-
800
- // Get content of asset files in directory of view type
801
- foreach ( self::$view_type_dir as $idx => $view_type_dir ) {
802
- // Get selected style of current view type
803
- $style = self::$style[ $idx ];
804
-
805
- // With each type of asset (css, js), looking for suit file of selected style
806
- foreach ( $assets as $type ) {
807
- $file_path = $view_type_dir . '/' . $type . '/' . $style . '.' . $type;
808
- $content = PT_CV_Functions::file_include_content( $file_path );
809
- if ( $content ) {
810
- $assets_output[ $type ][] = $content;
811
- }
812
- }
813
- }
814
-
815
- // Echo script, style inline
816
- if ( $assets_output ) {
817
- foreach ( $assets_output as $type => $contents ) {
818
- $content = implode( "\n", $contents );
819
-
820
- if ( $type == 'js' ) {
821
- echo '' . self::inline_script( $content, false );
822
- } else {
823
- echo '' . self::inline_style( $content );
824
- }
825
- }
826
- }
827
- }
828
-
829
  // Link to external files
830
  $assets_files = apply_filters( PT_CV_PREFIX_ . 'assets_files', array() );
831
 
583
  // Get thumbnail settings
584
  $fargs = $fargs[ 'thumbnail' ];
585
 
586
+ $html = '';
587
+ $wrapper_class = '';
588
 
589
  // Get post ID
590
  $post_id = $post->ID;
594
  $thumbnail_class[] = PT_CV_PREFIX . 'thumbnail';
595
  $thumbnail_class[] = isset( $fargs[ 'style' ] ) ? $fargs[ 'style' ] : '';
596
  if ( $layout_format === '2-col' ) {
597
+ $wrapper_class = isset( $fargs[ 'position' ] ) ? 'pull-' . $fargs[ 'position' ] : 'pull-left';
598
+ $thumbnail_class[] = $wrapper_class;
599
+ $wrapper_class = str_replace( 'pull', '', $wrapper_class );
600
  }
601
  $gargs = array(
602
  'class' => apply_filters( PT_CV_PREFIX_ . 'field_thumbnail_class', implode( ' ', array_filter( $thumbnail_class ) ) ),
620
 
621
  // Add link to thumbnail
622
  $oargs = isset( $dargs[ 'other-settings' ] ) ? $dargs[ 'other-settings' ] : array();
623
+ $html = self::_field_href( $oargs, $post, $html, implode( ' ', array( PT_CV_PREFIX . 'href-thumbnail', $wrapper_class ? PT_CV_PREFIX . 'col' . $wrapper_class : '' ) ) );
624
 
625
  return $html;
626
  }
795
  // Mark as processed
796
  $pt_cv_glb[ $pt_cv_id ][ 'applied_assets' ] = 1;
797
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
798
  // Link to external files
799
  $assets_files = apply_filters( PT_CV_PREFIX_ . 'assets_files', array() );
800
 
includes/settings.php CHANGED
@@ -156,7 +156,7 @@ if ( !class_exists( 'PT_CV_Settings' ) ) {
156
  'std' => '5',
157
  'placeholder' => 'e.g. 5',
158
  'append_text' => '1 &rarr; 100',
159
- 'desc' => __( 'The number of items per page.<br>If value of "Limit" option is not blank (empty), this value should be smaller than "Limit" value', PT_CV_TEXTDOMAIN ),
160
  ),
161
  ),
162
  'dependence' => array( 'enable-pagination', 'yes' ),
156
  'std' => '5',
157
  'placeholder' => 'e.g. 5',
158
  'append_text' => '1 &rarr; 100',
159
+ 'desc' => __( 'The number of items per page.<br>If value of <code>Limit</code> option is not blank (empty), this value should be smaller than <code>Limit</code> value', PT_CV_TEXTDOMAIN ),
160
  ),
161
  ),
162
  'dependence' => array( 'enable-pagination', 'yes' ),
public/assets/css/public.css CHANGED
@@ -59,7 +59,7 @@
59
 
60
  /* Add default margin-bottom */
61
  .pt-cv-view .pt-cv-content-item > * {
62
- margin-bottom: 10px !important;
63
  }
64
 
65
  .pt-cv-border .pt-cv-content-item > *,
59
 
60
  /* Add default margin-bottom */
61
  .pt-cv-view .pt-cv-content-item > * {
62
+ margin-bottom: 10px;
63
  }
64
 
65
  .pt-cv-border .pt-cv-content-item > *,
public/assets/js/public.js CHANGED
@@ -101,7 +101,15 @@
101
 
102
  // For Timeline
103
  if ( pages_holder.hasClass( _prefix + 'timeline' ) ) {
104
- pages_holder = pages_holder.children( '.tl-items' );
 
 
 
 
 
 
 
 
105
  }
106
 
107
  $self._get_page( session_id, selected_page, spinner, pages_holder, callback );
101
 
102
  // For Timeline
103
  if ( pages_holder.hasClass( _prefix + 'timeline' ) ) {
104
+ pages_holder = pages_holder.children( '.tl-items' ).first();
105
+ }
106
+
107
+ // For Load More + Infinite loading
108
+ if ( pagination_wrapper.find( '.' + _prefix + 'more' ).length > 0 ) {
109
+ var inner_page = pages_holder.children( '.' + _prefix + 'page' ).first();
110
+ if ( inner_page.length > 0 ) {
111
+ pages_holder = inner_page;
112
+ }
113
  }
114
 
115
  $self._get_page( session_id, selected_page, spinner, pages_holder, callback );