Version Description
- Improvement: Allow some HTML tags (p, a, br, strong, em, i, ul, ol, li) in excerpt
- Update: Exclude Views from front-end search results
Download this release
Release Info
Developer | PT Guy |
Plugin | Content Views – Post Grid & List for WordPress |
Version | 1.4.6 |
Comparing to | |
See all releases |
Code changes from version 1.4.5 to 1.4.6
- README.txt +5 -1
- admin/views/view.php +1 -1
- content-views.php +2 -2
- includes/functions.php +19 -2
- includes/html.php +3 -2
- includes/settings.php +1 -1
- includes/values.php +5 -1
- public/content-views.php +1 -0
README.txt
CHANGED
@@ -4,7 +4,7 @@ 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, 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: 4.1
|
7 |
-
Stable tag: 1.4.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -144,6 +144,10 @@ You can create Unlimited Views, in Unlimited websites
|
|
144 |
|
145 |
== Changelog ==
|
146 |
|
|
|
|
|
|
|
|
|
147 |
= 1.4.5 =
|
148 |
* Test up to 4.1
|
149 |
* Improvement: Add shortcode column to All Views page
|
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: 4.1
|
7 |
+
Stable tag: 1.4.6
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
144 |
|
145 |
== Changelog ==
|
146 |
|
147 |
+
= 1.4.6 =
|
148 |
+
* Improvement: Allow some HTML tags (p, a, br, strong, em, i, ul, ol, li) in excerpt
|
149 |
+
* Update: Exclude Views from front-end search results
|
150 |
+
|
151 |
= 1.4.5 =
|
152 |
* Test up to 4.1
|
153 |
* Improvement: Add shortcode column to All Views page
|
admin/views/view.php
CHANGED
@@ -244,7 +244,7 @@ $options = array(
|
|
244 |
'std' => '10',
|
245 |
'min' => '1',
|
246 |
'append_text' => '1 → 999',
|
247 |
-
'desc' => __( 'The number of posts to show.
|
248 |
),
|
249 |
),
|
250 |
),
|
244 |
'std' => '10',
|
245 |
'min' => '1',
|
246 |
'append_text' => '1 → 999',
|
247 |
+
'desc' => __( 'The number of posts to show. Set empty to show all found posts (which match all filter settings)', PT_CV_DOMAIN ),
|
248 |
),
|
249 |
),
|
250 |
),
|
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.4.
|
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.4.
|
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.4.6
|
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.4.6' );
|
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
@@ -177,8 +177,8 @@ if ( ! class_exists( 'PT_CV_Functions' ) ) {
|
|
177 |
* @since 1.4.3
|
178 |
*/
|
179 |
static function wp_trim_words( $text, $num_words = 55 ) {
|
180 |
-
$result =
|
181 |
-
$array = preg_split( "/[\n\r\t ]+/", $result, $num_words + 1, PREG_SPLIT_NO_EMPTY )
|
182 |
|
183 |
// Already short enough, return the whole thing
|
184 |
if ( count( $array ) > $num_words )
|
@@ -189,9 +189,26 @@ if ( ! class_exists( 'PT_CV_Functions' ) ) {
|
|
189 |
|
190 |
// Trim space, dot at the end of string
|
191 |
$result = rtrim( $result, '\s.' );
|
|
|
|
|
192 |
|
193 |
return $result;
|
194 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
195 |
|
196 |
/**
|
197 |
* Get thumbnail dimensions
|
177 |
* @since 1.4.3
|
178 |
*/
|
179 |
static function wp_trim_words( $text, $num_words = 55 ) {
|
180 |
+
$result = self::pt_strip_tags( $text );
|
181 |
+
$array = preg_split( "/[\n\r\t ]+/", $result, $num_words + 1, PREG_SPLIT_NO_EMPTY );
|
182 |
|
183 |
// Already short enough, return the whole thing
|
184 |
if ( count( $array ) > $num_words )
|
189 |
|
190 |
// Trim space, dot at the end of string
|
191 |
$result = rtrim( $result, '\s.' );
|
192 |
+
// Trim start, end p
|
193 |
+
$result = trim( $result, '<p></p>' );
|
194 |
|
195 |
return $result;
|
196 |
}
|
197 |
+
|
198 |
+
/**
|
199 |
+
* Custom strip tags, allow some tags
|
200 |
+
*
|
201 |
+
* @since 1.4.6
|
202 |
+
* @param string $string
|
203 |
+
* @return string
|
204 |
+
*/
|
205 |
+
static function pt_strip_tags( $string ) {
|
206 |
+
$string = preg_replace( '@<(script|style)[^>]*?>.*?</\\1>@si', '', $string );
|
207 |
+
# allow some tags
|
208 |
+
$string = strip_tags( $string, '<p><a><br><strong><em><i><ul><ol><li>' );
|
209 |
+
|
210 |
+
return trim( $string );
|
211 |
+
}
|
212 |
|
213 |
/**
|
214 |
* Get thumbnail dimensions
|
includes/html.php
CHANGED
@@ -499,7 +499,7 @@ if ( ! class_exists( 'PT_CV_Html' ) ) {
|
|
499 |
// Force balance tags
|
500 |
$content = force_balance_tags( strip_shortcodes( $content ) );
|
501 |
|
502 |
-
$content = apply_filters( PT_CV_PREFIX_ . 'field_content_final', $content );
|
503 |
|
504 |
break;
|
505 |
|
@@ -634,8 +634,9 @@ if ( ! class_exists( 'PT_CV_Html' ) ) {
|
|
634 |
// Get date wrapper class
|
635 |
$date_class = apply_filters( PT_CV_PREFIX_ . 'field_meta_class', 'entry-date', 'date' );
|
636 |
$prefix_text = apply_filters( PT_CV_PREFIX_ . 'field_meta_prefix_text', '', 'date' );
|
|
|
637 |
|
638 |
-
$html['date'] = sprintf( '<span class="%s">%s <time datetime="%s">%s</time></span>', esc_html( $date_class ), balanceTags( $prefix_text ), esc_attr( get_the_date( 'c' ) ), esc_html(
|
639 |
break;
|
640 |
|
641 |
case 'taxonomy':
|
499 |
// Force balance tags
|
500 |
$content = force_balance_tags( strip_shortcodes( $content ) );
|
501 |
|
502 |
+
$content = apply_filters( PT_CV_PREFIX_ . 'field_content_final', $content, $post );
|
503 |
|
504 |
break;
|
505 |
|
634 |
// Get date wrapper class
|
635 |
$date_class = apply_filters( PT_CV_PREFIX_ . 'field_meta_class', 'entry-date', 'date' );
|
636 |
$prefix_text = apply_filters( PT_CV_PREFIX_ . 'field_meta_prefix_text', '', 'date' );
|
637 |
+
$date = apply_filters( PT_CV_PREFIX_ . 'field_meta_date_final', get_the_date(), get_the_time( 'U' ) );
|
638 |
|
639 |
+
$html['date'] = sprintf( '<span class="%s">%s <time datetime="%s">%s</time></span>', esc_html( $date_class ), balanceTags( $prefix_text ), esc_attr( get_the_date( 'c' ) ), esc_html( $date ) );
|
640 |
break;
|
641 |
|
642 |
case 'taxonomy':
|
includes/settings.php
CHANGED
@@ -326,7 +326,7 @@ if ( ! class_exists( 'PT_CV_Settings' ) ) {
|
|
326 |
// Excerpt length
|
327 |
array(
|
328 |
'label' => array(
|
329 |
-
'text' => __( 'Excerpt
|
330 |
),
|
331 |
'extra_setting' => array(
|
332 |
'params' => array(
|
326 |
// Excerpt length
|
327 |
array(
|
328 |
'label' => array(
|
329 |
+
'text' => __( 'Excerpt settings', PT_CV_DOMAIN ),
|
330 |
),
|
331 |
'extra_setting' => array(
|
332 |
'params' => array(
|
includes/values.php
CHANGED
@@ -390,7 +390,7 @@ if ( ! class_exists( 'PT_CV_Values' ) ) {
|
|
390 |
/**
|
391 |
* Get all thumbnail sizes
|
392 |
*/
|
393 |
-
static function field_thumbnail_sizes() {
|
394 |
// All available thumbnail sizes
|
395 |
global $_wp_additional_image_sizes;
|
396 |
|
@@ -421,6 +421,10 @@ if ( ! class_exists( 'PT_CV_Values' ) ) {
|
|
421 |
|
422 |
$sizes_to_sort[$size_name] = ucfirst( preg_replace( '/[\-_]/', ' ', $size_name ) ) . ' (' . implode( ' × ', $this_size ) . ')';
|
423 |
}
|
|
|
|
|
|
|
|
|
424 |
}
|
425 |
// Add full sizes
|
426 |
$result['full'] = __( 'Original resolution (But resize automatically to fit its container)', PT_CV_DOMAIN );
|
390 |
/**
|
391 |
* Get all thumbnail sizes
|
392 |
*/
|
393 |
+
static function field_thumbnail_sizes( $_size_name = '' ) {
|
394 |
// All available thumbnail sizes
|
395 |
global $_wp_additional_image_sizes;
|
396 |
|
421 |
|
422 |
$sizes_to_sort[$size_name] = ucfirst( preg_replace( '/[\-_]/', ' ', $size_name ) ) . ' (' . implode( ' × ', $this_size ) . ')';
|
423 |
}
|
424 |
+
|
425 |
+
if ( ! empty($_size_name) && $_size_name == $size_name ) {
|
426 |
+
return $this_size;
|
427 |
+
}
|
428 |
}
|
429 |
// Add full sizes
|
430 |
$result['full'] = __( 'Original resolution (But resize automatically to fit its container)', PT_CV_DOMAIN );
|
public/content-views.php
CHANGED
@@ -267,6 +267,7 @@ class PT_Content_Views {
|
|
267 |
'labels' => $labels,
|
268 |
'public' => true,
|
269 |
'publicly_queryable' => true,
|
|
|
270 |
|
271 |
// Hide in menu, but can see All Views page
|
272 |
'show_ui' => false,
|
267 |
'labels' => $labels,
|
268 |
'public' => true,
|
269 |
'publicly_queryable' => true,
|
270 |
+
'exclude_from_search' => true, #exclude posts with this post type from front end search results
|
271 |
|
272 |
// Hide in menu, but can see All Views page
|
273 |
'show_ui' => false,
|