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

Version Description

  • Fix pagination bug if number of pages > 10
  • Fix bug of Preview button: click event fires twice
  • Enable other user roles (Editor, Author, Contributor) to see Content Views menu and manage Views
Download this release

Release Info

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

Code changes from version 1.2.0 to 1.2.1

README.txt CHANGED
@@ -4,19 +4,18 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
  Tags: post, posts, page, pages, query, queries, search, display, show, shortcode, thumbnail, title, content, excerpt, meta, date, author, term, taxonomy, pagination, grid, scrollable, collapsible, list, slide, layout, ui
5
  Requires at least: 3.3
6
  Tested up to: 3.9.1
7
- Stable tag: 1.2.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
- Display custom posts any where (home page, sidebar, footer widget) in responsive layouts (grid, list) easier than ever, without coding!
12
 
13
  == Description ==
14
 
15
  Have you ever wanted to:
16
 
17
- * display some specific posts in home page of your WordPress site
18
- * display multiple posts in a page
19
- * display posts in responsive grid layout
20
  * display posts in descending order of Title
21
  * replace boring Next, Prev button of WordPress theme by a beautiful pagination
22
  * display thumbnail in different size than 150x150 or 300x300
@@ -33,8 +32,8 @@ But now, with Content Views plugin, you can do above things in minutes, without
33
  [Content Views plugin](http://www.contentviewspro.com/?utm_source=wordpress&utm_medium=post&utm_campaign=content-views "Visit Content Views website") provides an intuitive form to query posts and display posts in **responsive** layouts (grid, scrollable list, collapsible list) quickly & easily, in very 3 simple steps:
34
 
35
  * Step 1 : Select criteria (author, category, tag...) to query your wanted posts
36
- * Step 2 : Select a nice layout to display posts
37
- * Step 3 : Paste shortcode **[pt_view id="UNIQUE_ID"]** to editor of a post, page or a Text widget where you want to display your posts. If you are a developer, you can **`<?php echo do_shortcode('[pt_view id="UNIQUE_ID"]'); ?>`** in current theme of your WordPress site. (Please check FAQ to know how to get UNIQUE_ID of View)
38
 
39
  = A features list of Content Views plugin: =
40
 
@@ -50,14 +49,14 @@ But now, with Content Views plugin, you can do above things in minutes, without
50
 
51
  **in Step 2, you can:**
52
 
53
- * Select a layout to display posts: Grid, Collapsible List, Scrollable List. 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")**
54
- * Choose a layout format of each item (item is the output of a post, page at front-end): 1 column, 2 columns
55
- * Select fields to display (thumbnail, title, content, meta fields)
56
- * Select size of thumbnail to display
57
  * Display full content, or display only excerpt with specific amount of words
58
- * Select meta fields to display (date, author, terms [categories, tags], comment count)
59
  * Enable/Disable pagination
60
- * Open an item in new tab, current tab
61
 
62
  Also, you can import/export 'View' to use in other WordPress sites (Please check **FAQ** tab to know what is 'View')
63
 
@@ -66,12 +65,12 @@ Also, you can import/export 'View' to use in other WordPress sites (Please check
66
 
67
  * Woocommerce support
68
  * Display posts in more Awesome layouts: Pinterest, Timeline
69
- * More beautiful output & powerful settings of Grid, Collapsible List, Scrollable List
70
  * Drag & drop to change display order of fields (thumbnail, title, content, meta fields)
71
  * Customize Font settings for Title, Content, Meta fields
72
- * Custom style for Thumbnail
73
  * Customize style & text of "Read more" button
74
- * Additional pagination option
75
  * And much more...
76
 
77
  are available in **[Content Views PRO](http://www.contentviewspro.com/?utm_source=wordpress&utm_medium=plugin&utm_campaign=content-views "Content Views Pro")** plugin.
@@ -148,6 +147,11 @@ You can create Unlimited Views, in Unlimited websites
148
 
149
  == Changelog ==
150
 
 
 
 
 
 
151
  = 1.2.0 =
152
  * Remove shortcodes in excerpt
153
  * Fix Scroll bug when click Show/Hide preview
@@ -199,6 +203,9 @@ You can create Unlimited Views, in Unlimited websites
199
 
200
  == Upgrade Notice ==
201
 
 
 
 
202
  = 1.2.0 =
203
  Remove shortcodes in excerpt. Fix Scroll bug when click Show/Hide preview. Update Pagination setting. Optimize filters system. Compatibility update
204
 
4
  Tags: post, posts, page, pages, query, queries, search, display, show, shortcode, thumbnail, title, content, excerpt, meta, date, author, term, taxonomy, pagination, grid, scrollable, collapsible, list, slide, layout, ui
5
  Requires at least: 3.3
6
  Tested up to: 3.9.1
7
+ Stable tag: 1.2.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
+ Display posts any where (home page, sidebar, footer widget) in responsive grid layouts easier than ever, without coding!
12
 
13
  == Description ==
14
 
15
  Have you ever wanted to:
16
 
17
+ * display specific posts in home page, in a page, in footer widget, in sidebar of your WordPress site
18
+ * display latest posts in responsive grid layout
 
19
  * display posts in descending order of Title
20
  * replace boring Next, Prev button of WordPress theme by a beautiful pagination
21
  * display thumbnail in different size than 150x150 or 300x300
32
  [Content Views plugin](http://www.contentviewspro.com/?utm_source=wordpress&utm_medium=post&utm_campaign=content-views "Visit Content Views website") provides an intuitive form to query posts and display posts in **responsive** layouts (grid, scrollable list, collapsible list) quickly & easily, in very 3 simple steps:
33
 
34
  * Step 1 : Select criteria (author, category, tag...) to query your wanted posts
35
+ * Step 2 : Select a responsive layout to display posts
36
+ * Step 3 : Paste shortcode **[pt_view id="UNIQUE_ID"]** to editor of a page, to a Text widget where you want to display your posts. If you are a developer, you can **`<?php echo do_shortcode('[pt_view id="UNIQUE_ID"]'); ?>`** in current theme of your WordPress site. (Please check FAQ to know how to get UNIQUE_ID of View)
37
 
38
  = A features list of Content Views plugin: =
39
 
49
 
50
  **in Step 2, you can:**
51
 
52
+ * 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")**
53
+ * Display fields (thumbnail, title, content, meta fields) in vertical direction. Or display thumbnail in left/right side of other fields
54
+ * Select what fields (thumbnail, title, content, meta fields) to display
55
+ * Select thumbnail size
56
  * Display full content, or display only excerpt with specific amount of words
57
+ * Select what meta fields (date, author, terms [categories, tags], comment count) to display
58
  * Enable/Disable pagination
59
+ * Open in new tab, current tab (when click on title, thumbnail of post)
60
 
61
  Also, you can import/export 'View' to use in other WordPress sites (Please check **FAQ** tab to know what is 'View')
62
 
65
 
66
  * Woocommerce support
67
  * Display posts in more Awesome layouts: Pinterest, Timeline
68
+ * More beautiful output & powerful settings of Grid, List
69
  * Drag & drop to change display order of fields (thumbnail, title, content, meta fields)
70
  * Customize Font settings for Title, Content, Meta fields
71
+ * Custom style for Thumbnail: round, circle, border
72
  * Customize style & text of "Read more" button
73
+ * "Load more" button for pagination
74
  * And much more...
75
 
76
  are available in **[Content Views PRO](http://www.contentviewspro.com/?utm_source=wordpress&utm_medium=plugin&utm_campaign=content-views "Content Views Pro")** plugin.
147
 
148
  == Changelog ==
149
 
150
+ = 1.2.1 =
151
+ * Fix pagination bug if number of pages > 10
152
+ * Fix bug of Preview button: click event fires twice
153
+ * Enable other user roles (Editor, Author, Contributor) to see Content Views menu and manage Views
154
+
155
  = 1.2.0 =
156
  * Remove shortcodes in excerpt
157
  * Fix Scroll bug when click Show/Hide preview
203
 
204
  == Upgrade Notice ==
205
 
206
+ = 1.2.1 =
207
+ Fix pagination bug if number of pages > 10. Fix bug of Preview button: click event fires twice. Enable other user roles (Editor, Author, Contributor) to see Content Views menu and manage Views
208
+
209
  = 1.2.0 =
210
  Remove shortcodes in excerpt. Fix Scroll bug when click Show/Hide preview. Update Pagination setting. Optimize filters system. Compatibility update
211
 
admin/assets/js/admin.js CHANGED
@@ -390,6 +390,7 @@
390
  var offset_top;
391
 
392
  $('#' + _prefix + 'show-preview').click(function (e) {
 
393
  e.preventDefault();
394
 
395
  var $this_btn = $(this);
390
  var offset_top;
391
 
392
  $('#' + _prefix + 'show-preview').click(function (e) {
393
+ e.stopPropagation();
394
  e.preventDefault();
395
 
396
  var $this_btn = $(this);
admin/content-views-admin.php CHANGED
@@ -282,7 +282,7 @@ class PT_Content_Views_Admin {
282
  $this->plugin_screen_hook_suffix = add_menu_page(
283
  __( 'Content View Settings', $this->plugin_slug ),
284
  __( 'Content View Settings', $this->plugin_slug ),
285
- 'manage_options',
286
  $this->plugin_slug,
287
  array( $this, 'display_plugin_admin_page' ),
288
  '',
282
  $this->plugin_screen_hook_suffix = add_menu_page(
283
  __( 'Content View Settings', $this->plugin_slug ),
284
  __( 'Content View Settings', $this->plugin_slug ),
285
+ 'edit_posts',
286
  $this->plugin_slug,
287
  array( $this, 'display_plugin_admin_page' ),
288
  '',
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.2.0
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.2.0' );
31
  define( 'PT_CV_FILE', __FILE__ );
32
  include_once( plugin_dir_path( __FILE__ ) . 'includes/defines.php' );
33
 
@@ -76,7 +76,7 @@ if ( is_admin() ) {
76
 
77
  // Require PT Options framework
78
  include_once( plugin_dir_path( __FILE__ ) . 'admin/includes/options.php' );
79
-
80
  // Settings page for the plugin
81
  include_once( plugin_dir_path( __FILE__ ) . 'admin/includes/plugin.php' );
82
  }
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.2.1
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.2.1' );
31
  define( 'PT_CV_FILE', __FILE__ );
32
  include_once( plugin_dir_path( __FILE__ ) . 'includes/defines.php' );
33
 
76
 
77
  // Require PT Options framework
78
  include_once( plugin_dir_path( __FILE__ ) . 'admin/includes/options.php' );
79
+
80
  // Settings page for the plugin
81
  include_once( plugin_dir_path( __FILE__ ) . 'admin/includes/plugin.php' );
82
  }
includes/functions.php CHANGED
@@ -65,7 +65,7 @@ if ( ! class_exists( 'PT_CV_Functions' ) ) {
65
  */
66
  static function menu_add_sub( $parent_slug, $page_title, $menu_title, $sub_page, $class ) {
67
  return add_submenu_page(
68
- $parent_slug, $page_title, $menu_title, 'manage_options', $parent_slug . '-' . $sub_page, array( $class, 'display_sub_page_' . $sub_page )
69
  );
70
  }
71
 
65
  */
66
  static function menu_add_sub( $parent_slug, $page_title, $menu_title, $sub_page, $class ) {
67
  return add_submenu_page(
68
+ $parent_slug, $page_title, $menu_title, 'edit_posts', $parent_slug . '-' . $sub_page, array( $class, 'display_sub_page_' . $sub_page )
69
  );
70
  }
71
 
public/assets/js/public.js CHANGED
@@ -28,7 +28,7 @@
28
  bootstrapMajorVersion: 3,
29
  totalPages : total_pages,
30
  shouldShowPage : function (type, page, current) {
31
- if (total_pages < 10) {
32
  switch (type) {
33
  case "first":
34
  case "last":
@@ -36,6 +36,8 @@
36
  default:
37
  return true;
38
  }
 
 
39
  }
40
  },
41
  // When changing page
@@ -71,11 +73,11 @@
71
 
72
  var view_id = this_.attr('data-id');
73
  var spinner = this_.next('.' + _prefix + 'spinner');
74
-
75
  var pagination_wrapper = this_;
76
  if (this_.parent('.' + _prefix + 'pagination-wrapper').length) {
77
  pagination_wrapper = this_.parent('.' + _prefix + 'pagination-wrapper');
78
- }
79
  var pages_holder = pagination_wrapper.prev('.' + _prefix + 'view');
80
 
81
  // For Timeline
28
  bootstrapMajorVersion: 3,
29
  totalPages : total_pages,
30
  shouldShowPage : function (type, page, current) {
31
+ if (total_pages && total_pages < 10) {
32
  switch (type) {
33
  case "first":
34
  case "last":
36
  default:
37
  return true;
38
  }
39
+ } else {
40
+ return true;
41
  }
42
  },
43
  // When changing page
73
 
74
  var view_id = this_.attr('data-id');
75
  var spinner = this_.next('.' + _prefix + 'spinner');
76
+
77
  var pagination_wrapper = this_;
78
  if (this_.parent('.' + _prefix + 'pagination-wrapper').length) {
79
  pagination_wrapper = this_.parent('.' + _prefix + 'pagination-wrapper');
80
+ }
81
  var pages_holder = pagination_wrapper.prev('.' + _prefix + 'view');
82
 
83
  // For Timeline