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

Version Description

  • 2017/11/01 =
  • Fix incompatibility with WordPress 4.8.3: No posts found in non-English languages sites
  • Tweak: Update and add some texts in Add/Edit View page, Settings page
  • Tweak: remove .mo file, rename .po file to .pot file
Download this release

Release Info

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

Code changes from version 1.9.9.3 to 1.9.9.4

README.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: pt-guy
3
  Donate link: https://www.contentviewspro.com/?utm_source=wporg&utm_medium=link&utm_campaign=donate
4
  Tags: post grid, grid plugin, grid, latest post, display post, post, page, category, responsive, list, thumbnail
5
  Requires at least: 3.3
6
- Tested up to: 4.8.2
7
- Stable tag: 1.9.9.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -163,6 +163,12 @@ If you are using "Your latest posts" as home page, you should paste this code `<
163
 
164
  == Changelog ==
165
 
 
 
 
 
 
 
166
  = 1.9.9.3 - 2017/09/25 =
167
  * Compatible Fix: "Sort by" feature always returns a same order, when the "Intuitive Custom Post Order" plugin is in used
168
  * Compatible Fix: Resolve conflict with Slider Revolution plugin
3
  Donate link: https://www.contentviewspro.com/?utm_source=wporg&utm_medium=link&utm_campaign=donate
4
  Tags: post grid, grid plugin, grid, latest post, display post, post, page, category, responsive, list, thumbnail
5
  Requires at least: 3.3
6
+ Tested up to: 4.8.3
7
+ Stable tag: 1.9.9.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
163
 
164
  == Changelog ==
165
 
166
+ = 1.9.9.4 - 2017/11/01 =
167
+ * Fix incompatibility with WordPress 4.8.3: No posts found in non-English languages sites
168
+ * Tweak: Update and add some texts in Add/Edit View page, Settings page
169
+ * Tweak: remove .mo file, rename .po file to .pot file
170
+
171
+
172
  = 1.9.9.3 - 2017/09/25 =
173
  * Compatible Fix: "Sort by" feature always returns a same order, when the "Intuitive Custom Post Order" plugin is in used
174
  * Compatible Fix: Resolve conflict with Slider Revolution plugin
admin/content-views-admin.php CHANGED
@@ -275,6 +275,9 @@ class PT_Content_Views_Admin {
275
  // Remove style of theme Tesseract
276
  wp_dequeue_style( 'tesseract-custom' );
277
 
 
 
 
278
  do_action( PT_CV_PREFIX_ . 'remove_unwanted_assets' );
279
  }
280
  }
275
  // Remove style of theme Tesseract
276
  wp_dequeue_style( 'tesseract-custom' );
277
 
278
+ // Remove style of theme Phlox
279
+ wp_dequeue_style( 'auxin-admin-style' );
280
+
281
  do_action( PT_CV_PREFIX_ . 'remove_unwanted_assets' );
282
  }
283
  }
admin/includes/templates/settings-section-two.php CHANGED
@@ -11,6 +11,7 @@
11
  .cvgopro {
12
  color: #fe1243;
13
  font-size: 2em;
 
14
  }
15
 
16
  h3 {
@@ -48,7 +49,7 @@ $cp = '?utm_source=client&utm_medium=settings_page&utm_campaign=gopro';
48
 
49
  <div class="row" id="pt-cv-features">
50
  <div class="col-md-12">
51
- <h3>Filter Any Content</h3>
52
  <div>
53
  <ul>
54
  <li>support custom post type: WooCommerce, Easy Digital Downloads, Events... (<a href="http://sample.contentviewspro.com/supports/woocommerce-3/<?php echo $cp; ?>" target="_blank">view sample</a>)</li>
@@ -64,11 +65,11 @@ $cp = '?utm_source=client&utm_medium=settings_page&utm_campaign=gopro';
64
  </div>
65
  </div>
66
  <div class="col-md-12">
67
- <h3>Replace Layout</h3>
68
  <div>Use beautiful grid for Blog, Category, Tag, Search results... page in seconds, without coding (<a href="http://docs.contentviewspro.com/completely-replace-wordpress-layout-by-content-views-pro-layout/<?php echo $cp; ?>" target="_blank">view demo</a>)</div>
69
  </div>
70
  <div class="col-md-12">
71
- <h3>Make Money Online</h3>
72
  <div>Make money from your website, by displaying your Google Adsense, affiliate banners... between posts in grid, list easily (<a href="https://www.contentviewspro.com/<?php echo $cp; ?>#show-ads" target="_blank">read more</a>)</div>
73
  </div>
74
  </div>
11
  .cvgopro {
12
  color: #fe1243;
13
  font-size: 2em;
14
+ margin-bottom: 20px;
15
  }
16
 
17
  h3 {
49
 
50
  <div class="row" id="pt-cv-features">
51
  <div class="col-md-12">
52
+ <h3>Filter Any Post Type, Custom Field, Taxonomy</h3>
53
  <div>
54
  <ul>
55
  <li>support custom post type: WooCommerce, Easy Digital Downloads, Events... (<a href="http://sample.contentviewspro.com/supports/woocommerce-3/<?php echo $cp; ?>" target="_blank">view sample</a>)</li>
65
  </div>
66
  </div>
67
  <div class="col-md-12">
68
+ <h3>Grid Layout For Blog, Category, Search... Page</h3>
69
  <div>Use beautiful grid for Blog, Category, Tag, Search results... page in seconds, without coding (<a href="http://docs.contentviewspro.com/completely-replace-wordpress-layout-by-content-views-pro-layout/<?php echo $cp; ?>" target="_blank">view demo</a>)</div>
70
  </div>
71
  <div class="col-md-12">
72
+ <h3>Make Money Online $</h3>
73
  <div>Make money from your website, by displaying your Google Adsense, affiliate banners... between posts in grid, list easily (<a href="https://www.contentviewspro.com/<?php echo $cp; ?>#show-ads" target="_blank">read more</a>)</div>
74
  </div>
75
  </div>
content-views.php CHANGED
@@ -10,7 +10,7 @@
10
  * Plugin Name: Content Views
11
  * Plugin URI: http://wordpress.org/plugins/content-views-query-and-display-post-page/
12
  * Description: Query and display <strong>posts, pages</strong> in awesome layouts (<strong>grid, scrollable list, collapsible list</strong>) easier than ever, without coding!
13
- * Version: 1.9.9.3
14
  * Author: CVSOFT LLC
15
  * Author URI: http://profiles.wordpress.org/pt-guy
16
  * Text Domain: content-views-query-and-display-post-page
@@ -25,7 +25,7 @@ if ( !defined( 'ABSPATH' ) ) {
25
  }
26
 
27
  // Define Constant
28
- define( 'PT_CV_VERSION', '1.9.9.3' );
29
  define( 'PT_CV_FILE', __FILE__ );
30
  define( 'PT_CV_PATH', plugin_dir_path( __FILE__ ) );
31
  include_once( PT_CV_PATH . 'includes/defines.php' );
10
  * Plugin Name: Content Views
11
  * Plugin URI: http://wordpress.org/plugins/content-views-query-and-display-post-page/
12
  * Description: Query and display <strong>posts, pages</strong> in awesome layouts (<strong>grid, scrollable list, collapsible list</strong>) easier than ever, without coding!
13
+ * Version: 1.9.9.4
14
  * Author: CVSOFT LLC
15
  * Author URI: http://profiles.wordpress.org/pt-guy
16
  * Text Domain: content-views-query-and-display-post-page
25
  }
26
 
27
  // Define Constant
28
+ define( 'PT_CV_VERSION', '1.9.9.4' );
29
  define( 'PT_CV_FILE', __FILE__ );
30
  define( 'PT_CV_PATH', plugin_dir_path( __FILE__ ) );
31
  include_once( PT_CV_PATH . 'includes/defines.php' );
includes/formatting.php CHANGED
@@ -48,3 +48,20 @@ function cv_sanitize_tag_content( $string, $remove_breaks = false ) {
48
 
49
  return trim( $string );
50
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
 
49
  return trim( $string );
50
  }
51
+
52
+ /**
53
+ * For WordPress 4.8.3 and after
54
+ */
55
+ if ( !function_exists( 'cv_esc_sql' ) ) {
56
+ function cv_esc_sql( $data ) {
57
+ $result = esc_sql( $data );
58
+
59
+ global $wpdb;
60
+ if ( method_exists( $wpdb, 'remove_placeholder_escape' ) ) {
61
+ return $wpdb->remove_placeholder_escape( $result );
62
+ } else {
63
+ return $result;
64
+ }
65
+ }
66
+
67
+ }
includes/functions.php CHANGED
@@ -546,7 +546,7 @@ if ( !class_exists( 'PT_CV_Functions' ) ) {
546
  'post_type' => PT_CV_POST_TYPE,
547
  'post_status' => 'publish',
548
  'meta_key' => PT_CV_META_ID,
549
- 'meta_value' => esc_sql( $meta_id ),
550
  'cv_get_view' => true,
551
  )
552
  );
@@ -636,7 +636,7 @@ if ( !class_exists( 'PT_CV_Functions' ) ) {
636
  $pt_cv_id = $view_id;
637
  $pt_cv_glb[ $pt_cv_id ] = array();
638
 
639
- $view_settings = array_map( 'esc_sql', $settings );
640
  $pt_cv_glb[ $pt_cv_id ][ 'view_settings' ] = $view_settings;
641
 
642
  $content_type = PT_CV_Functions::setting_value( PT_CV_PREFIX . 'content-type', $view_settings );
@@ -1084,8 +1084,8 @@ if ( !class_exists( 'PT_CV_Functions' ) ) {
1084
  PT_CV_Functions::_nonce_check( 'form_nonce', 'view_submit' );
1085
 
1086
  // Insert View
1087
- $title = esc_sql( $_POST[ PT_CV_PREFIX . 'view-title' ] );
1088
- $cur_pid = esc_sql( $_POST[ PT_CV_PREFIX . 'post-id' ] );
1089
  if ( !$cur_pid ) {
1090
  $post_id = PT_CV_Functions::post_insert( array( 'ID' => 0, 'title' => $title ) );
1091
  } else {
@@ -1119,12 +1119,15 @@ if ( !class_exists( 'PT_CV_Functions' ) ) {
1119
  */
1120
  static function view_output( $atts ) {
1121
  $atts = shortcode_atts( apply_filters( PT_CV_PREFIX_ . 'shortcode_params', array( 'id' => 0 ) ), $atts );
1122
- $id = esc_sql( $atts[ 'id' ] );
1123
  if ( $id && !self::duplicated_process( $id, $atts ) ) {
1124
- $settings = PT_CV_Functions::view_get_settings( $id );
1125
- $view_html = PT_CV_Functions::view_process_settings( $id, $settings, null, $atts );
1126
- $result = PT_CV_Functions::view_final_output( $view_html );
1127
- do_action( PT_CV_PREFIX_ . 'flushed_output', $result );
 
 
 
1128
 
1129
  return $result;
1130
  }
@@ -1210,7 +1213,7 @@ if ( !class_exists( 'PT_CV_Functions' ) ) {
1210
  }
1211
 
1212
  // Switch language
1213
- $language = empty( $_POST[ 'lang' ] ) ? '' : esc_sql( $_POST[ 'lang' ] );
1214
  self::switch_language( $language );
1215
 
1216
  // Show output
546
  'post_type' => PT_CV_POST_TYPE,
547
  'post_status' => 'publish',
548
  'meta_key' => PT_CV_META_ID,
549
+ 'meta_value' => cv_esc_sql( $meta_id ),
550
  'cv_get_view' => true,
551
  )
552
  );
636
  $pt_cv_id = $view_id;
637
  $pt_cv_glb[ $pt_cv_id ] = array();
638
 
639
+ $view_settings = array_map( 'cv_esc_sql', $settings );
640
  $pt_cv_glb[ $pt_cv_id ][ 'view_settings' ] = $view_settings;
641
 
642
  $content_type = PT_CV_Functions::setting_value( PT_CV_PREFIX . 'content-type', $view_settings );
1084
  PT_CV_Functions::_nonce_check( 'form_nonce', 'view_submit' );
1085
 
1086
  // Insert View
1087
+ $title = cv_esc_sql( $_POST[ PT_CV_PREFIX . 'view-title' ] );
1088
+ $cur_pid = cv_esc_sql( $_POST[ PT_CV_PREFIX . 'post-id' ] );
1089
  if ( !$cur_pid ) {
1090
  $post_id = PT_CV_Functions::post_insert( array( 'ID' => 0, 'title' => $title ) );
1091
  } else {
1119
  */
1120
  static function view_output( $atts ) {
1121
  $atts = shortcode_atts( apply_filters( PT_CV_PREFIX_ . 'shortcode_params', array( 'id' => 0 ) ), $atts );
1122
+ $id = cv_sanitize_vid( $atts[ 'id' ] );
1123
  if ( $id && !self::duplicated_process( $id, $atts ) ) {
1124
+ $result = apply_filters( PT_CV_PREFIX_ . 'view_shortcode_output', null, $atts );
1125
+ if ( empty( $result ) ) {
1126
+ $settings = PT_CV_Functions::view_get_settings( $id );
1127
+ $view_html = PT_CV_Functions::view_process_settings( $id, $settings, null, $atts );
1128
+ $result = PT_CV_Functions::view_final_output( $view_html );
1129
+ do_action( PT_CV_PREFIX_ . 'flushed_output', $result );
1130
+ }
1131
 
1132
  return $result;
1133
  }
1213
  }
1214
 
1215
  // Switch language
1216
+ $language = empty( $_POST[ 'lang' ] ) ? '' : cv_esc_sql( $_POST[ 'lang' ] );
1217
  self::switch_language( $language );
1218
 
1219
  // Show output
includes/html.php CHANGED
@@ -327,7 +327,7 @@ if ( !class_exists( 'PT_CV_Html' ) ) {
327
  $output = $html;
328
  }
329
 
330
- return $before_output . $output;
331
  }
332
 
333
  /**
327
  $output = $html;
328
  }
329
 
330
+ return apply_filters( PT_CV_PREFIX_ . 'view_all_output', $before_output . $output, $before_output, $output );
331
  }
332
 
333
  /**
includes/settings.php CHANGED
@@ -420,6 +420,7 @@ if ( !class_exists( 'PT_CV_Settings' ) ) {
420
  'type' => 'text',
421
  'name' => $prefix . 'excerpt-readmore-text',
422
  'std' => ucwords( rtrim( __( 'Read more...' ), '.' ) ),
 
423
  ),
424
  ),
425
  ) : '',
@@ -652,7 +653,7 @@ if ( !class_exists( 'PT_CV_Settings' ) ) {
652
  ),
653
  ),
654
  // Upgrade to Pro: Show image/video in content as thumbnail
655
- !get_option( 'pt_cv_version_pro' ) ? PT_CV_Settings::get_cvpro( sprintf( __( 'In this lite version, thumbnail is only shown if the post has %s', 'content-views-query-and-display-post-page' ), sprintf( '<a target="_blank" href="https://codex.wordpress.org/Post_Thumbnails">%s</a>', __( 'Featured Image' ) ) ), 12, null, true ) : '',
656
  );
657
 
658
  $result = apply_filters( PT_CV_PREFIX_ . 'field_thumbnail_settings', $result, $prefix );
420
  'type' => 'text',
421
  'name' => $prefix . 'excerpt-readmore-text',
422
  'std' => ucwords( rtrim( __( 'Read more...' ), '.' ) ),
423
+ 'desc' => '<span class="alert-warning">' . sprintf( __( 'To change color of this button, <a href="%s" target="_blank"> please check this document </a>', 'content-views-query-and-display-post-page' ), 'http://docs.contentviewspro.com/change-color-read-more-button/?utm_source=client&utm_medium=read-more-color&utm_campaign=gopro' ) . '</span>',
424
  ),
425
  ),
426
  ) : '',
653
  ),
654
  ),
655
  // Upgrade to Pro: Show image/video in content as thumbnail
656
+ !get_option( 'pt_cv_version_pro' ) ? PT_CV_Settings::get_cvpro( sprintf( __( 'In this lite version, thumbnail is only shown if the post has %s.<br>In the Pro version, you can show the first image in post as thumbnail, without having to set a featured image', 'content-views-query-and-display-post-page' ), sprintf( '<a target="_blank" href="https://codex.wordpress.org/Post_Thumbnails">%s</a>', __( 'Featured Image' ) ) ), 12, null, true ) : '',
657
  );
658
 
659
  $result = apply_filters( PT_CV_PREFIX_ . 'field_thumbnail_settings', $result, $prefix );
languages/content-views-query-and-display-post-page.mo DELETED
Binary file
languages/{content-views-query-and-display-post-page.po → content-views-query-and-display-post-page.pot} RENAMED
File without changes
languages/readme.txt DELETED
@@ -1,15 +0,0 @@
1
- ********************************************************
2
-
3
- Content Views I18n
4
- ============================
5
-
6
- Do not put custom translations here.
7
- They will be deleted on Content Views updates.
8
-
9
- Keep custom Content Views translations in one of below directories:
10
- - wp-content/languages/content-views/
11
- - wp-content/languages/plugins/content-views-query-and-display-post-page/
12
-
13
- You want to translate, help, or improve a translation, please contact us support@contentviewspro.com
14
-
15
- ********************************************************