Version Description
- Update: Big update to improve page performance
Download this release
Release Info
Developer | PT Guy |
Plugin | Content Views – Post Grid & List for WordPress |
Version | 1.6.5 |
Comparing to | |
See all releases |
Code changes from version 1.6.4 to 1.6.5
- README.txt +5 -2
- admin/views/view.php +1 -0
- content-views.php +2 -2
- includes/functions.php +19 -12
- includes/html.php +8 -2
- public/content-views.php +3 -3
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.2.
|
7 |
-
Stable tag: 1.6.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -165,6 +165,9 @@ function my_move_bootstrap( $args ) {
|
|
165 |
|
166 |
== Changelog ==
|
167 |
|
|
|
|
|
|
|
168 |
= 1.6.4 =
|
169 |
* Bug fixed: Can't translate content
|
170 |
|
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.2.3
|
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 |
|
166 |
== Changelog ==
|
167 |
|
168 |
+
= 1.6.5 =
|
169 |
+
* Update: Big update to improve page performance
|
170 |
+
|
171 |
= 1.6.4 =
|
172 |
* Bug fixed: Can't translate content
|
173 |
|
admin/views/view.php
CHANGED
@@ -34,6 +34,7 @@ PT_CV_Functions::view_submit();
|
|
34 |
?>
|
35 |
|
36 |
<div class="wrap form-horizontal pt-wrap">
|
|
|
37 |
|
38 |
<h2><?php echo esc_html( $id ? __( 'Edit View', PT_CV_DOMAIN ) : get_admin_page_title() ); ?></h2>
|
39 |
|
34 |
?>
|
35 |
|
36 |
<div class="wrap form-horizontal pt-wrap">
|
37 |
+
<?php do_action( PT_CV_PREFIX_ . 'admin_view_header' ); ?>
|
38 |
|
39 |
<h2><?php echo esc_html( $id ? __( 'Edit View', PT_CV_DOMAIN ) : get_admin_page_title() ); ?></h2>
|
40 |
|
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.
|
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.
|
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
|
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' );
|
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
@@ -375,7 +375,7 @@ if ( !class_exists( 'PT_CV_Functions' ) ) {
|
|
375 |
* @return string
|
376 |
*/
|
377 |
static function post_terms( $post ) {
|
378 |
-
global $pt_cv_glb;
|
379 |
|
380 |
if ( !isset( $pt_cv_glb[ 'item_terms' ] ) ) {
|
381 |
$pt_cv_glb[ 'item_terms' ] = array();
|
@@ -406,7 +406,8 @@ if ( !class_exists( 'PT_CV_Functions' ) ) {
|
|
406 |
$pt_cv_glb[ 'item_terms' ][ $post_id ][ $term->slug ] = $term->name;
|
407 |
}
|
408 |
|
409 |
-
|
|
|
410 |
}
|
411 |
|
412 |
/**
|
@@ -594,6 +595,10 @@ if ( !class_exists( 'PT_CV_Functions' ) ) {
|
|
594 |
}
|
595 |
|
596 |
global $pt_cv_glb, $pt_cv_id;
|
|
|
|
|
|
|
|
|
597 |
|
598 |
$view_id = !empty( $id ) ? $id : PT_CV_Functions::string_random();
|
599 |
|
@@ -634,7 +639,7 @@ if ( !class_exists( 'PT_CV_Functions' ) ) {
|
|
634 |
$view_type = PT_CV_Functions::setting_value( PT_CV_PREFIX . 'view-type', $view_settings );
|
635 |
$pt_cv_glb[ $view_id ][ 'view_type' ] = $view_type;
|
636 |
|
637 |
-
//
|
638 |
$session_id = ( $pargs && isset( $pargs[ 'session_id' ] ) ) ? $pargs[ 'session_id' ] : 0;
|
639 |
|
640 |
// Store main View ID
|
@@ -645,13 +650,16 @@ if ( !class_exists( 'PT_CV_Functions' ) ) {
|
|
645 |
$pt_cv_main_id = $view_id;
|
646 |
}
|
647 |
|
|
|
648 |
if ( $session_id ) {
|
649 |
if ( empty( $pt_cv_id ) ) {
|
650 |
$pt_cv_id = $session_id;
|
651 |
}
|
652 |
|
653 |
-
$
|
654 |
-
|
|
|
|
|
655 |
);
|
656 |
|
657 |
$args = $session_data[ '$args' ];
|
@@ -661,7 +669,7 @@ if ( !class_exists( 'PT_CV_Functions' ) ) {
|
|
661 |
$pt_cv_id = $session_id = $view_id;
|
662 |
|
663 |
// Store settings
|
664 |
-
|
665 |
}
|
666 |
|
667 |
// Extract Query & Display settings from settings array
|
@@ -670,11 +678,9 @@ if ( !class_exists( 'PT_CV_Functions' ) ) {
|
|
670 |
$args = apply_filters( PT_CV_PREFIX_ . 'query_parameters', PT_CV_Functions::view_filter_settings( $content_type, $view_settings ) );
|
671 |
|
672 |
// Store view data
|
673 |
-
|
674 |
-
PT_CV_PREFIX . 'view-data-' . $session_id, array(
|
675 |
'$args' => $args,
|
676 |
'$dargs' => $dargs,
|
677 |
-
), 7 * DAY_IN_SECONDS
|
678 |
);
|
679 |
}
|
680 |
|
@@ -926,9 +932,10 @@ if ( !class_exists( 'PT_CV_Functions' ) ) {
|
|
926 |
|
927 |
// Status
|
928 |
case 'status':
|
929 |
-
$
|
|
|
930 |
$args, array(
|
931 |
-
'post_status' =>
|
932 |
)
|
933 |
);
|
934 |
break;
|
@@ -1311,7 +1318,7 @@ if ( !class_exists( 'PT_CV_Functions' ) ) {
|
|
1311 |
$session_id = empty( $_POST[ 'sid' ] ) ? '' : esc_sql( $_POST[ 'sid' ] );
|
1312 |
|
1313 |
// Get saved $settings
|
1314 |
-
$settings =
|
1315 |
|
1316 |
// If empty, get settings by ID
|
1317 |
if ( !$settings ) {
|
375 |
* @return string
|
376 |
*/
|
377 |
static function post_terms( $post ) {
|
378 |
+
global $pt_cv_glb, $pt_cv_id;
|
379 |
|
380 |
if ( !isset( $pt_cv_glb[ 'item_terms' ] ) ) {
|
381 |
$pt_cv_glb[ 'item_terms' ] = array();
|
406 |
$pt_cv_glb[ 'item_terms' ][ $post_id ][ $term->slug ] = $term->name;
|
407 |
}
|
408 |
|
409 |
+
// Adjust terms list
|
410 |
+
return implode( ', ', apply_filters( PT_CV_PREFIX_ . 'terms_list', $links, $pt_cv_id ) );
|
411 |
}
|
412 |
|
413 |
/**
|
595 |
}
|
596 |
|
597 |
global $pt_cv_glb, $pt_cv_id;
|
598 |
+
if ( !is_array( $pt_cv_glb ) )
|
599 |
+
$pt_cv_glb = array();
|
600 |
+
if ( !isset( $pt_cv_glb ) )
|
601 |
+
$pt_cv_id = 0;
|
602 |
|
603 |
$view_id = !empty( $id ) ? $id : PT_CV_Functions::string_random();
|
604 |
|
639 |
$view_type = PT_CV_Functions::setting_value( PT_CV_PREFIX . 'view-type', $view_settings );
|
640 |
$pt_cv_glb[ $view_id ][ 'view_type' ] = $view_type;
|
641 |
|
642 |
+
// Get session id, not empty if is pagination request
|
643 |
$session_id = ( $pargs && isset( $pargs[ 'session_id' ] ) ) ? $pargs[ 'session_id' ] : 0;
|
644 |
|
645 |
// Store main View ID
|
650 |
$pt_cv_main_id = $view_id;
|
651 |
}
|
652 |
|
653 |
+
// If is pagination request
|
654 |
if ( $session_id ) {
|
655 |
if ( empty( $pt_cv_id ) ) {
|
656 |
$pt_cv_id = $session_id;
|
657 |
}
|
658 |
|
659 |
+
$saved_settings = isset( $_SESSION[ PT_CV_PREFIX . 'view-data-' . $session_id ] ) ? $_SESSION[ PT_CV_PREFIX . 'view-data-' . $session_id ] : array();
|
660 |
+
|
661 |
+
$session_data = array_merge(
|
662 |
+
array( '$args' => '', '$dargs' => '' ), $saved_settings
|
663 |
);
|
664 |
|
665 |
$args = $session_data[ '$args' ];
|
669 |
$pt_cv_id = $session_id = $view_id;
|
670 |
|
671 |
// Store settings
|
672 |
+
$_SESSION[ PT_CV_PREFIX . 'view-settings-' . $session_id ] = $settings;
|
673 |
}
|
674 |
|
675 |
// Extract Query & Display settings from settings array
|
678 |
$args = apply_filters( PT_CV_PREFIX_ . 'query_parameters', PT_CV_Functions::view_filter_settings( $content_type, $view_settings ) );
|
679 |
|
680 |
// Store view data
|
681 |
+
$_SESSION[ PT_CV_PREFIX . 'view-data-' . $session_id ] = array(
|
|
|
682 |
'$args' => $args,
|
683 |
'$dargs' => $dargs,
|
|
|
684 |
);
|
685 |
}
|
686 |
|
932 |
|
933 |
// Status
|
934 |
case 'status':
|
935 |
+
$status = PT_CV_Functions::string_to_array( PT_CV_Functions::setting_value( PT_CV_PREFIX . 'post_status', $view_settings, 'publish' ) );
|
936 |
+
$args = array_merge(
|
937 |
$args, array(
|
938 |
+
'post_status' => apply_filters( PT_CV_PREFIX_ . 'post_status', $status ),
|
939 |
)
|
940 |
);
|
941 |
break;
|
1318 |
$session_id = empty( $_POST[ 'sid' ] ) ? '' : esc_sql( $_POST[ 'sid' ] );
|
1319 |
|
1320 |
// Get saved $settings
|
1321 |
+
$settings = isset( $_SESSION[ PT_CV_PREFIX . 'view-settings-' . $session_id ] ) ? $_SESSION[ PT_CV_PREFIX . 'view-settings-' . $session_id ] : array();
|
1322 |
|
1323 |
// If empty, get settings by ID
|
1324 |
if ( !$settings ) {
|
includes/html.php
CHANGED
@@ -196,7 +196,10 @@ if ( !class_exists( 'PT_CV_Html' ) ) {
|
|
196 |
$fargs[ 'layout-format' ] = $dargs[ 'layout-format' ];
|
197 |
|
198 |
// Get HTML output of field
|
199 |
-
$
|
|
|
|
|
|
|
200 |
}
|
201 |
|
202 |
$fields_html = apply_filters( PT_CV_PREFIX_ . 'fields_html', $fields_html, $post );
|
@@ -353,6 +356,9 @@ if ( !class_exists( 'PT_CV_Html' ) ) {
|
|
353 |
$output = $html;
|
354 |
}
|
355 |
|
|
|
|
|
|
|
356 |
return balanceTags( $before_output ) . balanceTags( $output );
|
357 |
}
|
358 |
|
@@ -454,7 +460,7 @@ if ( !class_exists( 'PT_CV_Html' ) ) {
|
|
454 |
'<%1$s class="%2$s">%3$s</%1$s>', $tag, esc_attr( $title_class ), self::_field_href( $oargs, $post, $title )
|
455 |
);
|
456 |
|
457 |
-
return $html;
|
458 |
}
|
459 |
|
460 |
/**
|
196 |
$fargs[ 'layout-format' ] = $dargs[ 'layout-format' ];
|
197 |
|
198 |
// Get HTML output of field
|
199 |
+
$item_html = self::field_item_html( $field_name, $post, $fargs );
|
200 |
+
if ( $item_html ) {
|
201 |
+
$fields_html[ $field_name ] = $item_html;
|
202 |
+
}
|
203 |
}
|
204 |
|
205 |
$fields_html = apply_filters( PT_CV_PREFIX_ . 'fields_html', $fields_html, $post );
|
356 |
$output = $html;
|
357 |
}
|
358 |
|
359 |
+
// Unlock Session
|
360 |
+
session_write_close();
|
361 |
+
|
362 |
return balanceTags( $before_output ) . balanceTags( $output );
|
363 |
}
|
364 |
|
460 |
'<%1$s class="%2$s">%3$s</%1$s>', $tag, esc_attr( $title_class ), self::_field_href( $oargs, $post, $title )
|
461 |
);
|
462 |
|
463 |
+
return apply_filters( PT_CV_PREFIX_ . 'field_title_extra', $html, $post );
|
464 |
}
|
465 |
|
466 |
/**
|
public/content-views.php
CHANGED
@@ -191,7 +191,7 @@ class PT_Content_Views {
|
|
191 |
*
|
192 |
* @return array|false The blog ids, false if no matches.
|
193 |
*/
|
194 |
-
|
195 |
|
196 |
global $wpdb;
|
197 |
|
@@ -208,7 +208,7 @@ class PT_Content_Views {
|
|
208 |
*
|
209 |
* @since 1.0.0
|
210 |
*/
|
211 |
-
|
212 |
update_option( PT_CV_OPTION_VERSION, PT_CV_VERSION );
|
213 |
}
|
214 |
|
@@ -217,7 +217,7 @@ class PT_Content_Views {
|
|
217 |
*
|
218 |
* @since 1.0.0
|
219 |
*/
|
220 |
-
|
221 |
delete_option( PT_CV_OPTION_VERSION );
|
222 |
}
|
223 |
|
191 |
*
|
192 |
* @return array|false The blog ids, false if no matches.
|
193 |
*/
|
194 |
+
public static function get_blog_ids() {
|
195 |
|
196 |
global $wpdb;
|
197 |
|
208 |
*
|
209 |
* @since 1.0.0
|
210 |
*/
|
211 |
+
public static function single_activate() {
|
212 |
update_option( PT_CV_OPTION_VERSION, PT_CV_VERSION );
|
213 |
}
|
214 |
|
217 |
*
|
218 |
* @since 1.0.0
|
219 |
*/
|
220 |
+
public static function single_deactivate() {
|
221 |
delete_option( PT_CV_OPTION_VERSION );
|
222 |
}
|
223 |
|