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

Version Description

  • Bug fixed: Loosing translation (WPML) in Ajax pagination
  • Improvement: Performance optimization (when get settings of View)
  • Improvement: Update style if only Title is selected to display (to have a more beautiful list of Posts title)
Download this release

Release Info

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

Code changes from version 1.3.1.1 to 1.3.1.2

README.txt CHANGED
@@ -1,14 +1,14 @@
1
- === Query posts and display posts in responsive 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, 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: 3.9.1
7
- Stable tag: 1.3.1.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
- Query and display posts by category, tag, author... in responsive grid, list layouts easier than ever, without coding!
12
 
13
  == Description ==
14
 
@@ -28,7 +28,7 @@ It is not easy as ABC, isn't it?
28
 
29
  But now, with Content Views plugin, you can do above things in minutes, without any line of code.
30
 
31
- [Content Views plugin](http://www.contentviewspro.com/?utm_source=wordpress&utm_medium=post&utm_campaign=content-views "Get Content Views Pro") provides an intuitive form to query posts and display posts in **responsive** layouts (grid layout, scrollable list/slider, accordion/collapsible list) quickly & easily, in very 3 simple steps:
32
 
33
  * Step 1 : Choose filters (author, category, tag, order...) to query your posts
34
  * Step 2 : Customize display options to display posts in a responsive layout
@@ -48,7 +48,7 @@ But now, with Content Views plugin, you can do above things in minutes, without
48
 
49
  **in Step 2, you can:**
50
 
51
- * Select a responsive layout to display posts: Grid, List(Collapsible/Scrollable). More awesome layouts are available in **[Content Views PRO](http://www.contentviewspro.com/?utm_source=wordpress&utm_medium=plugin&utm_campaign=content-views "Content Views Pro plugin")**
52
  * Display fields (thumbnail, title, content, meta fields) in vertical direction. Or display thumbnail in left/right side of other fields
53
  * Select what fields (thumbnail, title, content, meta fields) to display
54
  * Select thumbnail sizes
@@ -57,10 +57,8 @@ But now, with Content Views plugin, you can do above things in minutes, without
57
  * Enable/Disable pagination
58
  * Open in new tab, current tab (when click on title, thumbnail of post)
59
 
60
- Also, you can import/export 'View' to use in other WordPress sites (Please check **FAQ** tab to know what is 'View')
61
 
62
-
63
- = More amazing features: =
64
 
65
  * Completely replace WordPress layout in Category page, Author page, Search page by Grid layout
66
  * WooCommerce support
@@ -138,12 +136,17 @@ You can create Unlimited Views, in Unlimited websites
138
  3. Query and display in Grid layout (Show Title, Thumbnail)
139
  4. Query and display in Grid layout (Show Title, Thumbnail, Content, Meta fields), with Pagination
140
  5. Query and display in Collapsible List
141
- 6. Query and display in Scrollable List
142
 
143
 
144
 
145
  == Changelog ==
146
 
 
 
 
 
 
147
  = 1.3.1.1 =
148
  * Bug fixed: Thumbnail dimensions are empty
149
  * Improvement: CSS code refinement
@@ -241,6 +244,9 @@ You can create Unlimited Views, in Unlimited websites
241
 
242
  == Upgrade Notice ==
243
 
 
 
 
244
  = 1.3.1.1 =
245
  Bug fixed: Thumbnail dimensions are empty. Improvement: CSS code refinement
246
 
1
+ === Query posts by category, author... and display posts on a Page 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, 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: 3.9.1
7
+ Stable tag: 1.3.1.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
+ It is easy as 1, 2, 3 to query your WordPress posts by category, tag, author... and display your posts on any Page in a responsive Grid, List layout without any line of code!
12
 
13
  == Description ==
14
 
28
 
29
  But now, with Content Views plugin, you can do above things in minutes, without any line of code.
30
 
31
+ [Content Views](http://www.contentviewspro.com/?utm_source=wordpress&utm_medium=post&utm_campaign=content-views "Get Content Views Pro") provides an intuitive form to query posts and display posts in **responsive** layouts (grid layout, scrollable list/slider, accordion/collapsible list) quickly & easily, in very 3 simple steps:
32
 
33
  * Step 1 : Choose filters (author, category, tag, order...) to query your posts
34
  * Step 2 : Customize display options to display posts in a responsive layout
48
 
49
  **in Step 2, you can:**
50
 
51
+ * Select a responsive layout to display posts: Grid, List(Collapsible/Slider). More awesome layouts are available in **[Content Views PRO](http://www.contentviewspro.com/?utm_source=wordpress&utm_medium=plugin&utm_campaign=content-views "Content Views Pro plugin")**
52
  * Display fields (thumbnail, title, content, meta fields) in vertical direction. Or display thumbnail in left/right side of other fields
53
  * Select what fields (thumbnail, title, content, meta fields) to display
54
  * Select thumbnail sizes
57
  * Enable/Disable pagination
58
  * Open in new tab, current tab (when click on title, thumbnail of post)
59
 
 
60
 
61
+ = Do you want more amazing features? =
 
62
 
63
  * Completely replace WordPress layout in Category page, Author page, Search page by Grid layout
64
  * WooCommerce support
136
  3. Query and display in Grid layout (Show Title, Thumbnail)
137
  4. Query and display in Grid layout (Show Title, Thumbnail, Content, Meta fields), with Pagination
138
  5. Query and display in Collapsible List
139
+ 6. Query and display in Slider
140
 
141
 
142
 
143
  == Changelog ==
144
 
145
+ = 1.3.1.2 =
146
+ * Bug fixed: Loosing translation (WPML) in Ajax pagination
147
+ * Improvement: Performance optimization (when get settings of View)
148
+ * Improvement: Update style if only Title is selected to display (to have a more beautiful list of Posts title)
149
+
150
  = 1.3.1.1 =
151
  * Bug fixed: Thumbnail dimensions are empty
152
  * Improvement: CSS code refinement
244
 
245
  == Upgrade Notice ==
246
 
247
+ = 1.3.1.2 =
248
+ Bug fixed: Loosing translation (WPML) in Ajax pagination. Improvement: Performance optimization (when get settings of View). Improvement: Update style if only Title is selected to display (to have a more beautiful list of Posts title)
249
+
250
  = 1.3.1.1 =
251
  Bug fixed: Thumbnail dimensions are empty. Improvement: CSS code refinement
252
 
admin/views/view.php CHANGED
@@ -173,7 +173,7 @@ $options = array(
173
  'type' => 'text',
174
  'name' => 'post__in',
175
  'std' => '',
176
- 'desc' => __( 'List of ids (comma-separated values) of posts to retrieve', PT_CV_DOMAIN ),
177
  ),
178
  ),
179
  ),
@@ -188,7 +188,7 @@ $options = array(
188
  'type' => 'text',
189
  'name' => 'post__not_in',
190
  'std' => '',
191
- 'desc' => __( 'List of ids (comma-separated values) of posts to exclude from output', PT_CV_DOMAIN ),
192
  ),
193
  ),
194
  ),
