Version Description
- Tested in WordPress 4.3
- Update: Update Content Views icon
- Update: Add new filter to customize current page of pagination
- Update: Print debug message (if the debug mode is enable: PT_CV_DEBUG
Download this release
Release Info
Developer | PT Guy |
Plugin | Content Views – Post Grid & List for WordPress |
Version | 1.6.5.2 |
Comparing to | |
See all releases |
Code changes from version 1.6.5.1 to 1.6.5.2
- README.txt +8 -2
- admin/assets/css/menu.css +1 -1
- admin/assets/images/icon.png +0 -0
- admin/assets/images/icon1.png +0 -0
- content-views.php +2 -2
- includes/defines.php +3 -0
- includes/functions.php +10 -1
- includes/html-viewtype.php +2 -2
- includes/html.php +1 -1
README.txt
CHANGED
@@ -3,8 +3,8 @@ 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.
|
7 |
-
Stable tag: 1.6.5.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -165,6 +165,12 @@ function my_move_bootstrap( $args ) {
|
|
165 |
|
166 |
== Changelog ==
|
167 |
|
|
|
|
|
|
|
|
|
|
|
|
|
168 |
= 1.6.5.1 =
|
169 |
* Bug fixed: Duplicate callback called after pagination finished
|
170 |
* Tested in WordPress 4.2.4
|
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
|
7 |
+
Stable tag: 1.6.5.2
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
165 |
|
166 |
== Changelog ==
|
167 |
|
168 |
+
= 1.6.5.2 =
|
169 |
+
* Tested in WordPress 4.3
|
170 |
+
* Update: Update Content Views icon
|
171 |
+
* Update: Add new filter to customize current page of pagination
|
172 |
+
* Update: Print debug message (if the debug mode is enable: PT_CV_DEBUG = true)
|
173 |
+
|
174 |
= 1.6.5.1 =
|
175 |
* Bug fixed: Duplicate callback called after pagination finished
|
176 |
* Tested in WordPress 4.2.4
|
admin/assets/css/menu.css
CHANGED
@@ -9,6 +9,6 @@
|
|
9 |
*/
|
10 |
|
11 |
#adminmenu #toplevel_page_content-views .menu-icon-generic div.wp-menu-image:before {
|
12 |
-
background: url(../images/icon.png) no-repeat 0
|
13 |
content: '' !important;
|
14 |
}
|
9 |
*/
|
10 |
|
11 |
#adminmenu #toplevel_page_content-views .menu-icon-generic div.wp-menu-image:before {
|
12 |
+
background: url(../images/icon.png) no-repeat 0 14px;
|
13 |
content: '' !important;
|
14 |
}
|
admin/assets/images/icon.png
CHANGED
Binary file
|
admin/assets/images/icon1.png
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.6.5.
|
15 |
* Author: PT Guy
|
16 |
* Author URI: http://profiles.wordpress.org/pt-guy
|
17 |
* Text Domain: content-views
|
@@ -27,7 +27,7 @@ if ( !defined( 'WPINC' ) ) {
|
|
27 |
/*
|
28 |
* Define Constant
|
29 |
*/
|
30 |
-
define( 'PT_CV_VERSION', '1.6.5.
|
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.5.2
|
15 |
* Author: PT Guy
|
16 |
* Author URI: http://profiles.wordpress.org/pt-guy
|
17 |
* Text Domain: content-views
|
27 |
/*
|
28 |
* Define Constant
|
29 |
*/
|
30 |
+
define( 'PT_CV_VERSION', '1.6.5.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/defines.php
CHANGED
@@ -34,3 +34,6 @@ define( 'PT_CV_PUBLIC_ASSETS_URI', plugins_url( 'public/assets/', PT_CV_FILE ) )
|
|
34 |
|
35 |
// View type directory (HTML + CSS + JS)
|
36 |
define( 'PT_CV_VIEW_TYPE_OUTPUT', plugin_dir_path( PT_CV_FILE ) . 'public/templates/' );
|
|
|
|
|
|
34 |
|
35 |
// View type directory (HTML + CSS + JS)
|
36 |
define( 'PT_CV_VIEW_TYPE_OUTPUT', plugin_dir_path( PT_CV_FILE ) . 'public/templates/' );
|
37 |
+
|
38 |
+
// Enable/Disable debug mode
|
39 |
+
define( 'PT_CV_DEBUG', false );
|
includes/functions.php
CHANGED
@@ -741,6 +741,7 @@ if ( !class_exists( 'PT_CV_Functions' ) ) {
|
|
741 |
$max_num_pages = ceil( $total_items / $args[ 'posts_per_page' ] );
|
742 |
|
743 |
// Output pagination
|
|
|
744 |
$html .= "\n" . PT_CV_Html::pagination_output( $max_num_pages, $current_page, $session_id );
|
745 |
}
|
746 |
|
@@ -798,7 +799,7 @@ if ( !class_exists( 'PT_CV_Functions' ) ) {
|
|
798 |
// Restore $wp_query and original Post Data
|
799 |
wp_reset_query();
|
800 |
|
801 |
-
return array( 'content_items' => apply_filters( PT_CV_PREFIX_ . 'content_items', $content_items ), 'pt_query' => $pt_query );
|
802 |
}
|
803 |
|
804 |
/**
|
@@ -1508,6 +1509,14 @@ if ( !class_exists( 'PT_CV_Functions' ) ) {
|
|
1508 |
return $value;
|
1509 |
}
|
1510 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1511 |
}
|
1512 |
|
1513 |
}
|
741 |
$max_num_pages = ceil( $total_items / $args[ 'posts_per_page' ] );
|
742 |
|
743 |
// Output pagination
|
744 |
+
$current_page = apply_filters( PT_CV_PREFIX_ . 'active_page', $current_page, $max_num_pages, $pt_cv_id );
|
745 |
$html .= "\n" . PT_CV_Html::pagination_output( $max_num_pages, $current_page, $session_id );
|
746 |
}
|
747 |
|
799 |
// Restore $wp_query and original Post Data
|
800 |
wp_reset_query();
|
801 |
|
802 |
+
return array( 'content_items' => apply_filters( PT_CV_PREFIX_ . 'content_items', $content_items, $view_type ), 'pt_query' => $pt_query );
|
803 |
}
|
804 |
|
805 |
/**
|
1509 |
return $value;
|
1510 |
}
|
1511 |
|
1512 |
+
/**
|
1513 |
+
* Output debug message (if debug is enable) / nice message (otherwise)
|
1514 |
+
* @param type $message
|
1515 |
+
*/
|
1516 |
+
static function debug_output( $log, $message = '' ) {
|
1517 |
+
return defined( 'PT_CV_DEBUG' ) ? ( PT_CV_DEBUG ? $log : $message ) : $message;
|
1518 |
+
}
|
1519 |
+
|
1520 |
}
|
1521 |
|
1522 |
}
|
includes/html-viewtype.php
CHANGED
@@ -65,7 +65,7 @@ if ( !class_exists( 'PT_CV_Html_ViewType' ) ) {
|
|
65 |
static function grid_wrapper( $content_items, &$content, $column = 0,
|
66 |
$class = '' ) {
|
67 |
|
68 |
-
$
|
69 |
|
70 |
list( $columns, $span_width_last, $span_width, $span_class, $row_class ) = self::process_column_width( $column );
|
71 |
|
@@ -91,7 +91,7 @@ if ( !class_exists( 'PT_CV_Html_ViewType' ) ) {
|
|
91 |
$list_item = implode( "\n", $row_html );
|
92 |
|
93 |
// Only wrap in row if shuffle filter is not enable
|
94 |
-
if ( $
|
95 |
$list_item = sprintf( '<div class="%s">%s</div>', esc_attr( $row_class ), $list_item );
|
96 |
}
|
97 |
|
65 |
static function grid_wrapper( $content_items, &$content, $column = 0,
|
66 |
$class = '' ) {
|
67 |
|
68 |
+
$enable_shuffle_filter = PT_CV_Functions::get_global_variable( 'enable_shuffle_filter' );
|
69 |
|
70 |
list( $columns, $span_width_last, $span_width, $span_class, $row_class ) = self::process_column_width( $column );
|
71 |
|
91 |
$list_item = implode( "\n", $row_html );
|
92 |
|
93 |
// Only wrap in row if shuffle filter is not enable
|
94 |
+
if ( $enable_shuffle_filter != 'yes' ) {
|
95 |
$list_item = sprintf( '<div class="%s">%s</div>', esc_attr( $row_class ), $list_item );
|
96 |
}
|
97 |
|
includes/html.php
CHANGED
@@ -274,7 +274,7 @@ if ( !class_exists( 'PT_CV_Html' ) ) {
|
|
274 |
$dargs = PT_CV_Functions::get_global_variable( 'dargs' );
|
275 |
|
276 |
if ( empty( $content_items ) ) {
|
277 |
-
return 'empty content_items';
|
278 |
}
|
279 |
|
280 |
// Assign as global variable
|
274 |
$dargs = PT_CV_Functions::get_global_variable( 'dargs' );
|
275 |
|
276 |
if ( empty( $content_items ) ) {
|
277 |
+
return PT_CV_Functions::debug_output( 'empty content_items', 'No posts found!' );
|
278 |
}
|
279 |
|
280 |
// Assign as global variable
|