Version Description
- Bug fixed: Scrollable list does not show navigation and indicator
- Bug fixed: Prevent duplicated content caused by other plugins (translation plugins...)
Download this release
Release Info
Developer | PT Guy |
Plugin | Content Views – Post Grid & List for WordPress |
Version | 1.5.2 |
Comparing to | |
See all releases |
Code changes from version 1.5.1 to 1.5.2
- README.txt +24 -9
- admin/assets/js/admin.js +3 -5
- admin/views/view.php +2 -0
- content-views.php +2 -2
- includes/functions.php +24 -7
- includes/html-viewtype.php +7 -4
- includes/html.php +19 -18
- public/assets/css/public.css +5 -6
- public/assets/js/public.js +1 -1
- public/content-views.php +3 -3
- public/templates/readme.txt +0 -19
README.txt
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
=== Query posts by category... and display posts on page in grid layout without coding - Content Views ===
|
2 |
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, 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 |
|
@@ -16,6 +16,7 @@ Do you want to display posts by category on WordPress homepage, in responsive gr
|
|
16 |
|
17 |
Or:
|
18 |
|
|
|
19 |
* display posts in grid layout in a specific page
|
20 |
* display posts in grid layout in a widget of sidebar
|
21 |
* display posts by a specific tag
|
@@ -26,6 +27,8 @@ Or:
|
|
26 |
|
27 |
With **Content Views** plugin, you can do above things in minutes, without any line of code!
|
28 |
|
|
|
|
|
29 |
With [Content Views Pro](http://www.contentviewspro.com/?utm_source=wordpress&utm_medium=plugin&utm_campaign=content-views "Get Content Views Pro"), you can do even more than you expect!
|
30 |
|
31 |
**Content Views** provides an intuitive form to query posts and display posts in **responsive** layouts (grid layout, slider/scrollable list, accordion/collapsible list) quickly & easily, in very 3 simple steps:
|
@@ -48,7 +51,8 @@ With [Content Views Pro](http://www.contentviewspro.com/?utm_source=wordpress&ut
|
|
48 |
|
49 |
**in Step 2:**
|
50 |
|
51 |
-
* Select a responsive layout to display posts: Grid, List(Collapsible/Slider)
|
|
|
52 |
* Display fields (thumbnail, title, content, meta fields) in vertical direction. Or display thumbnail in left/right side of other fields
|
53 |
* Select what fields (thumbnail, title, content, meta fields) to display
|
54 |
* Select thumbnail sizes
|
@@ -129,7 +133,12 @@ You will be forwarded to editing page of View.
|
|
129 |
|
130 |
You can create Unlimited Views, in Unlimited websites
|
131 |
|
132 |
-
=
|
|
|
|
|
|
|
|
|
|
|
133 |
|
134 |
Please add this code to file **functions.php** of your theme
|
135 |
`
|
@@ -141,6 +150,8 @@ function my_move_bootstrap( $args ) {
|
|
141 |
}
|
142 |
`
|
143 |
|
|
|
|
|
144 |
== Screenshots ==
|
145 |
|
146 |
1. Content Views plugin overview
|
@@ -154,6 +165,10 @@ function my_move_bootstrap( $args ) {
|
|
154 |
|
155 |
== Changelog ==
|
156 |
|
|
|
|
|
|
|
|
|
157 |
= 1.5.1 =
|
158 |
* Bug fixed: Javascript error in WordPress version 3.4
|
159 |
* Improvement: Code & description clearance
|
@@ -191,7 +206,7 @@ function my_move_bootstrap( $args ) {
|
|
191 |
|
192 |
= 1.4.1 =
|
193 |
* Bug fixed: Excerpt show stranger character if content of post contains nothing but a url
|
194 |
-
* Bug fixed: Height of thumbnail
|
195 |
|
196 |
= 1.4.0 =
|
197 |
* Bug fixed: Grid only shows 1 column
|
@@ -281,12 +296,12 @@ function my_move_bootstrap( $args ) {
|
|
281 |
* Improvement: Assets loading improvement
|
282 |
|
283 |
= 1.2.6 =
|
284 |
-
* Fix bug:
|
285 |
* Update description for some options
|
286 |
* Update styles
|
287 |
|
288 |
= 1.2.5 =
|
289 |
-
* Fix bug:
|
290 |
* Fix notice about constant value
|
291 |
|
292 |
= 1.2.4 =
|
@@ -319,10 +334,10 @@ function my_move_bootstrap( $args ) {
|
|
319 |
* Fix pagination bug (return 0)
|
320 |
|
321 |
= 1.1.4 =
|
322 |
-
* Fix pagination bug when don't load Bootstrap in
|
323 |
|
324 |
= 1.1.3 =
|
325 |
-
* Add option to Settings page to enable/disable load Bootstrap in
|
326 |
* Enable to search by View ID in "All Views" page
|
327 |
* Fix bug Scrollable List (when slide count = 1)
|
328 |
* Update settings page
|
1 |
=== Query posts by category... and display posts on page in grid layout without coding - Content Views ===
|
2 |
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.2
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
16 |
|
17 |
Or:
|
18 |
|
19 |
+
* display posts in grid of 2 columns, 3 columns
|
20 |
* display posts in grid layout in a specific page
|
21 |
* display posts in grid layout in a widget of sidebar
|
22 |
* display posts by a specific tag
|
27 |
|
28 |
With **Content Views** plugin, you can do above things in minutes, without any line of code!
|
29 |
|
30 |
+
[youtube https://www.youtube.com/watch?v=drxqtCiaw4I]
|
31 |
+
|
32 |
With [Content Views Pro](http://www.contentviewspro.com/?utm_source=wordpress&utm_medium=plugin&utm_campaign=content-views "Get Content Views Pro"), you can do even more than you expect!
|
33 |
|
34 |
**Content Views** provides an intuitive form to query posts and display posts in **responsive** layouts (grid layout, slider/scrollable list, accordion/collapsible list) quickly & easily, in very 3 simple steps:
|
51 |
|
52 |
**in Step 2:**
|
53 |
|
54 |
+
* Select a responsive layout to display posts: Grid, List(Collapsible/Slider)
|
55 |
+
* Select number of columns in Grid layout
|
56 |
* Display fields (thumbnail, title, content, meta fields) in vertical direction. Or display thumbnail in left/right side of other fields
|
57 |
* Select what fields (thumbnail, title, content, meta fields) to display
|
58 |
* Select thumbnail sizes
|
133 |
|
134 |
You can create Unlimited Views, in Unlimited websites
|
135 |
|
136 |
+
= How can I add View to home page? =
|
137 |
+
|
138 |
+
If you are using a static page as home page, you should add View shortcode to editor of that page.
|
139 |
+
If you are using a dynamic page (you created a custom site front page template, such as front-page.php), you should paste this code `<?php echo do_shortcode('[pt_view id="VIEW_ID"]'); ?>` to appropriate line in that file.
|
140 |
+
|
141 |
+
= [BUG] When I use Cache plugin (W3TC, WP-Super-Cache...), the grid columns does not work. How to fix it? =
|
142 |
|
143 |
Please add this code to file **functions.php** of your theme
|
144 |
`
|
150 |
}
|
151 |
`
|
152 |
|
153 |
+
|
154 |
+
|
155 |
== Screenshots ==
|
156 |
|
157 |
1. Content Views plugin overview
|
165 |
|
166 |
== Changelog ==
|
167 |
|
168 |
+
= 1.5.2 =
|
169 |
+
* Bug fixed: Scrollable list does not show navigation and indicator
|
170 |
+
* Bug fixed: Prevent duplicated content caused by other plugins (translation plugins...)
|
171 |
+
|
172 |
= 1.5.1 =
|
173 |
* Bug fixed: Javascript error in WordPress version 3.4
|
174 |
* Improvement: Code & description clearance
|
206 |
|
207 |
= 1.4.1 =
|
208 |
* Bug fixed: Excerpt show stranger character if content of post contains nothing but a url
|
209 |
+
* Bug fixed: Height of thumbnail does not match the thumbnail size setting if current WordPress theme set CSS 'min-width' property for images
|
210 |
|
211 |
= 1.4.0 =
|
212 |
* Bug fixed: Grid only shows 1 column
|
296 |
* Improvement: Assets loading improvement
|
297 |
|
298 |
= 1.2.6 =
|
299 |
+
* Fix bug: Javascript error of missing function
|
300 |
* Update description for some options
|
301 |
* Update styles
|
302 |
|
303 |
= 1.2.5 =
|
304 |
+
* Fix bug: does not save Layout format value when select '2 columns' option
|
305 |
* Fix notice about constant value
|
306 |
|
307 |
= 1.2.4 =
|
334 |
* Fix pagination bug (return 0)
|
335 |
|
336 |
= 1.1.4 =
|
337 |
+
* Fix pagination bug when don't load Bootstrap in front-end
|
338 |
|
339 |
= 1.1.3 =
|
340 |
+
* Add option to Settings page to enable/disable load Bootstrap in front-end
|
341 |
* Enable to search by View ID in "All Views" page
|
342 |
* Fix bug Scrollable List (when slide count = 1)
|
343 |
* Update settings page
|
admin/assets/js/admin.js
CHANGED
@@ -472,7 +472,6 @@
|
|
472 |
* @param this_val Layout format value
|
473 |
* @returns void
|
474 |
*/
|
475 |
-
|
476 |
var fn_thumbnail_setting = function (this_val) {
|
477 |
|
478 |
var $thumbnail_wrapper = $('.' + _prefix + 'thumbnail-setting').parent();
|
@@ -499,9 +498,8 @@
|
|
499 |
});
|
500 |
|
501 |
/**
|
502 |
-
* Toggle '
|
503 |
*/
|
504 |
-
|
505 |
var fn_layout_format = function (this_val, layout_format) {
|
506 |
var expect_val = [ 'scrollable' ];
|
507 |
|
@@ -625,8 +623,8 @@
|
|
625 |
$('.' + _prefix + 'bg-none').parent().css({'background-color': '#fff', 'padding-bottom': '10px'});
|
626 |
$('.' + _prefix + 'bg-none').parent().addClass('unsortable');
|
627 |
|
628 |
-
// Prevent click on
|
629 |
-
$('#
|
630 |
e.preventDefault();
|
631 |
});
|
632 |
|
472 |
* @param this_val Layout format value
|
473 |
* @returns void
|
474 |
*/
|
|
|
475 |
var fn_thumbnail_setting = function (this_val) {
|
476 |
|
477 |
var $thumbnail_wrapper = $('.' + _prefix + 'thumbnail-setting').parent();
|
498 |
});
|
499 |
|
500 |
/**
|
501 |
+
* Toggle 'Layout format' when change 'View type'
|
502 |
*/
|
|
|
503 |
var fn_layout_format = function (this_val, layout_format) {
|
504 |
var expect_val = [ 'scrollable' ];
|
505 |
|
623 |
$('.' + _prefix + 'bg-none').parent().css({'background-color': '#fff', 'padding-bottom': '10px'});
|
624 |
$('.' + _prefix + 'bg-none').parent().addClass('unsortable');
|
625 |
|
626 |
+
// Prevent click on links
|
627 |
+
$('#' + _prefix + 'preview-box').on('click', 'a', function (e) {
|
628 |
e.preventDefault();
|
629 |
});
|
630 |
|
admin/views/view.php
CHANGED
@@ -199,6 +199,8 @@ $options = array(
|
|
199 |
),
|
200 |
),
|
201 |
|
|
|
|
|
202 |
// Excludes
|
203 |
array(
|
204 |
'label' => array(
|
199 |
),
|
200 |
),
|
201 |
|
202 |
+
apply_filters( PT_CV_PREFIX_ . 'include_extra_settings', array() ),
|
203 |
+
|
204 |
// Excludes
|
205 |
array(
|
206 |
'label' => array(
|
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.2
|
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.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/functions.php
CHANGED
@@ -172,14 +172,19 @@ if ( ! class_exists( 'PT_CV_Functions' ) ) {
|
|
172 |
}
|
173 |
|
174 |
/**
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
|
|
|
|
|
|
|
|
|
|
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 )
|
185 |
{
|
@@ -202,7 +207,9 @@ if ( ! class_exists( 'PT_CV_Functions' ) ) {
|
|
202 |
|
203 |
# allow some tags
|
204 |
global $dargs;
|
205 |
-
|
|
|
|
|
206 |
$string = strip_tags( $string, $allowed_tags );
|
207 |
|
208 |
return trim( $string );
|
@@ -520,6 +527,16 @@ if ( ! class_exists( 'PT_CV_Functions' ) ) {
|
|
520 |
return __( 'Empty settings', PT_CV_DOMAIN );
|
521 |
}
|
522 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
523 |
// Escaped value appropriate for use in a SQL query
|
524 |
global $pt_view_settings;
|
525 |
|
172 |
}
|
173 |
|
174 |
/**
|
175 |
+
* Trims text to a certain number of words.
|
176 |
+
* @since 1.4.3
|
177 |
+
* @param string $text
|
178 |
+
* @param int $num_words
|
179 |
+
* @return string
|
180 |
+
*/
|
181 |
+
static function wp_trim_words( $text, $num_words = 500 ) {
|
182 |
+
// Strip all shortcodes
|
183 |
+
$text = strip_shortcodes( $text );
|
184 |
+
// Strip HTML tags
|
185 |
$result = self::pt_strip_tags( $text );
|
186 |
+
// Split words
|
187 |
$array = preg_split( "/[\n\r\t ]+/", $result, $num_words + 1, PREG_SPLIT_NO_EMPTY );
|
|
|
188 |
// Already short enough, return the whole thing
|
189 |
if ( count( $array ) > $num_words )
|
190 |
{
|
207 |
|
208 |
# allow some tags
|
209 |
global $dargs;
|
210 |
+
# predefined allowable HTML tags
|
211 |
+
$allowable_tags = (array) apply_filters( PT_CV_PREFIX_ . 'allowable_tags', array( '<a>', '<br>', '<strong>', '<em>', '<strike>', '<i>', '<ul>', '<ol>', '<li>' ) );
|
212 |
+
$allowed_tags = ! empty( $dargs['field-settings']['content']['allow_html'] ) ? implode( '', $allowable_tags ) : '';
|
213 |
$string = strip_tags( $string, $allowed_tags );
|
214 |
|
215 |
return trim( $string );
|
527 |
return __( 'Empty settings', PT_CV_DOMAIN );
|
528 |
}
|
529 |
|
530 |
+
/**
|
531 |
+
* Check if this view is processed in this page
|
532 |
+
* @since 1.5.2
|
533 |
+
*/
|
534 |
+
global $processed_views;
|
535 |
+
if ( ! empty( $processed_views[$id] ) ) {
|
536 |
+
return '';
|
537 |
+
}
|
538 |
+
$processed_views[$id] = 1;
|
539 |
+
|
540 |
// Escaped value appropriate for use in a SQL query
|
541 |
global $pt_view_settings;
|
542 |
|
includes/html-viewtype.php
CHANGED
@@ -158,16 +158,19 @@ if ( ! class_exists( 'PT_CV_Html_ViewType' ) ) {
|
|
158 |
|
159 |
$scrollable_html[] = PT_CV_Html::inline_script( $js );
|
160 |
|
|
|
|
|
|
|
161 |
// Indicator html
|
162 |
-
$show_indicator = isset( $dargs['view-type-settings']['indicator'] ) ? $dargs['view-type-settings']['indicator'] :
|
163 |
-
$scrollable_html[] = self::scrollable_indicator( $show_indicator
|
164 |
|
165 |
// Content html
|
166 |
$scrollable_html[] = $scrollable_content;
|
167 |
|
168 |
// Control html
|
169 |
-
$show_navigation = isset( $dargs['view-type-settings']['navigation'] ) ? $dargs['view-type-settings']['navigation'] :
|
170 |
-
$scrollable_html[] = self::scrollable_control( $show_navigation
|
171 |
|
172 |
// Get wrapper class scrollable
|
173 |
$scrollable_class = apply_filters( PT_CV_PREFIX_ . 'scrollable_class', 'carousel slide' );
|
158 |
|
159 |
$scrollable_html[] = PT_CV_Html::inline_script( $js );
|
160 |
|
161 |
+
// Default value off setting options
|
162 |
+
$enable = apply_filters( PT_CV_PREFIX_ . 'scrollable_fields_enable', 1 );
|
163 |
+
|
164 |
// Indicator html
|
165 |
+
$show_indicator = isset( $dargs['view-type-settings']['indicator'] ) ? $dargs['view-type-settings']['indicator'] : $enable;
|
166 |
+
$scrollable_html[] = self::scrollable_indicator( $show_indicator, $wrapper_id, $count_slides );
|
167 |
|
168 |
// Content html
|
169 |
$scrollable_html[] = $scrollable_content;
|
170 |
|
171 |
// Control html
|
172 |
+
$show_navigation = isset( $dargs['view-type-settings']['navigation'] ) ? $dargs['view-type-settings']['navigation'] : $enable;
|
173 |
+
$scrollable_html[] = self::scrollable_control( $show_navigation, $wrapper_id, $count_slides );
|
174 |
|
175 |
// Get wrapper class scrollable
|
176 |
$scrollable_class = apply_filters( PT_CV_PREFIX_ . 'scrollable_class', 'carousel slide' );
|
includes/html.php
CHANGED
@@ -261,14 +261,23 @@ if ( ! class_exists( 'PT_CV_Html' ) ) {
|
|
261 |
* @return string Full HTML output for Content View
|
262 |
*/
|
263 |
static function content_items_wrap( $content_items, $current_page, $post_per_page, $id ) {
|
264 |
-
global $dargs;
|
265 |
|
266 |
if ( empty( $content_items ) ) {
|
267 |
return '';
|
268 |
}
|
269 |
|
270 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
271 |
|
|
|
|
|
272 |
$view_type = $dargs['view-type'];
|
273 |
|
274 |
// Separate items by row, column
|
@@ -324,9 +333,6 @@ if ( ! class_exists( 'PT_CV_Html' ) ) {
|
|
324 |
$html = $content_list;
|
325 |
}
|
326 |
|
327 |
-
$type = isset( $dargs['pagination-settings']['type'] ) ? $dargs['pagination-settings']['type'] : 'ajax';
|
328 |
-
$display = ( $type == 'ajax' && $current_page === 1 ) || $type == 'normal';
|
329 |
-
|
330 |
if ( $display ) {
|
331 |
// Get wrapper class of a view
|
332 |
$view_class = apply_filters( PT_CV_PREFIX_ . 'view_class', array( PT_CV_PREFIX . 'view', PT_CV_PREFIX . $view_type ) );
|
@@ -341,8 +347,6 @@ if ( ! class_exists( 'PT_CV_Html' ) ) {
|
|
341 |
$output = $html;
|
342 |
}
|
343 |
|
344 |
-
$before_output = $display ? apply_filters( PT_CV_PREFIX_ . 'before_output_html', '' ) : '';
|
345 |
-
|
346 |
return balanceTags( $before_output ) . balanceTags( $output );
|
347 |
}
|
348 |
|
@@ -506,11 +510,6 @@ if ( ! class_exists( 'PT_CV_Html' ) ) {
|
|
506 |
// Trim period which precedes dots
|
507 |
$content = str_replace( '.' . $dots, $dots, $content );
|
508 |
|
509 |
-
// Force balance tags & strip all shortcodes
|
510 |
-
$content = force_balance_tags( strip_shortcodes( $content ) );
|
511 |
-
|
512 |
-
$content = apply_filters( PT_CV_PREFIX_ . 'field_content_final', $content, $post );
|
513 |
-
|
514 |
break;
|
515 |
|
516 |
case 'full':
|
@@ -521,9 +520,11 @@ if ( ! class_exists( 'PT_CV_Html' ) ) {
|
|
521 |
break;
|
522 |
}
|
523 |
|
|
|
|
|
524 |
$html = rtrim( $content, '.' ) ? sprintf(
|
525 |
'<%1$s class="%2$s">%3$s</%1$s>',
|
526 |
-
$tag, esc_attr( $content_class ),
|
527 |
) : '';
|
528 |
|
529 |
return $html;
|
@@ -778,17 +779,17 @@ if ( ! class_exists( 'PT_CV_Html' ) ) {
|
|
778 |
* by merging css files to public/assets/css/public.css, js files to public/assets/js/public.js
|
779 |
*/
|
780 |
static function assets_of_view_types() {
|
781 |
-
global $
|
782 |
|
783 |
// If already processed | have no View on this page -> return
|
784 |
-
if ( ( $
|
785 |
return;
|
786 |
}
|
787 |
// Mark as processed
|
788 |
-
if ( ! $
|
789 |
-
$
|
790 |
}
|
791 |
-
$
|
792 |
|
793 |
// Get settings option
|
794 |
$options = get_option( PT_CV_OPTION_NAME );
|
261 |
* @return string Full HTML output for Content View
|
262 |
*/
|
263 |
static function content_items_wrap( $content_items, $current_page, $post_per_page, $id ) {
|
264 |
+
global $dargs, $pt_cv_content_items;
|
265 |
|
266 |
if ( empty( $content_items ) ) {
|
267 |
return '';
|
268 |
}
|
269 |
|
270 |
+
// Assign as global variable
|
271 |
+
$pt_cv_content_items = $content_items;
|
272 |
+
|
273 |
+
$type = isset( $dargs['pagination-settings']['type'] ) ? $dargs['pagination-settings']['type'] : 'ajax';
|
274 |
+
$display = ( $type == 'ajax' && $current_page === 1 ) || $type == 'normal';
|
275 |
+
|
276 |
+
// 1. Before output
|
277 |
+
$before_output = $display ? apply_filters( PT_CV_PREFIX_ . 'before_output_html', '' ) : '';
|
278 |
|
279 |
+
// 2. Output content
|
280 |
+
$content = array();
|
281 |
$view_type = $dargs['view-type'];
|
282 |
|
283 |
// Separate items by row, column
|
333 |
$html = $content_list;
|
334 |
}
|
335 |
|
|
|
|
|
|
|
336 |
if ( $display ) {
|
337 |
// Get wrapper class of a view
|
338 |
$view_class = apply_filters( PT_CV_PREFIX_ . 'view_class', array( PT_CV_PREFIX . 'view', PT_CV_PREFIX . $view_type ) );
|
347 |
$output = $html;
|
348 |
}
|
349 |
|
|
|
|
|
350 |
return balanceTags( $before_output ) . balanceTags( $output );
|
351 |
}
|
352 |
|
510 |
// Trim period which precedes dots
|
511 |
$content = str_replace( '.' . $dots, $dots, $content );
|
512 |
|
|
|
|
|
|
|
|
|
|
|
513 |
break;
|
514 |
|
515 |
case 'full':
|
520 |
break;
|
521 |
}
|
522 |
|
523 |
+
$content = apply_filters( PT_CV_PREFIX_ . 'field_content_final', $content, $post );
|
524 |
+
|
525 |
$html = rtrim( $content, '.' ) ? sprintf(
|
526 |
'<%1$s class="%2$s">%3$s</%1$s>',
|
527 |
+
$tag, esc_attr( $content_class ), force_balance_tags( $content )
|
528 |
) : '';
|
529 |
|
530 |
return $html;
|
779 |
* by merging css files to public/assets/css/public.css, js files to public/assets/js/public.js
|
780 |
*/
|
781 |
static function assets_of_view_types() {
|
782 |
+
global $processed_view_assets, $pt_view_sid;
|
783 |
|
784 |
// If already processed | have no View on this page -> return
|
785 |
+
if ( ( $processed_view_assets && isset( $processed_view_assets[$pt_view_sid] ) ) || ! $pt_view_sid ) {
|
786 |
return;
|
787 |
}
|
788 |
// Mark as processed
|
789 |
+
if ( ! $processed_view_assets ) {
|
790 |
+
$processed_view_assets = array();
|
791 |
}
|
792 |
+
$processed_view_assets[$pt_view_sid] = 1;
|
793 |
|
794 |
// Get settings option
|
795 |
$options = get_option( PT_CV_OPTION_NAME );
|
public/assets/css/public.css
CHANGED
@@ -23,7 +23,6 @@
|
|
23 |
/* Common */
|
24 |
.pt-cv-view {
|
25 |
position: relative;
|
26 |
-
/*margin-bottom: 30px;*/
|
27 |
clear: both;
|
28 |
}
|
29 |
|
@@ -35,16 +34,16 @@
|
|
35 |
clear: left;
|
36 |
}
|
37 |
|
|
|
|
|
|
|
|
|
38 |
/* Link */
|
39 |
.pt-cv-view a {
|
40 |
text-decoration: none !important;
|
41 |
outline: 0 !important;
|
42 |
}
|
43 |
|
44 |
-
.pt-cv-view a:hover, .pt-cv-view .panel-heading:hover a {
|
45 |
-
/*color: #ff3c1f;*/
|
46 |
-
}
|
47 |
-
|
48 |
/* Read more */
|
49 |
.pt-cv-readmore {
|
50 |
color: #fff;
|
@@ -71,7 +70,7 @@
|
|
71 |
/* Title */
|
72 |
.pt-cv-title {
|
73 |
margin-top: 0 !important;
|
74 |
-
font-size:
|
75 |
}
|
76 |
|
77 |
.pt-cv-title a {
|
23 |
/* Common */
|
24 |
.pt-cv-view {
|
25 |
position: relative;
|
|
|
26 |
clear: both;
|
27 |
}
|
28 |
|
34 |
clear: left;
|
35 |
}
|
36 |
|
37 |
+
.pt-cv-view strong, .pt-cv-view strong * {
|
38 |
+
font-weight: 600 !important;
|
39 |
+
}
|
40 |
+
|
41 |
/* Link */
|
42 |
.pt-cv-view a {
|
43 |
text-decoration: none !important;
|
44 |
outline: 0 !important;
|
45 |
}
|
46 |
|
|
|
|
|
|
|
|
|
47 |
/* Read more */
|
48 |
.pt-cv-readmore {
|
49 |
color: #fff;
|
70 |
/* Title */
|
71 |
.pt-cv-title {
|
72 |
margin-top: 0 !important;
|
73 |
+
font-size: 18px;
|
74 |
}
|
75 |
|
76 |
.pt-cv-title a {
|
public/assets/js/public.js
CHANGED
@@ -33,7 +33,7 @@
|
|
33 |
* @returns {undefined}
|
34 |
*/
|
35 |
move_bootstrap_to_top: function () {
|
36 |
-
if ( PT_CV_PUBLIC.move_bootstrap === 0 ) {
|
37 |
return;
|
38 |
}
|
39 |
|
33 |
* @returns {undefined}
|
34 |
*/
|
35 |
move_bootstrap_to_top: function () {
|
36 |
+
if ( PT_CV_PUBLIC.move_bootstrap === '0' ) {
|
37 |
return;
|
38 |
}
|
39 |
|
public/content-views.php
CHANGED
@@ -325,11 +325,11 @@ class PT_Content_Views {
|
|
325 |
/**
|
326 |
* Init global variables
|
327 |
*
|
328 |
-
* @global type $
|
329 |
*/
|
330 |
public function init_global_variables() {
|
331 |
-
global $
|
332 |
-
$
|
333 |
}
|
334 |
|
335 |
}
|
325 |
/**
|
326 |
* Init global variables
|
327 |
*
|
328 |
+
* @global type $processed_view_assets
|
329 |
*/
|
330 |
public function init_global_variables() {
|
331 |
+
global $processed_view_assets, $processed_views;
|
332 |
+
$processed_view_assets = $processed_views = array();
|
333 |
}
|
334 |
|
335 |
}
|
public/templates/readme.txt
DELETED
@@ -1,19 +0,0 @@
|
|
1 |
-
|
2 |
-
== Description ==
|
3 |
-
This folder contains HTML output of View types:
|
4 |
-
Grid
|
5 |
-
Collapsible List
|
6 |
-
Tab
|
7 |
-
...
|
8 |
-
|
9 |
-
Folder structure:
|
10 |
-
name_of_view_type
|
11 |
-
html
|
12 |
-
main.php : HTML layout - Style 1
|
13 |
-
style2.php : HTML layout - Style 2
|
14 |
-
css
|
15 |
-
main.css : stylesheet - Style 1
|
16 |
-
style2.css : stylesheet - Style 2
|
17 |
-
js
|
18 |
-
main.js : script - Style 1
|
19 |
-
script2.js : script - Style 2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|