173
  'type' => 'text',
174
  'name' => 'post__in',
175
  'std' => '',
176
+ 'desc' => __( 'List of post ids to retrieve (comma-separated values, e.g. 1,2,3)<br>A post is displayed only if its ID is equal to any of the values IN this list', PT_CV_DOMAIN ),
177
  ),
178
  ),
179
  ),
188
  'type' => 'text',
189
  'name' => 'post__not_in',
190
  'std' => '',
191
+ 'desc' => __( 'List of post ids to exclude (comma-separated values, e.g. 1,2,3)', PT_CV_DOMAIN ),
192
  ),
193
  ),
194
  ),
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.3.1.1
14
  * Author: Palace Of Themes
15
  * Author URI: http://profiles.wordpress.org/pt-guy
16
  * Text Domain: content-views
@@ -27,7 +27,7 @@ if ( ! defined( 'WPINC' ) ) {
27
  /*
28
  * Define Constant
29
  */
30
- define( 'PT_CV_VERSION', '1.3.1.1' );
31
  define( 'PT_CV_FILE', __FILE__ );
32
  $pt_cv_path = plugin_dir_path( __FILE__ );
33
  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.3.1.2
14
  * Author: Palace Of Themes
15
  * Author URI: http://profiles.wordpress.org/pt-guy
16
  * Text Domain: content-views
27
  /*
28
  * Define Constant
29
  */
30
+ define( 'PT_CV_VERSION', '1.3.1.2' );
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
@@ -43,6 +43,21 @@ if ( ! class_exists( 'PT_CV_Functions' ) ) {
43
  return version_compare( $wp_version, $version_to_compare, $operator );
44
  }
45
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
  /**
47
  * Get plugin info
48
  *
@@ -836,12 +851,8 @@ if ( ! class_exists( 'PT_CV_Functions' ) ) {
836
 
837
  // Get thumbnail settings
838
  case 'thumbnail':
839
-
840
- $field_setting = array();
841
-
842
- $fields = array( 'position', 'size', 'style' );
843
  $prefix = PT_CV_PREFIX . 'field-thumbnail-';
844
- PT_CV_Functions::settings_values( $fields, $field_setting, $pt_view_settings, $prefix );
845
 
846
  $dargs['field-settings'][$field] = apply_filters( PT_CV_PREFIX_ . 'field_thumbnail_setting_values', $field_setting, $prefix );
847
 
@@ -849,14 +860,8 @@ if ( ! class_exists( 'PT_CV_Functions' ) ) {
849
 
850
  // Get meta fields settings
851
  case 'meta-fields':
852
-
853
- $field_setting = array();
854
-
855
  $prefix = PT_CV_PREFIX . 'meta-fields-';
856
- $meta_fields_settings = PT_CV_Functions::settings_values_by_prefix( PT_CV_PREFIX . 'meta-fields-' );
857
- $fields = (array) array_keys( (array) $meta_fields_settings );
858
-
859
- PT_CV_Functions::settings_values( $fields, $field_setting, $pt_view_settings, $prefix );
860
 
861
  $dargs['field-settings'][$field] = apply_filters( PT_CV_PREFIX_ . 'field_meta_fields_setting_values', $field_setting, $prefix );
862
 
@@ -864,12 +869,8 @@ if ( ! class_exists( 'PT_CV_Functions' ) ) {
864
 
865
  // Get content settings
866
  case 'content':
867
-
868
- $field_setting = array();
869
-
870
  $prefix = PT_CV_PREFIX . 'field-content-';
871
- $fields = PT_CV_Functions::settings_keys( 'field-content-', PT_CV_Settings::field_settings() );
872
- PT_CV_Functions::settings_values( $fields, $field_setting, $pt_view_settings, $prefix );
873
 
874
  if ( $field_setting['show'] == 'excerpt' ) {
875
  $field_setting = array_merge( $field_setting, PT_CV_Functions::settings_values_by_prefix( PT_CV_PREFIX . 'field-excerpt-' ) );
@@ -905,13 +906,10 @@ if ( ! class_exists( 'PT_CV_Functions' ) ) {
905
  // Get pagination enable/disable
906
  $pagination = PT_CV_Functions::setting_value( PT_CV_PREFIX . 'enable-pagination', $pt_view_settings );
907
  if ( $pagination ) {
908
- $field_setting = array();
909
-
910
  $prefix = PT_CV_PREFIX . 'pagination-';
911
- $fields = PT_CV_Functions::settings_keys( 'pagination-', PT_CV_Settings::settings_pagination() );
912
- PT_CV_Functions::settings_values( $fields, $field_setting, $pt_view_settings, $prefix );
913
 
914
- $dargs['pagination-settings'] = apply_filters( PT_CV_PREFIX_ . 'pagination_settings', $field_setting );
915
 
916
  // If Items per page is set, get its value
917
  $posts_per_page = isset( $dargs['pagination-settings']['items-per-page'] ) ? (int) $dargs['pagination-settings']['items-per-page'] : $limit;
@@ -941,13 +939,8 @@ if ( ! class_exists( 'PT_CV_Functions' ) ) {
941
  * @param array $dargs The settings array of Fields
942
  */
943
  static function view_get_other_settings( &$dargs ) {
944
- global $pt_view_settings;
945
-
946
- $field_setting = array();
947
-
948
  $prefix = PT_CV_PREFIX . 'other-';
949
- $fields = PT_CV_Functions::settings_keys( 'other-', PT_CV_Settings::settings_other() );
950
- PT_CV_Functions::settings_values( $fields, $field_setting, $pt_view_settings, $prefix );
951
 
952
  $dargs['other-settings'] = apply_filters( PT_CV_PREFIX_ . 'other_settings', $field_setting );
953
  }
@@ -1090,6 +1083,14 @@ if ( ! class_exists( 'PT_CV_Functions' ) ) {
1090
  // Pagination settings
1091
  $pargs = array( 'session_id' => $session_id, 'page' => (int) esc_sql( $_POST['page'] ) );
1092
 
 
 
 
 
 
 
 
 
1093
  // Show View output
1094
  echo balanceTags( PT_CV_Functions::view_process_settings( '', $settings, $pargs ) );
1095
 
43
  return version_compare( $wp_version, $version_to_compare, $operator );
44
  }
45
 
46
+ /**
47
+ * Get current language of site
48
+ */
49
+ static function get_language() {
50
+ $language = '';
51
+
52
+ // WPML
53
+ global $sitepress;
54
+ if ( $sitepress && method_exists( $sitepress, 'get_current_language' ) ) {
55
+ $language = $sitepress->get_current_language();
56
+ }
57
+
58
+ return $language;
59
+ }
60
+
61
  /**
62
  * Get plugin info
63
  *
851
 
852
  // Get thumbnail settings
853
  case 'thumbnail':
 
 
 
 
854
  $prefix = PT_CV_PREFIX . 'field-thumbnail-';
855
+ $field_setting = PT_CV_Functions::settings_values_by_prefix( $prefix );
856
 
857
  $dargs['field-settings'][$field] = apply_filters( PT_CV_PREFIX_ . 'field_thumbnail_setting_values', $field_setting, $prefix );
858
 
860
 
861
  // Get meta fields settings
862
  case 'meta-fields':
 
 
 
863
  $prefix = PT_CV_PREFIX . 'meta-fields-';
864
+ $field_setting = PT_CV_Functions::settings_values_by_prefix( $prefix );
 
 
 
865
 
866
  $dargs['field-settings'][$field] = apply_filters( PT_CV_PREFIX_ . 'field_meta_fields_setting_values', $field_setting, $prefix );
867
 
869
 
870
  // Get content settings
871
  case 'content':
 
 
 
872
  $prefix = PT_CV_PREFIX . 'field-content-';
873
+ $field_setting = PT_CV_Functions::settings_values_by_prefix( $prefix );
 
874
 
875
  if ( $field_setting['show'] == 'excerpt' ) {
876
  $field_setting = array_merge( $field_setting, PT_CV_Functions::settings_values_by_prefix( PT_CV_PREFIX . 'field-excerpt-' ) );
906
  // Get pagination enable/disable
907
  $pagination = PT_CV_Functions::setting_value( PT_CV_PREFIX . 'enable-pagination', $pt_view_settings );
908
  if ( $pagination ) {
 
 
909
  $prefix = PT_CV_PREFIX . 'pagination-';
910
+ $field_setting = PT_CV_Functions::settings_values_by_prefix( $prefix );
 
911
 
912
+ $dargs['pagination-settings'] = apply_filters( PT_CV_PREFIX_ . 'pagination_settings', $field_setting, $prefix );
913
 
914
  // If Items per page is set, get its value
915
  $posts_per_page = isset( $dargs['pagination-settings']['items-per-page'] ) ? (int) $dargs['pagination-settings']['items-per-page'] : $limit;
939
  * @param array $dargs The settings array of Fields
940
  */
941
  static function view_get_other_settings( &$dargs ) {
 
 
 
 
942
  $prefix = PT_CV_PREFIX . 'other-';
943
+ $field_setting = PT_CV_Functions::settings_values_by_prefix( $prefix );
 
944
 
945
  $dargs['other-settings'] = apply_filters( PT_CV_PREFIX_ . 'other_settings', $field_setting );
946
  }
1083
  // Pagination settings
1084
  $pargs = array( 'session_id' => $session_id, 'page' => (int) esc_sql( $_POST['page'] ) );
1085
 
1086
+ // Language
1087
+ $language = empty( $_POST['lang'] ) ? '' : esc_sql( $_POST['lang'] );
1088
+ // WPML
1089
+ global $sitepress;
1090
+ if ( $sitepress && $language ) {
1091
+ $sitepress->switch_lang($language, true);
1092
+ }
1093
+
1094
  // Show View output
1095
  echo balanceTags( PT_CV_Functions::view_process_settings( '', $settings, $pargs ) );
1096
 
includes/html.php CHANGED
@@ -788,6 +788,7 @@ if ( ! class_exists( 'PT_CV_Html' ) ) {
788
  'is_admin' => is_admin() ? 1 : 0,
789
  '_prefix' => PT_CV_PREFIX,
790
  'ajaxurl' => admin_url( 'admin-ajax.php' ),
 
791
  '_nonce' => wp_create_nonce( PT_CV_PREFIX_ . 'ajax_nonce' ),
792
  )
793
  );
