Version Description
- Bug fixed: "Invalid post type" error in "All Views" page
- Update: Better responsive output of Scrollable List on Mobile
- Update: Auto changes line-breaks in the excerpt into HTML paragraphs (if allows HTML tags in excerpt)
- Tested up to: 4.1.1
Download this release
Release Info
Developer | PT Guy |
Plugin | Content Views – Post Grid & List for WordPress |
Version | 1.5.4 |
Comparing to | |
See all releases |
Code changes from version 1.5.3 to 1.5.4
- README.txt +9 -3
- admin/assets/css/admin.css +10 -7
- admin/assets/js/admin.js +1 -1
- admin/views/view.php +7 -0
- content-views.php +2 -2
- includes/functions.php +19 -1
- includes/html-viewtype.php +3 -1
- includes/settings.php +2 -2
- includes/values.php +4 -5
- public/content-views.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.1
|
7 |
-
Stable tag: 1.5.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -165,8 +165,14 @@ function my_move_bootstrap( $args ) {
|
|
165 |
|
166 |
== Changelog ==
|
167 |
|
|
|
|
|
|
|
|
|
|
|
|
|
168 |
= 1.5.3 =
|
169 |
-
* Update: Supports qTranslate family
|
170 |
|
171 |
= 1.5.2 =
|
172 |
* Bug fixed: Scrollable list does not show navigation and indicator
|
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.1.1
|
7 |
+
Stable tag: 1.5.4
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
165 |
|
166 |
== Changelog ==
|
167 |
|
168 |
+
= 1.5.4 =
|
169 |
+
* Bug fixed: "Invalid post type" error in "All Views" page
|
170 |
+
* Update: Better responsive output of Scrollable List on Mobile
|
171 |
+
* Update: Auto changes line-breaks in the excerpt into HTML paragraphs (if allows HTML tags in excerpt)
|
172 |
+
* Tested up to: 4.1.1
|
173 |
+
|
174 |
= 1.5.3 =
|
175 |
+
* Update: Supports qTranslate family plugins (qTranslate, mqTranslate, qTranslate-X)
|
176 |
|
177 |
= 1.5.2 =
|
178 |
* Bug fixed: Scrollable list does not show navigation and indicator
|
admin/assets/css/admin.css
CHANGED
@@ -105,6 +105,16 @@ html {
|
|
105 |
float: left;
|
106 |
}
|
107 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
108 |
/* Group type */
|
109 |
.panel-group .pt-cv-group {
|
110 |
margin-top: 10px;
|
@@ -203,13 +213,6 @@ html {
|
|
203 |
.pt-cv-bg-none {
|
204 |
background: #fff;
|
205 |
}
|
206 |
-
.pt-cv-field-display .unsortable {
|
207 |
-
margin-left: -30px !important;
|
208 |
-
|
209 |
-
}
|
210 |
-
.pt-cv-field-display .unsortable label {
|
211 |
-
font-weight: bold !important;
|
212 |
-
}
|
213 |
|
214 |
/* Sortable */
|
215 |
.pt-wrap .ui-sortable {
|
105 |
float: left;
|
106 |
}
|
107 |
|
108 |
+
.pt-cv-w200 select,
|
109 |
+
.pt-cv-w200 radio {
|
110 |
+
width: 200px;
|
111 |
+
float: left;
|
112 |
+
}
|
113 |
+
|
114 |
+
.pt-wrap .updated {
|
115 |
+
display: none;
|
116 |
+
}
|
117 |
+
|
118 |
/* Group type */
|
119 |
.panel-group .pt-cv-group {
|
120 |
margin-top: 10px;
|
213 |
.pt-cv-bg-none {
|
214 |
background: #fff;
|
215 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
216 |
|
217 |
/* Sortable */
|
218 |
.pt-wrap .ui-sortable {
|
admin/assets/js/admin.js
CHANGED
@@ -80,7 +80,7 @@
|
|
80 |
var _prefix = $self.options._prefix;
|
81 |
|
82 |
// If there is no taxonomies
|
83 |
-
if ($wrap_taxonomies.find('.
|
84 |
return !$(this).hasClass('hidden') && $(this).find('input:checked').length;
|
85 |
}).length > 1) {
|
86 |
$taxonomy_relation.removeClass('hidden');
|
80 |
var _prefix = $self.options._prefix;
|
81 |
|
82 |
// If there is no taxonomies
|
83 |
+
if ($wrap_taxonomies.find('.' + _prefix + 'taxonomies .checkbox').filter(function () {
|
84 |
return !$(this).hasClass('hidden') && $(this).find('input:checked').length;
|
85 |
}).length > 1) {
|
86 |
$taxonomy_relation.removeClass('hidden');
|
admin/views/view.php
CHANGED
@@ -323,6 +323,11 @@ $options = array(
|
|
323 |
'label' => array(
|
324 |
'text' => __( 'Taxonomies', PT_CV_DOMAIN ),
|
325 |
),
|
|
|
|
|
|
|
|
|
|
|
326 |
'params' => array(
|
327 |
array(
|
328 |
'type' => 'checkbox',
|
@@ -373,6 +378,8 @@ $options = array(
|
|
373 |
),
|
374 |
),
|
375 |
),
|
|
|
|
|
376 |
), // End Taxonomies Settings
|
377 |
|
378 |
// Order by Settings
|
323 |
'label' => array(
|
324 |
'text' => __( 'Taxonomies', PT_CV_DOMAIN ),
|
325 |
),
|
326 |
+
'extra_setting' => array(
|
327 |
+
'params' => array(
|
328 |
+
'wrap-class' => PT_CV_PREFIX . 'taxonomies',
|
329 |
+
),
|
330 |
+
),
|
331 |
'params' => array(
|
332 |
array(
|
333 |
'type' => 'checkbox',
|
378 |
),
|
379 |
),
|
380 |
),
|
381 |
+
|
382 |
+
apply_filters( PT_CV_PREFIX_ . 'taxonomies_custom_settings', array() ),
|
383 |
), // End Taxonomies Settings
|
384 |
|
385 |
// Order by Settings
|
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.5.
|
14 |
* Author: PT Guy
|
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.5.
|
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.5.4
|
14 |
* Author: PT Guy
|
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.5.4' );
|
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
@@ -214,12 +214,21 @@ if ( ! class_exists( 'PT_CV_Functions' ) ) {
|
|
214 |
* @return string
|
215 |
*/
|
216 |
static function wp_trim_words( $text, $num_words = 500 ) {
|
|
|
|
|
|
|
217 |
// Strip all shortcodes
|
218 |
$text = strip_shortcodes( $text );
|
|
|
|
|
|
|
|
|
219 |
// Strip HTML tags
|
220 |
$result = self::pt_strip_tags( $text );
|
|
|
221 |
// Split words
|
222 |
$array = preg_split( "/[\n\r\t ]+/", $result, $num_words + 1, PREG_SPLIT_NO_EMPTY );
|
|
|
223 |
// Already short enough, return the whole thing
|
224 |
if ( count( $array ) > $num_words )
|
225 |
{
|
@@ -244,7 +253,16 @@ if ( ! class_exists( 'PT_CV_Functions' ) ) {
|
|
244 |
global $dargs;
|
245 |
# predefined allowable HTML tags
|
246 |
$allowable_tags = (array) apply_filters( PT_CV_PREFIX_ . 'allowable_tags', array( '<a>', '<br>', '<strong>', '<em>', '<strike>', '<i>', '<ul>', '<ol>', '<li>' ) );
|
247 |
-
$allowed_tags =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
248 |
$string = strip_tags( $string, $allowed_tags );
|
249 |
|
250 |
return trim( $string );
|
214 |
* @return string
|
215 |
*/
|
216 |
static function wp_trim_words( $text, $num_words = 500 ) {
|
217 |
+
// Add shortcode which was not added to global $shortcode_tags manually
|
218 |
+
do_action( PT_CV_PREFIX_ . 'before_strip_shortcodes' );
|
219 |
+
|
220 |
// Strip all shortcodes
|
221 |
$text = strip_shortcodes( $text );
|
222 |
+
|
223 |
+
// Recovery global $shortcode_tags
|
224 |
+
do_action( PT_CV_PREFIX_ . 'after_strip_shortcodes' );
|
225 |
+
|
226 |
// Strip HTML tags
|
227 |
$result = self::pt_strip_tags( $text );
|
228 |
+
|
229 |
// Split words
|
230 |
$array = preg_split( "/[\n\r\t ]+/", $result, $num_words + 1, PREG_SPLIT_NO_EMPTY );
|
231 |
+
|
232 |
// Already short enough, return the whole thing
|
233 |
if ( count( $array ) > $num_words )
|
234 |
{
|
253 |
global $dargs;
|
254 |
# predefined allowable HTML tags
|
255 |
$allowable_tags = (array) apply_filters( PT_CV_PREFIX_ . 'allowable_tags', array( '<a>', '<br>', '<strong>', '<em>', '<strike>', '<i>', '<ul>', '<ol>', '<li>' ) );
|
256 |
+
$allowed_tags = '';
|
257 |
+
if ( ! empty( $dargs['field-settings']['content']['allow_html'] ) ) {
|
258 |
+
$allowed_tags = implode( '', $allowable_tags );
|
259 |
+
|
260 |
+
// Changes double line-breaks in the text into HTML paragraphs (<p>, <br>)
|
261 |
+
if ( apply_filters( PT_CV_PREFIX_ . 'wpautop', 0 ) ) {
|
262 |
+
$string = wpautop( $string );
|
263 |
+
}
|
264 |
+
}
|
265 |
+
|
266 |
$string = strip_tags( $string, $allowed_tags );
|
267 |
|
268 |
return trim( $string );
|
includes/html-viewtype.php
CHANGED
@@ -215,7 +215,9 @@ if ( ! class_exists( 'PT_CV_Html_ViewType' ) ) {
|
|
215 |
$_span_width = ( $idx == count( $items_per_row ) - 1 ) ? $span_width_last : $span_width;
|
216 |
|
217 |
// Wrap content of item
|
218 |
-
$
|
|
|
|
|
219 |
}
|
220 |
|
221 |
$slide_html[] = sprintf( '<div class="%1$s">%2$s</div>', esc_attr( $row_class ), implode( "\n", $row_html ) );
|
215 |
$_span_width = ( $idx == count( $items_per_row ) - 1 ) ? $span_width_last : $span_width;
|
216 |
|
217 |
// Wrap content of item
|
218 |
+
$item_classes = apply_filters( PT_CV_PREFIX_ . 'item_col_class', array( $span_class . $_span_width ), $_span_width );
|
219 |
+
$item_class = implode( ' ', array_filter( $item_classes ) );
|
220 |
+
$row_html[] = PT_CV_Html::content_item_wrap( $content_item, $item_class );
|
221 |
}
|
222 |
|
223 |
$slide_html[] = sprintf( '<div class="%1$s">%2$s</div>', esc_attr( $row_class ), implode( "\n", $row_html ) );
|
includes/settings.php
CHANGED
@@ -65,7 +65,7 @@ if ( ! class_exists( 'PT_CV_Settings' ) ) {
|
|
65 |
),
|
66 |
'params' => array(
|
67 |
array(
|
68 |
-
'type' => '
|
69 |
'name' => $taxonomy_slug . '-operator',
|
70 |
'options' => PT_CV_Values::taxonomy_operators(),
|
71 |
'std' => 'IN',
|
@@ -489,7 +489,7 @@ if ( ! class_exists( 'PT_CV_Settings' ) ) {
|
|
489 |
),
|
490 |
'extra_setting' => array(
|
491 |
'params' => array(
|
492 |
-
'wrap-class' => PT_CV_PREFIX . 'bg-none' . ' ' . PT_CV_PREFIX . '
|
493 |
),
|
494 |
),
|
495 |
'params' => array(
|
65 |
),
|
66 |
'params' => array(
|
67 |
array(
|
68 |
+
'type' => 'select',
|
69 |
'name' => $taxonomy_slug . '-operator',
|
70 |
'options' => PT_CV_Values::taxonomy_operators(),
|
71 |
'std' => 'IN',
|
489 |
),
|
490 |
'extra_setting' => array(
|
491 |
'params' => array(
|
492 |
+
'wrap-class' => PT_CV_PREFIX . 'bg-none' . ' ' . PT_CV_PREFIX . 'w200',
|
493 |
),
|
494 |
),
|
495 |
'params' => array(
|
includes/values.php
CHANGED
@@ -101,9 +101,9 @@ if ( ! class_exists( 'PT_CV_Values' ) ) {
|
|
101 |
*/
|
102 |
static function taxonomy_operators() {
|
103 |
return array(
|
104 |
-
'IN' =>
|
105 |
-
'NOT IN' =>
|
106 |
-
'AND' =>
|
107 |
);
|
108 |
}
|
109 |
|
@@ -393,9 +393,8 @@ if ( ! class_exists( 'PT_CV_Values' ) ) {
|
|
393 |
static function open_in() {
|
394 |
|
395 |
$open_in = array(
|
396 |
-
'_blank' => __( 'New tab', PT_CV_DOMAIN ),
|
397 |
'_self' => __( 'Current tab', PT_CV_DOMAIN ),
|
398 |
-
|
399 |
);
|
400 |
|
401 |
$result = apply_filters( PT_CV_PREFIX_ . 'open_in', $open_in );
|
101 |
*/
|
102 |
static function taxonomy_operators() {
|
103 |
return array(
|
104 |
+
'IN' => __( 'IN', PT_CV_DOMAIN ) . ' — ' . __( 'A post is displayed only if it associated with at least one value in terms list', PT_CV_DOMAIN ),
|
105 |
+
'NOT IN' => __( 'NOT IN', PT_CV_DOMAIN ) . ' — ' . __( 'A post is displayed only if it did NOT associated with any values in terms list', PT_CV_DOMAIN ),
|
106 |
+
'AND' => __( 'AND', PT_CV_DOMAIN ) . ' — ' . __( 'A post is displayed only if it associated with all values in terms list', PT_CV_DOMAIN ),
|
107 |
);
|
108 |
}
|
109 |
|
393 |
static function open_in() {
|
394 |
|
395 |
$open_in = array(
|
|
|
396 |
'_self' => __( 'Current tab', PT_CV_DOMAIN ),
|
397 |
+
'_blank' => __( 'New tab', PT_CV_DOMAIN ),
|
398 |
);
|
399 |
|
400 |
$result = apply_filters( PT_CV_PREFIX_ . 'open_in', $open_in );
|
public/content-views.php
CHANGED
@@ -268,7 +268,7 @@ class PT_Content_Views {
|
|
268 |
'public' => false,
|
269 |
|
270 |
// Hide in menu, but can see All Views page
|
271 |
-
'show_ui' =>
|
272 |
'show_in_menu' => false,
|
273 |
|
274 |
'query_var' => true,
|
268 |
'public' => false,
|
269 |
|
270 |
// Hide in menu, but can see All Views page
|
271 |
+
'show_ui' => true, // set "true" to fix "Invalid post type" error
|
272 |
'show_in_menu' => false,
|
273 |
|
274 |
'query_var' => true,
|