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

Version Description

  • Bug fixed: Solve problems with category/tag name in non-latin languages
  • Improvement: Use cleaner loading icon
  • Tweak: Add class for tag of thumbnail
  • Tweak: Add filter to load Content Views assets (styles, scripts) only in page which uses View
  • Tweak: Add filter to allow All HTML tags in excerpt
Download this release

Release Info

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

Code changes from version 1.6.8.3 to 1.6.8.4

README.txt CHANGED
@@ -1,22 +1,22 @@
1
  === Display posts in grid layout without coding - Content Views ===
2
  Contributors: pt-guy
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=JGUF974QBRKQE
4
- Tags: post, posts, 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.6.8.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
- It is easy as ABC to query posts by category, tag, author... and display posts on any page in responsive Grid layout without coding!
12
 
13
  == Description ==
14
 
15
- Do you want to display posts on any WordPress page in responsive, customizable Grid layout?
16
 
17
  Or:
18
 
19
- * display posts by category, tag, author, keyword
20
  * display posts in order of title, date, ID
21
  * display posts with nice pagination
22
  * display thumbnail in different size than 150x150 or 300x300
@@ -174,6 +174,13 @@ function my_move_bootstrap( $args ) {
174
 
175
  == Changelog ==
176
 
 
 
 
 
 
 
 
177
  = 1.6.8.3 =
178
  * Tweak: Change text domain from "content-views" to "content-views-query-and-display-post-page" and update pot file (prepare for language packs at http://translate.wordpress.org)
179
 
1
  === Display posts in grid layout without coding - Content Views ===
2
  Contributors: pt-guy
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=JGUF974QBRKQE
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.6.8.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
+ It is easy as ABC to query posts by category, tag, author... and display posts anywhere (page, widget) in responsive Grid layout without coding!
12
 
13
  == Description ==
14
 
15
+ Do you want to display most recent posts on any WordPress page in responsive, customizable Grid layout?
16
 
17
  Or:
18
 
19
+ * display posts by any category, tag, author, keyword
20
  * display posts in order of title, date, ID
21
  * display posts with nice pagination
22
  * display thumbnail in different size than 150x150 or 300x300
174
 
175
  == Changelog ==
176
 
177
+ = 1.6.8.4 =
178
+ * Bug fixed: Solve problems with category/tag name in non-latin languages
179
+ * Improvement: Use cleaner loading icon
180
+ * Tweak: Add class for <a> tag of thumbnail
181
+ * Tweak: Add filter to load Content Views assets (styles, scripts) only in page which uses View
182
+ * Tweak: Add filter to allow All HTML tags in excerpt
183
+
184
  = 1.6.8.3 =
185
  * Tweak: Change text domain from "content-views" to "content-views-query-and-display-post-page" and update pot file (prepare for language packs at http://translate.wordpress.org)
186
 
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.6.8.3
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.6.8.3' );
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.6.8.4
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.6.8.4' );
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
@@ -264,26 +264,29 @@ if ( !class_exists( 'PT_CV_Functions' ) ) {
264
  * @return string
265
  */
266
  static function pt_strip_tags( $string ) {
267
- // Remove script, style tags
268
- $string = preg_replace( '@<(script|style)[^>]*?>.*?</\\1>@si', '', $string );
269
-
270
  // Remove language tag of qTranslateX 3.4.4
271
  $string = preg_replace( '/\[:[a-z]{0,2}\]/', '', $string );
272
 
273
- // Predefined allowable HTML tags
274
- $dargs = PT_CV_Functions::get_global_variable( 'dargs' );
275
- $allowed_tags = '';
276
- if ( !empty( $dargs[ 'field-settings' ][ 'content' ][ 'allow_html' ] ) ) {
277
- $allowable_tags = (array) apply_filters( PT_CV_PREFIX_ . 'allowable_tags', array( '<a>', '<br>', '<strong>', '<em>', '<strike>', '<i>', '<ul>', '<ol>', '<li>' ) );
278
- $allowed_tags = implode( '', $allowable_tags );
279
- }
280
-
281
  // Changes double line-breaks in the text into HTML paragraphs (<p>, <br>)
282
  if ( apply_filters( PT_CV_PREFIX_ . 'wpautop', 0 ) ) {
283
  $string = wpautop( $string );
284
  }
285
 
286
- $string = strip_tags( $string, $allowed_tags );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
287
 
288
  return trim( $string );
289
  }
@@ -292,10 +295,11 @@ if ( !class_exists( 'PT_CV_Functions' ) ) {
292
  * Handle slug of non-latin languages
293
  *
294
  * @param string $slug
 
295
  * @return string
296
  */
297
- static function term_slug_sanitize( $slug ) {
298
- if ( preg_match( '/%[0-9a-f][0-9a-f]/', $slug ) ) {
299
  $slug = str_replace( '%', '', $slug );
300
  }
301
 
@@ -761,7 +765,7 @@ if ( !class_exists( 'PT_CV_Functions' ) ) {
761
  $html = PT_CV_Html::content_items_wrap( $content_items, $current_page, $args[ 'posts_per_page' ], $view_id );
762
 
763
  // Append Pagination HTML if this is first page, or not Ajax calling
764
- if ( $pt_query && $args[ 'posts_per_page' ] > 0 && PT_CV_Functions::is_pagination( $dargs, $current_page ) ) {
765
  // Total post founds
766
  $found_posts = apply_filters( PT_CV_PREFIX_ . 'found_posts', $pt_query->found_posts );
767
 
@@ -772,7 +776,9 @@ if ( !class_exists( 'PT_CV_Functions' ) ) {
772
  $max_num_pages = ceil( $total_items / $args[ 'posts_per_page' ] );
773
 
774
  // Output pagination
775
- $html .= "\n" . PT_CV_Html::pagination_output( $max_num_pages, $current_page, $session_id );
 
 
776
  }
777
 
778
  // Reset View ID
@@ -1267,7 +1273,16 @@ if ( !class_exists( 'PT_CV_Functions' ) ) {
1267
  return 'No view ID';
1268
 
1269
  // View shortcode parameters
1270
- global $pt_cv_glb, $pt_cv_sub_id;
 
 
 
 
 
 
 
 
 
1271
  $pt_cv_glb[ $id ] = array();
1272
  $pt_cv_glb[ $id ][ 'shortcode_params' ] = $atts;
1273
  $pt_cv_sub_id = $id;
@@ -1490,7 +1505,7 @@ if ( !class_exists( 'PT_CV_Functions' ) ) {
1490
  * @param int $current_page
1491
  * @return bool
1492
  */
1493
- static function is_pagination( $dargs, $current_page ) {
1494
  // Get ajax type
1495
  $type = isset( $dargs[ 'pagination-settings' ][ 'type' ] ) ? $dargs[ 'pagination-settings' ][ 'type' ] : 'ajax';
1496
 
@@ -1544,7 +1559,8 @@ if ( !class_exists( 'PT_CV_Functions' ) ) {
1544
 
1545
  /**
1546
  * Output debug message (if debug is enable) / nice message (otherwise)
1547
- * @param type $message
 
1548
  */
1549
  static function debug_output( $log, $message = '' ) {
1550
  return defined( 'PT_CV_DEBUG' ) ? ( PT_CV_DEBUG ? $log : $message ) : $message;
264
  * @return string
265
  */
266
  static function pt_strip_tags( $string ) {
 
 
 
267
  // Remove language tag of qTranslateX 3.4.4
268
  $string = preg_replace( '/\[:[a-z]{0,2}\]/', '', $string );
269
 
 
 
 
 
 
 
 
 
270
  // Changes double line-breaks in the text into HTML paragraphs (<p>, <br>)
271
  if ( apply_filters( PT_CV_PREFIX_ . 'wpautop', 0 ) ) {
272
  $string = wpautop( $string );
273
  }
274
 
275
+ // Strip HTML tags
276
+ if ( apply_filters( PT_CV_PREFIX_ . 'strip_tags', 1 ) ) {
277
+ // Remove script, style tags
278
+ $string = preg_replace( '@<(script|style)[^>]*?>.*?</\\1>@si', '', $string );
279
+
280
+ // Predefined allowable HTML tags
281
+ $dargs = PT_CV_Functions::get_global_variable( 'dargs' );
282
+ $allowed_tags = '';
283
+ if ( !empty( $dargs[ 'field-settings' ][ 'content' ][ 'allow_html' ] ) ) {
284
+ $allowable_tags = (array) apply_filters( PT_CV_PREFIX_ . 'allowable_tags', array( '<a>', '<br>', '<strong>', '<em>', '<strike>', '<i>', '<ul>', '<ol>', '<li>' ) );
285
+ $allowed_tags = implode( '', $allowable_tags );
286
+ }
287
+
288
+ $string = strip_tags( $string, $allowed_tags );
289
+ }
290
 
291
  return trim( $string );
292
  }
295
  * Handle slug of non-latin languages
296
  *
297
  * @param string $slug
298
+ * @param boolean $sanitize
299
  * @return string
300
  */
301
+ static function term_slug_sanitize( $slug, $sanitize = false ) {
302
+ if ( $sanitize && preg_match( '/%[0-9a-f][0-9a-f]/', $slug ) ) {
303
  $slug = str_replace( '%', '', $slug );
304
  }
305
 
765
  $html = PT_CV_Html::content_items_wrap( $content_items, $current_page, $args[ 'posts_per_page' ], $view_id );
766
 
767
  // Append Pagination HTML if this is first page, or not Ajax calling
768
+ if ( $pt_query && $args[ 'posts_per_page' ] > 0 && PT_CV_Functions::nonpaging_or_firstpage( $dargs, $current_page ) ) {
769
  // Total post founds
770
  $found_posts = apply_filters( PT_CV_PREFIX_ . 'found_posts', $pt_query->found_posts );
771
 
776
  $max_num_pages = ceil( $total_items / $args[ 'posts_per_page' ] );
777
 
778
  // Output pagination
779
+ if ( (int) $max_num_pages > 0 ) {
780
+ $html .= "\n" . PT_CV_Html::pagination_output( $max_num_pages, $current_page, $session_id );
781
+ }
782
  }
783
 
784
  // Reset View ID
1273
  return 'No view ID';
1274
 
1275
  // View shortcode parameters
1276
+ global $pt_cv_glb, $pt_cv_sub_id, $pt_cv_id;
1277
+
1278
+ /**
1279
+ * Prevent recursive queries by disabling View shortcode in child pages if parent View is not finished
1280
+ * @since 1.6.8.4, 2.4
1281
+ */
1282
+ if ( apply_filters( PT_CV_PREFIX_ . 'disable_child_view', true ) && $pt_cv_id != 0 && !isset( $pt_cv_glb[ $pt_cv_id ][ 'finished' ] ) ) {
1283
+ return PT_CV_Functions::debug_output( 'parent_view_not_finished', '' );
1284
+ }
1285
+
1286
  $pt_cv_glb[ $id ] = array();
1287
  $pt_cv_glb[ $id ][ 'shortcode_params' ] = $atts;
1288
  $pt_cv_sub_id = $id;
1505
  * @param int $current_page
1506
  * @return bool
1507
  */
1508
+ static function nonpaging_or_firstpage( $dargs, $current_page ) {
1509
  // Get ajax type
1510
  $type = isset( $dargs[ 'pagination-settings' ][ 'type' ] ) ? $dargs[ 'pagination-settings' ][ 'type' ] : 'ajax';
1511
 
1559
 
1560
  /**
1561
  * Output debug message (if debug is enable) / nice message (otherwise)
1562
+ * @param string $log Raw log for debugging
1563
+ * @param string $message Nice message for user
1564
  */
1565
  static function debug_output( $log, $message = '' ) {
1566
  return defined( 'PT_CV_DEBUG' ) ? ( PT_CV_DEBUG ? $log : $message ) : $message;
includes/html.php CHANGED
@@ -123,8 +123,8 @@ if ( !class_exists( 'PT_CV_Html' ) ) {
123
  *
124
  * @return type
125
  */
126
- static function html_loading_img( $dimension = 16, $class = '' ) {
127
- $img = sprintf( '<img width="%1$s" height="%1$s" class="%2$s" alt="%3$s" src="%4$s" /><div class="clear %5$s"></div>', esc_attr( $dimension ), esc_attr( $class ), __( 'loading', PT_CV_TEXTDOMAIN ), 'data:image/gif;base64,R0lGODlhEAAQAPIAAP///wAAAMLCwkJCQgAAAGJiYoKCgpKSkiH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCgAAACwAAAAAEAAQAAADMwi63P4wyklrE2MIOggZnAdOmGYJRbExwroUmcG2LmDEwnHQLVsYOd2mBzkYDAdKa+dIAAAh+QQJCgAAACwAAAAAEAAQAAADNAi63P5OjCEgG4QMu7DmikRxQlFUYDEZIGBMRVsaqHwctXXf7WEYB4Ag1xjihkMZsiUkKhIAIfkECQoAAAAsAAAAABAAEAAAAzYIujIjK8pByJDMlFYvBoVjHA70GU7xSUJhmKtwHPAKzLO9HMaoKwJZ7Rf8AYPDDzKpZBqfvwQAIfkECQoAAAAsAAAAABAAEAAAAzMIumIlK8oyhpHsnFZfhYumCYUhDAQxRIdhHBGqRoKw0R8DYlJd8z0fMDgsGo/IpHI5TAAAIfkECQoAAAAsAAAAABAAEAAAAzIIunInK0rnZBTwGPNMgQwmdsNgXGJUlIWEuR5oWUIpz8pAEAMe6TwfwyYsGo/IpFKSAAAh+QQJCgAAACwAAAAAEAAQAAADMwi6IMKQORfjdOe82p4wGccc4CEuQradylesojEMBgsUc2G7sDX3lQGBMLAJibufbSlKAAAh+QQJCgAAACwAAAAAEAAQAAADMgi63P7wCRHZnFVdmgHu2nFwlWCI3WGc3TSWhUFGxTAUkGCbtgENBMJAEJsxgMLWzpEAACH5BAkKAAAALAAAAAAQABAAAAMyCLrc/jDKSatlQtScKdceCAjDII7HcQ4EMTCpyrCuUBjCYRgHVtqlAiB1YhiCnlsRkAAAOwAAAAAAAAAAAA==', PT_CV_PREFIX . 'clear-pagination' );
128
 
129
  return apply_filters( PT_CV_PREFIX_ . 'loading_image', $img );
130
  }
@@ -281,10 +281,10 @@ if ( !class_exists( 'PT_CV_Html' ) ) {
281
  // Assign as global variable
282
  $pt_cv_glb[ $pt_cv_id ][ 'content_items' ] = $content_items;
283
 
284
- $display = PT_CV_Functions::is_pagination( $dargs, $current_page );
285
 
286
  // 1. Before output
287
- $before_output = $display ? apply_filters( PT_CV_PREFIX_ . 'before_output_html', '' ) : '';
288
 
289
  // 2. Output content
290
  $content = array();
@@ -295,21 +295,18 @@ if ( !class_exists( 'PT_CV_Html' ) ) {
295
 
296
  // Grid
297
  case 'grid':
298
-
299
  PT_CV_Html_ViewType::grid_wrapper( $content_items, $content );
300
 
301
  break;
302
 
303
  // Collapsible List
304
  case 'collapsible':
305
-
306
  PT_CV_Html_ViewType::collapsible_wrapper( $content_items, $content );
307
 
308
  break;
309
 
310
  // Scrollable List
311
  case 'scrollable':
312
-
313
  PT_CV_Html_ViewType::scrollable_wrapper( $content_items, $content );
314
 
315
  break;
@@ -333,10 +330,8 @@ if ( !class_exists( 'PT_CV_Html' ) ) {
333
  $page_attr_ = apply_filters( PT_CV_PREFIX_ . 'page_attr', $col_count, $view_type, $content_items, $dargs );
334
  $page_attr = strip_tags( $page_attr_ );
335
 
336
- // Wrap items in 'page' wrapper
337
- $wrap_in_page = apply_filters( PT_CV_PREFIX_ . 'wrap_in_page', true );
338
- if ( $wrap_in_page ) {
339
- // Wrap in page wrapper
340
  $html = sprintf( '<div id="%s" class="%s" %s>%s</div>', esc_attr( PT_CV_PREFIX . 'page' . '-' . $current_page ), esc_attr( PT_CV_PREFIX . 'page' ), $page_attr, $content_list );
341
  // Remove page attribute value
342
  $page_attr = '';
@@ -344,8 +339,8 @@ if ( !class_exists( 'PT_CV_Html' ) ) {
344
  $html = $content_list;
345
  }
346
 
347
- if ( $display ) {
348
- // Get wrapper class of a view
349
  $view_class = apply_filters( PT_CV_PREFIX_ . 'view_class', array( PT_CV_PREFIX . 'view', PT_CV_PREFIX . $view_type ) );
350
 
351
  // ID for the wrapper
@@ -358,7 +353,7 @@ if ( !class_exists( 'PT_CV_Html' ) ) {
358
  $output = $html;
359
  }
360
 
361
- return balanceTags( $before_output ) . balanceTags( $output );
362
  }
363
 
364
  /**
@@ -631,7 +626,7 @@ if ( !class_exists( 'PT_CV_Html' ) ) {
631
 
632
  // Add link to thumbnail
633
  $oargs = isset( $dargs[ 'other-settings' ] ) ? $dargs[ 'other-settings' ] : array();
634
- $html = self::_field_href( $oargs, $post, $html );
635
 
636
  return $html;
637
  }
@@ -784,7 +779,7 @@ if ( !class_exists( 'PT_CV_Html' ) ) {
784
  $pagination_btn = apply_filters( PT_CV_PREFIX_ . 'btn_more_html', $pagination_btn, $max_num_pages, $session_id );
785
  }
786
  // Add loading icon
787
- $pagination_btn .= self::html_loading_img( 12, PT_CV_PREFIX . 'spinner' );
788
 
789
  $wrapper_class = apply_filters( PT_CV_PREFIX_ . 'pagination_class', '' );
790
  $output = apply_filters( PT_CV_PREFIX_ . 'pagination_output', sprintf( '<div class="%s">%s</div>', $wrapper_class . ' ' . PT_CV_PREFIX . 'pagination-wrapper', $pagination_btn ) );
@@ -922,6 +917,9 @@ if ( !class_exists( 'PT_CV_Html' ) ) {
922
  'goto_page' => apply_filters( PT_CV_PREFIX_ . 'goto_page', __( 'Go to page', PT_CV_TEXTDOMAIN ) ),
923
  )
924
  );
 
 
 
925
  }
926
 
927
  /**
@@ -957,6 +955,9 @@ if ( !class_exists( 'PT_CV_Html' ) ) {
957
  )
958
  );
959
  }
 
 
 
960
  }
961
 
962
  /**
123
  *
124
  * @return type
125
  */
126
+ static function html_loading_img( $dimension = 15, $class = '' ) {
127
+ $img = sprintf( '<img width="%1$s" height="%1$s" class="%2$s" alt="%3$s" src="%4$s" /><div class="clear %5$s"></div>', esc_attr( $dimension ), esc_attr( $class ), __( 'loading', PT_CV_TEXTDOMAIN ), 'data:image/gif;base64,R0lGODlhDwAPALMPAMrKygwMDJOTkz09PZWVla+vr3p6euTk5M7OzuXl5TMzMwAAAJmZmWZmZszMzP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQFCgAPACwAAAAADwAPAAAEQvDJaZaZOIcV8iQK8VRX4iTYoAwZ4iCYoAjZ4RxejhVNoT+mRGP4cyF4Pp0N98sBGIBMEMOotl6YZ3S61Bmbkm4mAgAh+QQFCgAPACwAAAAADQANAAAENPDJSRSZeA418itN8QiK8BiLITVsFiyBBIoYqnoewAD4xPw9iY4XLGYSjkQR4UAUD45DLwIAIfkEBQoADwAsAAAAAA8ACQAABC/wyVlamTi3nSdgwFNdhEJgTJoNyoB9ISYoQmdjiZPcj7EYCAeCF1gEDo4Dz2eIAAAh+QQFCgAPACwCAAAADQANAAAEM/DJBxiYeLKdX3IJZT1FU0iIg2RNKx3OkZVnZ98ToRD4MyiDnkAh6BkNC0MvsAj0kMpHBAAh+QQFCgAPACwGAAAACQAPAAAEMDC59KpFDll73HkAA2wVY5KgiK5b0RRoI6MuzG6EQqCDMlSGheEhUAgqgUUAFRySIgAh+QQFCgAPACwCAAIADQANAAAEM/DJKZNLND/kkKaHc3xk+QAMYDKsiaqmZCxGVjSFFCxB1vwy2oOgIDxuucxAMTAJFAJNBAAh+QQFCgAPACwAAAYADwAJAAAEMNAs86q1yaWwwv2Ig0jUZx3OYa4XoRAfwADXoAwfo1+CIjyFRuEho60aSNYlOPxEAAAh+QQFCgAPACwAAAIADQANAAAENPA9s4y8+IUVcqaWJ4qEQozSoAzoIyhCK2NFU2SJk0hNnyEOhKR2AzAAj4Pj4GE4W0bkJQIAOw==', PT_CV_PREFIX . 'clear-pagination' );
128
 
129
  return apply_filters( PT_CV_PREFIX_ . 'loading_image', $img );
130
  }
281
  // Assign as global variable
282
  $pt_cv_glb[ $pt_cv_id ][ 'content_items' ] = $content_items;
283
 
284
+ $nonpaging_or_firstpage = PT_CV_Functions::nonpaging_or_firstpage( $dargs, $current_page );
285
 
286
  // 1. Before output
287
+ $before_output = $nonpaging_or_firstpage ? apply_filters( PT_CV_PREFIX_ . 'before_output_html', '' ) : '';
288
 
289
  // 2. Output content
290
  $content = array();
295
 
296
  // Grid
297
  case 'grid':
 
298
  PT_CV_Html_ViewType::grid_wrapper( $content_items, $content );
299
 
300
  break;
301
 
302
  // Collapsible List
303
  case 'collapsible':
 
304
  PT_CV_Html_ViewType::collapsible_wrapper( $content_items, $content );
305
 
306
  break;
307
 
308
  // Scrollable List
309
  case 'scrollable':
 
310
  PT_CV_Html_ViewType::scrollable_wrapper( $content_items, $content );
311
 
312
  break;
330
  $page_attr_ = apply_filters( PT_CV_PREFIX_ . 'page_attr', $col_count, $view_type, $content_items, $dargs );
331
  $page_attr = strip_tags( $page_attr_ );
332
 
333
+ if ( apply_filters( PT_CV_PREFIX_ . 'wrap_in_page', true ) ) {
334
+ // Wrap items in 'page' wrapper
 
 
335
  $html = sprintf( '<div id="%s" class="%s" %s>%s</div>', esc_attr( PT_CV_PREFIX . 'page' . '-' . $current_page ), esc_attr( PT_CV_PREFIX . 'page' ), $page_attr, $content_list );
336
  // Remove page attribute value
337
  $page_attr = '';
339
  $html = $content_list;
340
  }
341
 
342
+ if ( $nonpaging_or_firstpage ) {
343
+ // Get wrapper class of View
344
  $view_class = apply_filters( PT_CV_PREFIX_ . 'view_class', array( PT_CV_PREFIX . 'view', PT_CV_PREFIX . $view_type ) );
345
 
346
  // ID for the wrapper
353
  $output = $html;
354
  }
355
 
356
+ return force_balance_tags( $before_output ) . balanceTags( $output );
357
  }
358
 
359
  /**
626
 
627
  // Add link to thumbnail
628
  $oargs = isset( $dargs[ 'other-settings' ] ) ? $dargs[ 'other-settings' ] : array();
629
+ $html = self::_field_href( $oargs, $post, $html, PT_CV_PREFIX . 'href-thumbnail' );
630
 
631
  return $html;
632
  }
779
  $pagination_btn = apply_filters( PT_CV_PREFIX_ . 'btn_more_html', $pagination_btn, $max_num_pages, $session_id );
780
  }
781
  // Add loading icon
782
+ $pagination_btn .= self::html_loading_img( 15, PT_CV_PREFIX . 'spinner' );
783
 
784
  $wrapper_class = apply_filters( PT_CV_PREFIX_ . 'pagination_class', '' );
785
  $output = apply_filters( PT_CV_PREFIX_ . 'pagination_output', sprintf( '<div class="%s">%s</div>', $wrapper_class . ' ' . PT_CV_PREFIX . 'pagination-wrapper', $pagination_btn ) );
917
  'goto_page' => apply_filters( PT_CV_PREFIX_ . 'goto_page', __( 'Go to page', PT_CV_TEXTDOMAIN ) ),
918
  )
919
  );
920
+
921
+ // Load Pro scripts
922
+ do_action( PT_CV_PREFIX_ . 'frontend_scripts' );
923
  }
924
 
925
  /**
955
  )
956
  );
957
  }
958
+
959
+ // Load Pro styles
960
+ do_action( PT_CV_PREFIX_ . 'frontend_styles' );
961
  }
962
 
963
  /**
includes/values.php CHANGED
@@ -39,6 +39,8 @@ if ( !class_exists( 'PT_CV_Values' ) ) {
39
  $result[ $post_type->name ] = __( $post_type->labels->singular_name, PT_CV_TEXTDOMAIN );
40
  }
41
 
 
 
42
  return $result;
43
  }
44
 
@@ -155,8 +157,7 @@ if ( !class_exists( 'PT_CV_Values' ) ) {
155
  * @param string $terms_of_taxonomies Array of terms of taxonomies
156
  * @param array $args Array of query parameters
157
  */
158
- static function term_of_taxonomy( $taxonomy, &$terms_of_taxonomies,
159
- $args = array() ) {
160
  $args = array_merge( array( 'hide_empty' => false ), $args );
161
  $terms = get_terms( array( $taxonomy ), $args );
162
 
39
  $result[ $post_type->name ] = __( $post_type->labels->singular_name, PT_CV_TEXTDOMAIN );
40
  }
41
 
42
+ $result = apply_filters( PT_CV_PREFIX_ . 'post_types_list', $result );
43
+
44
  return $result;
45
  }
46
 
157
  * @param string $terms_of_taxonomies Array of terms of taxonomies
158
  * @param array $args Array of query parameters
159
  */
160
+ static function term_of_taxonomy( $taxonomy, &$terms_of_taxonomies, $args = array() ) {
 
161
  $args = array_merge( array( 'hide_empty' => false ), $args );
162
  $terms = get_terms( array( $taxonomy ), $args );
163
 
public/assets/css/public.css CHANGED
@@ -133,7 +133,8 @@
133
  }
134
 
135
  .pt-cv-spinner {
136
- width: 12px !important;
 
137
  margin: 0 auto !important;
138
 
139
  display: inline-block;
133
  }
134
 
135
  .pt-cv-spinner {
136
+ width: 15px !important;
137
+ height: 15px !important;
138
  margin: 0 auto !important;
139
 
140
  display: inline-block;
public/content-views.php CHANGED
@@ -60,6 +60,9 @@ class PT_Content_Views {
60
  // Output assets content at footer of page
61
  add_action( 'wp_footer', array( 'PT_CV_Html', 'assets_of_view_types' ), 100 );
62
 
 
 
 
63
  // Ajax action
64
  $action = 'pagination_request';
65
  add_action( 'wp_ajax_' . $action, array( 'PT_CV_Functions', 'ajax_callback_' . $action ) );
@@ -323,7 +326,9 @@ class PT_Content_Views {
323
  * @since 1.0.0
324
  */
325
  public function enqueue_styles() {
326
- PT_CV_Html::frontend_styles();
 
 
327
  }
328
 
329
  /**
@@ -332,7 +337,20 @@ class PT_Content_Views {
332
  * @since 1.0.0
333
  */
334
  public function enqueue_scripts() {
335
- PT_CV_Html::frontend_scripts();
 
 
 
 
 
 
 
 
 
 
 
 
 
336
  }
337
 
338
  /**
60
  // Output assets content at footer of page
61
  add_action( 'wp_footer', array( 'PT_CV_Html', 'assets_of_view_types' ), 100 );
62
 
63
+ // Load assets if they are not enqueued to 'wp_enqueue_scripts'
64
+ add_action( 'wp_footer', array( $this, 'enqueue_assets' ), 2 );
65
+
66
  // Ajax action
67
  $action = 'pagination_request';
68
  add_action( 'wp_ajax_' . $action, array( 'PT_CV_Functions', 'ajax_callback_' . $action ) );
326
  * @since 1.0.0
327
  */
328
  public function enqueue_styles() {
329
+ if ( apply_filters( PT_CV_PREFIX_ . 'default_enqueue_assets', 1 ) ) {
330
+ PT_CV_Html::frontend_styles();
331
+ }
332
  }
333
 
334
  /**
337
  * @since 1.0.0
338
  */
339
  public function enqueue_scripts() {
340
+ if ( apply_filters( PT_CV_PREFIX_ . 'default_enqueue_assets', 1 ) ) {
341
+ PT_CV_Html::frontend_scripts();
342
+ }
343
+ }
344
+
345
+ public function enqueue_assets() {
346
+ // Execute if assets were not enqueued in default way
347
+ if ( !apply_filters( PT_CV_PREFIX_ . 'default_enqueue_assets', 1 ) ) {
348
+ global $pt_cv_id;
349
+ if ( !empty( $pt_cv_id ) ) {
350
+ PT_CV_Html::frontend_styles();
351
+ PT_CV_Html::frontend_scripts();
352
+ }
353
+ }
354
  }
355
 
356
  /**