788
  'is_admin' => is_admin() ? 1 : 0,
789
  '_prefix' => PT_CV_PREFIX,
790
  'ajaxurl' => admin_url( 'admin-ajax.php' ),
791
+ 'lang' => PT_CV_Functions::get_language(),
792
  '_nonce' => wp_create_nonce( PT_CV_PREFIX_ . 'ajax_nonce' ),
793
  )
794
  );
public/assets/css/public.css CHANGED
@@ -2,7 +2,7 @@
2
 
3
  .pt-cv-view {
4
  position: relative;
5
- margin-bottom: 50px;
6
  clear: both;
7
  }
8
 
@@ -36,7 +36,7 @@
36
 
37
  /* For the output which shows only Title */
38
  .pt-cv-only-title {
39
- margin-bottom: 0;
40
  }
41
 
42
  /* Title */
2
 
3
  .pt-cv-view {
4
  position: relative;
5
+ margin-bottom: 30px;
6
  clear: both;
7
  }
8
 
36
 
37
  /* For the output which shows only Title */
38
  .pt-cv-only-title {
39
+ padding-bottom: 0;
40
  }
41
 
42
  /* Title */
public/assets/js/public.js CHANGED
@@ -113,6 +113,7 @@
113
  action : 'pagination_request',
114
  sid : session_id,
115
  page : selected_page,
 
116
  ajax_nonce: PT_CV_PUBLIC._nonce
117
  };
118
 
113
  action : 'pagination_request',
114
  sid : session_id,
115
  page : selected_page,
116
+ lang : PT_CV_PUBLIC.lang,
117
  ajax_nonce: PT_CV_PUBLIC._nonce
118
  };
119