Version Description
- Improvement: More elegant UI for Fields settings
- Improvement: Performance improvement by merging filers
- Improvement: Support HTML tags in excerpt better: get correct excerpt length, get text/content of allowed tags
- Bug fixed: Slug of term on Non-Latin languages does not show correctly
- Bug fixed: Fix Javascript error "Uncaught query function not defined for Select2 undefined"
- Update: Add filter "terms_include_this" to exclude terms from meta-fields output
- Update: CSS improvements
Download this release
Release Info
Developer | PT Guy |
Plugin | Content Views – Post Grid & List for WordPress |
Version | 1.6.8 |
Comparing to | |
See all releases |
Code changes from version 1.6.7 to 1.6.8
- README.txt +73 -52
- admin/assets/css/admin.css +55 -6
- admin/assets/js/admin.js +1 -1
- admin/includes/options.php +8 -3
- admin/views/view.php +4 -4
- content-views.php +2 -2
- includes/functions.php +84 -27
- includes/html-viewtype.php +2 -5
- includes/html.php +13 -15
- includes/settings.php +16 -9
- includes/values.php +1 -1
- public/assets/css/public.css +5 -0
- public/content-views.php +3 -1
README.txt
CHANGED
@@ -1,86 +1,74 @@
|
|
1 |
-
===
|
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.3.1
|
7 |
-
Stable tag: 1.6.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
11 |
-
It is easy as
|
12 |
|
13 |
== Description ==
|
14 |
|
15 |
-
Do you want to display posts
|
16 |
|
17 |
Or:
|
18 |
|
19 |
-
* display posts
|
20 |
-
* display posts in
|
21 |
-
* display posts
|
22 |
-
* display posts by a specific tag
|
23 |
-
* display posts by an author
|
24 |
-
* display posts in descending order of Title
|
25 |
-
* replace boring Next, Prev button of WordPress theme by a beautiful pagination
|
26 |
* display thumbnail in different size than 150x150 or 300x300
|
27 |
|
28 |
-
With **Content Views
|
29 |
|
30 |
-
[
|
|
|
|
|
31 |
|
32 |
-
|
|
|
|
|
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:
|
35 |
|
36 |
-
|
37 |
-
* Step 2 : Customize output (select a layout from 3 responsive layout, show title/content/excerpt/pagination ? ...)
|
38 |
-
* Step 3 : Save View then paste the generated shortcode **[pt_view id="VIEW_ID"]** to editor of page/Text widget where you want to display your posts. If you are a developer, you can paste `<?php echo do_shortcode('[pt_view id="VIEW_ID"]'); ?>` to file in WordPress theme
|
39 |
|
40 |
|
41 |
-
=
|
42 |
|
43 |
**in Step 1:**
|
44 |
|
45 |
-
* query
|
46 |
-
* query posts by category, tag, author
|
47 |
* query child pages of a parent page
|
48 |
-
*
|
49 |
-
*
|
50 |
-
*
|
51 |
|
52 |
**in Step 2:**
|
53 |
|
54 |
-
*
|
55 |
-
*
|
56 |
-
*
|
57 |
-
*
|
58 |
-
*
|
59 |
-
*
|
60 |
-
*
|
61 |
-
*
|
62 |
-
*
|
63 |
-
|
64 |
-
|
65 |
-
=
|
66 |
-
|
67 |
-
* More amazing layouts: **Pinterest, Timeline
|
68 |
-
*
|
69 |
-
*
|
70 |
-
* Display **
|
71 |
-
*
|
72 |
-
* **
|
73 |
-
* Customize **Font, Color** settings of Title, Content, Meta fields
|
74 |
-
* Custom **style of Thumbnail**: round, circle, border
|
75 |
-
* Customize style & text of **Read more** button
|
76 |
-
* Ajax **Load more** pagination
|
77 |
* And much more...
|
78 |
|
79 |
-
|
80 |
-
|
81 |
-
Just give a try (30 day money back guarantee), then you will know how it is awesome :)
|
82 |
-
|
83 |
-
|
84 |
|
85 |
== Installation ==
|
86 |
|
@@ -138,6 +126,27 @@ You can create Unlimited Views, in Unlimited websites
|
|
138 |
If you are using a static page as homepage, you should add View shortcode to editor of that page.
|
139 |
If you are using a dynamic page (you created a 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
|
@@ -165,6 +174,16 @@ function my_move_bootstrap( $args ) {
|
|
165 |
|
166 |
== Changelog ==
|
167 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
168 |
= 1.6.7 =
|
169 |
* Bug fixed: Missing section in some one-page themes when put multiple View shortcodes to sections
|
170 |
* Update: Revert filter "view_type_dir"
|
@@ -450,3 +469,5 @@ function my_move_bootstrap( $args ) {
|
|
450 |
|
451 |
== Upgrade Notice ==
|
452 |
|
|
|
|
1 |
+
=== Display posts 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.3.1
|
7 |
+
Stable tag: 1.6.8
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
11 |
+
It is easy as ABC to query posts by category, tag, author... and display posts on any page in responsive Grid layout without coding!
|
12 |
|
13 |
== Description ==
|
14 |
|
15 |
+
Do you want to display posts on any WordPress page in responsive, customizable Grid layout?
|
16 |
|
17 |
Or:
|
18 |
|
19 |
+
* display posts by category, tag, author, keyword
|
20 |
+
* display posts in order of title, date, ID
|
21 |
+
* display posts with nice pagination
|
|
|
|
|
|
|
|
|
22 |
* display thumbnail in different size than 150x150 or 300x300
|
23 |
|
24 |
+
With **Content Views**, you can do above things in minutes, without any line of code!
|
25 |
|
26 |
+
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 more than you expect!
|
27 |
+
|
28 |
+
**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 3 simple steps:
|
29 |
|
30 |
+
* Step 1 : Query your posts by category, tag, author...
|
31 |
+
* Step 2 : Select a layout to display your posts. You can select what fields (title, content/excerpt, thumbnail, meta fields) to display, too.
|
32 |
+
* Step 3 : Paste shortcode **[pt_view id="VIEW_ID"]** to content of page, widget where you want to display your posts. Or you can paste `<?php echo do_shortcode('[pt_view id="VIEW_ID"]'); ?>` to WordPress theme file.
|
33 |
|
|
|
34 |
|
35 |
+
[youtube https://www.youtube.com/watch?v=drxqtCiaw4I]
|
|
|
|
|
36 |
|
37 |
|
38 |
+
= With Content Views plugin, you can: =
|
39 |
|
40 |
**in Step 1:**
|
41 |
|
42 |
+
* query any posts by IDs, category, tag, author, keyword, status
|
|
|
43 |
* query child pages of a parent page
|
44 |
+
* include/exclude posts to display
|
45 |
+
* sort posts by Id, Title, Date in ascending, descending order
|
46 |
+
* limit number of posts to display
|
47 |
|
48 |
**in Step 2:**
|
49 |
|
50 |
+
* select a responsive layout to display posts: Grid, Scrollable list, Collapsible list
|
51 |
+
* select number of columns in Grid layout
|
52 |
+
* display fields (thumbnail, title, content, meta fields) in vertical direction. Or display thumbnail in left/right side of other fields
|
53 |
+
* select what above fields to display
|
54 |
+
* select thumbnail sizes
|
55 |
+
* display full content, or display excerpt with specific number of words
|
56 |
+
* select what meta-fields (date, author, categories/tags, comment count) to display
|
57 |
+
* enable/disable pagination
|
58 |
+
* open in new tab, current tab (when click on post title, thumbnail)
|
59 |
+
|
60 |
+
|
61 |
+
= With Content Views Pro, you have: =
|
62 |
+
|
63 |
+
* More amazing layouts: **Pinterest, Facebook Timeline, Masonry**...
|
64 |
+
* **Replace WordPress layout** in Category page, Search result page, Archive page... by amazing & customizable layout
|
65 |
+
* **Drag & drop** to change display order of thumbnail, title, content, meta fields
|
66 |
+
* Display any custom posts (**WooCommerce product, EDD** ...) in beautiful output
|
67 |
+
* Customize **font, color, style** of title, content, read-more button...
|
68 |
+
* **Load more, Infinite scroll** pagination
|
|
|
|
|
|
|
|
|
69 |
* And much more...
|
70 |
|
71 |
+
[Get Content Views Pro](http://www.contentviewspro.com/?utm_source=wordpress&utm_medium=plugin&utm_campaign=content-views "Get Content Views Pro").
|
|
|
|
|
|
|
|
|
72 |
|
73 |
== Installation ==
|
74 |
|
126 |
If you are using a static page as homepage, you should add View shortcode to editor of that page.
|
127 |
If you are using a dynamic page (you created a 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.
|
128 |
|
129 |
+
= session_start() error =
|
130 |
+
|
131 |
+
Please add this code to file **functions.php** of your theme
|
132 |
+
`
|
133 |
+
// CVPro - Fix Session error
|
134 |
+
add_action( 'pt_cv_session_start', 'my_session_start' );
|
135 |
+
|
136 |
+
function my_session_start() {
|
137 |
+
// Get default path to save session
|
138 |
+
$session_save_path = ini_get( 'session.save_path' );
|
139 |
+
if ( empty( $session_save_path ) ) {
|
140 |
+
$session_save_path = "/tmp";
|
141 |
+
session_save_path( $session_save_path );
|
142 |
+
}
|
143 |
+
// Create it if not exist
|
144 |
+
if ( !file_exists( $session_save_path ) ) {
|
145 |
+
mkdir( $session_save_path, 0755, true );
|
146 |
+
}
|
147 |
+
}
|
148 |
+
`
|
149 |
+
|
150 |
= [BUG] When I use Cache plugin (W3TC, WP-Super-Cache...), the grid columns does not work. How to fix it? =
|
151 |
|
152 |
Please add this code to file **functions.php** of your theme
|
174 |
|
175 |
== Changelog ==
|
176 |
|
177 |
+
= 1.6.8 =
|
178 |
+
* Improvement: More elegant UI for Fields settings
|
179 |
+
* Improvement: Performance improvement by merging filers
|
180 |
+
* Improvement: Support HTML tags in excerpt better: get correct excerpt length, get text/content of allowed tags
|
181 |
+
* Bug fixed: Slug of term on Non-Latin languages does not show correctly
|
182 |
+
* Bug fixed: Fix Javascript error "Uncaught query function not defined for Select2 undefined"
|
183 |
+
* Update: Add filter "terms_include_this" to exclude terms from meta-fields output
|
184 |
+
* Update: CSS improvements
|
185 |
+
|
186 |
+
|
187 |
= 1.6.7 =
|
188 |
* Bug fixed: Missing section in some one-page themes when put multiple View shortcodes to sections
|
189 |
* Update: Revert filter "view_type_dir"
|
469 |
|
470 |
== Upgrade Notice ==
|
471 |
|
472 |
+
= 1.6.8 =
|
473 |
+
Major update with lot of improvements
|
admin/assets/css/admin.css
CHANGED
@@ -222,11 +222,6 @@ html {
|
|
222 |
background: #FFF9D7;
|
223 |
}
|
224 |
|
225 |
-
/* Custom css for Settings Group/Option */
|
226 |
-
#pt-cv-group-excerpt-settings {
|
227 |
-
margin-bottom: 20px;
|
228 |
-
}
|
229 |
-
|
230 |
/* View shortcode text */
|
231 |
#view-shortcode {
|
232 |
background: #ADFFAD;
|
@@ -235,4 +230,58 @@ html {
|
|
235 |
float: left;
|
236 |
position: relative;
|
237 |
width: 50%;
|
238 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
222 |
background: #FFF9D7;
|
223 |
}
|
224 |
|
|
|
|
|
|
|
|
|
|
|
225 |
/* View shortcode text */
|
226 |
#view-shortcode {
|
227 |
background: #ADFFAD;
|
230 |
float: left;
|
231 |
position: relative;
|
232 |
width: 50%;
|
233 |
+
}
|
234 |
+
|
235 |
+
/*** Fields settings ***/
|
236 |
+
.pt-cv-field-setting {
|
237 |
+
margin-left: 0 !important;
|
238 |
+
}
|
239 |
+
|
240 |
+
.pt-cv-content-setting {
|
241 |
+
padding-bottom: 10px;
|
242 |
+
z-index: 1;
|
243 |
+
}
|
244 |
+
|
245 |
+
.pt-cv-excerpt-setting {
|
246 |
+
margin-top: -12px;
|
247 |
+
padding-top: 0;
|
248 |
+
z-index: 100;
|
249 |
+
position: relative;
|
250 |
+
}
|
251 |
+
|
252 |
+
.pt-cv-field-setting:not(.hidden) > .pt-params {
|
253 |
+
width: 100% !important;
|
254 |
+
border: 1px solid #ececec;
|
255 |
+
padding-top: 10px;
|
256 |
+
}
|
257 |
+
|
258 |
+
#pt-cv-group-field-settings > .form-group > .control-label {
|
259 |
+
font-weight: bold;
|
260 |
+
display: inline;
|
261 |
+
width: 100%;
|
262 |
+
padding-bottom: 7px;
|
263 |
+
color: #fff;
|
264 |
+
background-color: #428bca;
|
265 |
+
}
|
266 |
+
|
267 |
+
.pt-cv-content-setting > .pt-params,
|
268 |
+
.pt-cv-metafield-setting > .pt-params {
|
269 |
+
padding-top: 0 !important;
|
270 |
+
padding-bottom: 10px;
|
271 |
+
}
|
272 |
+
|
273 |
+
/* Append group */
|
274 |
+
.pt-cv-excerpt-setting > .pt-params {
|
275 |
+
border-top: none !important;
|
276 |
+
margin-top: -20px !important;
|
277 |
+
}
|
278 |
+
|
279 |
+
.pt-cv-excerpt-setting > .pt-params > .pt-form-group {
|
280 |
+
background: #fff;
|
281 |
+
}
|
282 |
+
|
283 |
+
.pt-cv-excerpt-setting > label {
|
284 |
+
display: none !important;
|
285 |
+
}
|
286 |
+
/* End Append group */
|
287 |
+
|
admin/assets/js/admin.js
CHANGED
@@ -634,7 +634,7 @@
|
|
634 |
$self._thumbnail_settings();
|
635 |
|
636 |
// Select 2
|
637 |
-
$( '.' + _prefix + 'select2' ).select2();
|
638 |
|
639 |
// Change class of panel inside panel
|
640 |
$( '.' + _prefix + 'group .panel .panel' ).each( function () {
|
634 |
$self._thumbnail_settings();
|
635 |
|
636 |
// Select 2
|
637 |
+
$( 'select.' + _prefix + 'select2' ).select2();
|
638 |
|
639 |
// Change class of panel inside panel
|
640 |
$( '.' + _prefix + 'group .panel .panel' ).each( function () {
|
admin/includes/options.php
CHANGED
@@ -104,10 +104,11 @@ if ( !class_exists( 'PT_Options_Framework' ) ) {
|
|
104 |
$label = self::label( $group[ 'label' ], $extra_setting );
|
105 |
$params = self::params( $group[ 'params' ], $data, $extra_setting );
|
106 |
$random_id = self::_dependence_check( $group, $dependence_ );
|
107 |
-
$id =
|
|
|
108 |
if ( $random_id ) {
|
109 |
-
$id
|
110 |
-
$class
|
111 |
}
|
112 |
|
113 |
return "<div class='form-group pt-form-group $class' $id>$label $params</div>";
|
@@ -306,6 +307,10 @@ if ( !class_exists( 'PT_Options_Framework' ) ) {
|
|
306 |
$description = apply_filters( PT_CV_PREFIX_ . 'options_description', $description, $param );
|
307 |
|
308 |
if ( !empty( $description ) ) {
|
|
|
|
|
|
|
|
|
309 |
$html .= "<p class='text-muted'>$description</p>";
|
310 |
}
|
311 |
|
104 |
$label = self::label( $group[ 'label' ], $extra_setting );
|
105 |
$params = self::params( $group[ 'params' ], $data, $extra_setting );
|
106 |
$random_id = self::_dependence_check( $group, $dependence_ );
|
107 |
+
$id = '';
|
108 |
+
$class = isset( $extra_setting[ 'params' ][ 'group-class' ] ) ? $extra_setting[ 'params' ][ 'group-class' ] : '';
|
109 |
if ( $random_id ) {
|
110 |
+
$id = "id='$random_id'";
|
111 |
+
$class .= ' hidden';
|
112 |
}
|
113 |
|
114 |
return "<div class='form-group pt-form-group $class' $id>$label $params</div>";
|
307 |
$description = apply_filters( PT_CV_PREFIX_ . 'options_description', $description, $param );
|
308 |
|
309 |
if ( !empty( $description ) ) {
|
310 |
+
// Append dot to end of description
|
311 |
+
if ( trim( strip_tags( $description ) ) != '' && substr( $description, -1 ) != '?' ) {
|
312 |
+
$description .= '.';
|
313 |
+
}
|
314 |
$html .= "<p class='text-muted'>$description</p>";
|
315 |
}
|
316 |
|
admin/views/view.php
CHANGED
@@ -189,7 +189,7 @@ PT_CV_Functions::view_submit();
|
|
189 |
'type' => 'text',
|
190 |
'name' => 'post__in',
|
191 |
'std' => '',
|
192 |
-
'desc' => __( 'List of post ids to retrieve (comma-separated values, e.g. 1,2,3)
|
193 |
),
|
194 |
),
|
195 |
),
|
@@ -355,7 +355,7 @@ PT_CV_Functions::view_submit();
|
|
355 |
'options' => PT_CV_Values::taxonomy_relation(),
|
356 |
'std' => PT_CV_Functions::array_get_first_key( PT_CV_Values::taxonomy_relation() ),
|
357 |
'class' => 'taxonomy-relation',
|
358 |
-
'desc' => __( 'Select AND to show posts which match ALL settings of selected taxonomies
|
359 |
),
|
360 |
),
|
361 |
),
|
@@ -447,7 +447,7 @@ PT_CV_Functions::view_submit();
|
|
447 |
'type' => 'text',
|
448 |
'name' => 's',
|
449 |
'std' => '',
|
450 |
-
'desc' => __( 'Enter the keyword to searching for posts', PT_CV_DOMAIN ) . apply_filters( PT_CV_PREFIX_ . 'searchby_keyword_desc', '' ),
|
451 |
),
|
452 |
),
|
453 |
),
|
@@ -470,7 +470,7 @@ PT_CV_Functions::view_submit();
|
|
470 |
// View Type
|
471 |
array(
|
472 |
'label' => array(
|
473 |
-
'text' => __( 'View type', PT_CV_DOMAIN ),
|
474 |
),
|
475 |
'params' => array(
|
476 |
array(
|
189 |
'type' => 'text',
|
190 |
'name' => 'post__in',
|
191 |
'std' => '',
|
192 |
+
'desc' => __( 'List of post ids to retrieve (comma-separated values, e.g. 1,2,3).<br>A post is displayed only if its ID is equal to any of the values IN this list', PT_CV_DOMAIN ),
|
193 |
),
|
194 |
),
|
195 |
),
|
355 |
'options' => PT_CV_Values::taxonomy_relation(),
|
356 |
'std' => PT_CV_Functions::array_get_first_key( PT_CV_Values::taxonomy_relation() ),
|
357 |
'class' => 'taxonomy-relation',
|
358 |
+
'desc' => __( 'Select AND to show posts which match ALL settings of selected taxonomies.<br>Select OR to show posts which match settings of at least one selected taxonomy', PT_CV_DOMAIN ),
|
359 |
),
|
360 |
),
|
361 |
),
|
447 |
'type' => 'text',
|
448 |
'name' => 's',
|
449 |
'std' => '',
|
450 |
+
'desc' => __( 'Enter the keyword to searching for posts.', PT_CV_DOMAIN ) . apply_filters( PT_CV_PREFIX_ . 'searchby_keyword_desc', '' ),
|
451 |
),
|
452 |
),
|
453 |
),
|
470 |
// View Type
|
471 |
array(
|
472 |
'label' => array(
|
473 |
+
'text' => __( 'View type (Layout)', PT_CV_DOMAIN ),
|
474 |
),
|
475 |
'params' => array(
|
476 |
array(
|
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.8
|
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.8' );
|
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
@@ -116,8 +116,7 @@ if ( !class_exists( 'PT_CV_Functions' ) ) {
|
|
116 |
* @param string $sub_page Slug of sub menu
|
117 |
* @param string $class Class name which contains function to output content of page created by this menu
|
118 |
*/
|
119 |
-
static function menu_add_sub( $parent_slug, $page_title, $menu_title,
|
120 |
-
$user_role, $sub_page, $class ) {
|
121 |
return add_submenu_page(
|
122 |
$parent_slug, $page_title, $menu_title, $user_role, $parent_slug . '-' . $sub_page, array( $class, 'display_sub_page_' . $sub_page )
|
123 |
);
|
@@ -238,13 +237,53 @@ if ( !class_exists( 'PT_CV_Functions' ) ) {
|
|
238 |
// Strip HTML tags
|
239 |
$result = self::pt_strip_tags( $text );
|
240 |
|
241 |
-
|
242 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
243 |
|
244 |
-
//
|
245 |
-
|
246 |
-
|
247 |
-
$result =
|
248 |
}
|
249 |
|
250 |
return $result;
|
@@ -258,21 +297,18 @@ if ( !class_exists( 'PT_CV_Functions' ) ) {
|
|
258 |
* @return string
|
259 |
*/
|
260 |
static function pt_strip_tags( $string ) {
|
|
|
261 |
$string = preg_replace( '@<(script|style)[^>]*?>.*?</\\1>@si', '', $string );
|
262 |
|
263 |
-
#
|
|
|
264 |
|
|
|
265 |
$dargs = PT_CV_Functions::get_global_variable( 'dargs' );
|
266 |
-
# predefined allowable HTML tags
|
267 |
-
$allowable_tags = (array) apply_filters( PT_CV_PREFIX_ . 'allowable_tags', array( '<a>', '<br>', '<strong>', '<em>', '<strike>', '<i>', '<ul>', '<ol>', '<li>' ) );
|
268 |
$allowed_tags = '';
|
269 |
-
if (
|
270 |
-
$
|
271 |
-
|
272 |
-
// Changes double line-breaks in the text into HTML paragraphs (<p>, <br>)
|
273 |
-
if ( apply_filters( PT_CV_PREFIX_ . 'wpautop', 0 ) ) {
|
274 |
-
$string = wpautop( $string );
|
275 |
-
}
|
276 |
}
|
277 |
|
278 |
$string = strip_tags( $string, $allowed_tags );
|
@@ -280,6 +316,20 @@ if ( !class_exists( 'PT_CV_Functions' ) ) {
|
|
280 |
return trim( $string );
|
281 |
}
|
282 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
283 |
/**
|
284 |
* Get thumbnail dimensions
|
285 |
*
|
@@ -312,8 +362,7 @@ if ( !class_exists( 'PT_CV_Functions' ) ) {
|
|
312 |
* @param array $array_to_get Array to get values of wanted setting fields
|
313 |
* @param string $prefix Prefix string to looking for fields in $array_to_get
|
314 |
*/
|
315 |
-
static function settings_values( $fields, &$array_to_save, $array_to_get,
|
316 |
-
$prefix ) {
|
317 |
foreach ( $fields as $tsetting ) {
|
318 |
$array_to_save[ $tsetting ] = PT_CV_Functions::setting_value( $prefix . $tsetting, $array_to_get );
|
319 |
}
|
@@ -397,14 +446,18 @@ if ( !class_exists( 'PT_CV_Functions' ) ) {
|
|
397 |
$terms = wp_get_object_terms( $post_id, $taxonomies );
|
398 |
|
399 |
foreach ( $terms as $term ) {
|
400 |
-
$
|
401 |
-
|
402 |
-
|
|
|
|
|
|
|
403 |
|
|
|
404 |
if ( !isset( $pt_cv_glb[ 'item_terms' ][ $post_id ] ) ) {
|
405 |
$pt_cv_glb[ 'item_terms' ][ $post_id ] = array();
|
406 |
}
|
407 |
-
$pt_cv_glb[ 'item_terms' ][ $post_id ][ $term->slug ] = $term->name;
|
408 |
}
|
409 |
|
410 |
// Adjust terms list
|
@@ -545,7 +598,12 @@ if ( !class_exists( 'PT_CV_Functions' ) ) {
|
|
545 |
/* Backward compatibility
|
546 |
* since 1.3.2
|
547 |
*/
|
548 |
-
|
|
|
|
|
|
|
|
|
|
|
549 |
|
550 |
return is_array( $view_settings ) ? $view_settings : array();
|
551 |
}
|
@@ -1390,8 +1448,7 @@ if ( !class_exists( 'PT_CV_Functions' ) ) {
|
|
1390 |
* @param int $current_page Current page number
|
1391 |
* @param int $pages_to_show Number of page to show
|
1392 |
*/
|
1393 |
-
static function pagination( $total_pages, $current_page = 1,
|
1394 |
-
$pages_to_show = 4 ) {
|
1395 |
if ( $total_pages == 1 )
|
1396 |
return '';
|
1397 |
|
116 |
* @param string $sub_page Slug of sub menu
|
117 |
* @param string $class Class name which contains function to output content of page created by this menu
|
118 |
*/
|
119 |
+
static function menu_add_sub( $parent_slug, $page_title, $menu_title, $user_role, $sub_page, $class ) {
|
|
|
120 |
return add_submenu_page(
|
121 |
$parent_slug, $page_title, $menu_title, $user_role, $parent_slug . '-' . $sub_page, array( $class, 'display_sub_page_' . $sub_page )
|
122 |
);
|
237 |
// Strip HTML tags
|
238 |
$result = self::pt_strip_tags( $text );
|
239 |
|
240 |
+
return self::trim_words( $result, $num_words );
|
241 |
+
}
|
242 |
+
|
243 |
+
/**
|
244 |
+
* Trim string by words length, but keep content/text of HTML tags
|
245 |
+
*
|
246 |
+
* @param string $result
|
247 |
+
* @param int $num_words
|
248 |
+
* @return string
|
249 |
+
*/
|
250 |
+
static function trim_words( $result, $num_words ) {
|
251 |
+
// Skip HTML tag name & properties, don't skip tag text
|
252 |
+
$text_result = preg_split( '/<[a-z\/]+[^>]+>/', $result, NULL, PREG_SPLIT_OFFSET_CAPTURE );
|
253 |
+
$words_length = $split_index = 0;
|
254 |
+
foreach ( $text_result as $part ) {
|
255 |
+
$substr = isset( $part[ 0 ] ) ? $part[ 0 ] : '';
|
256 |
+
$substr_index = isset( $part[ 1 ] ) ? $part[ 1 ] : 0;
|
257 |
+
if ( !empty( $substr ) ) {
|
258 |
+
$words_in_str = str_word_count( $substr, 2 );
|
259 |
+
$words_length += count( $words_in_str );
|
260 |
+
|
261 |
+
if ( $words_length > $num_words ) {
|
262 |
+
$words_count_to_get = count( $words_in_str ) - ($words_length - $num_words);
|
263 |
+
if ( $words_count_to_get ) {
|
264 |
+
$words_to_get = array_slice( $words_in_str, 0, $words_count_to_get, true );
|
265 |
+
end( $words_to_get );
|
266 |
+
$last_word_idx = key( $words_to_get );
|
267 |
+
$split_index = $substr_index + $last_word_idx + strlen( $words_to_get[ $last_word_idx ] ) + 1;
|
268 |
+
} else {
|
269 |
+
$split_index = $substr_index;
|
270 |
+
}
|
271 |
+
|
272 |
+
break;
|
273 |
+
}
|
274 |
+
}
|
275 |
+
}
|
276 |
+
|
277 |
+
if ( $split_index > 0 ) {
|
278 |
+
$result = substr( $result, 0, $split_index );
|
279 |
+
// Remove start of HTML tag at end of string
|
280 |
+
$result = preg_replace( '/<[a-z\/]+[^>]+>$/', '', $result );
|
281 |
+
}
|
282 |
|
283 |
+
// Changes double line-breaks in the text into HTML paragraphs (<p>, <br>)
|
284 |
+
$dargs = PT_CV_Functions::get_global_variable( 'dargs' );
|
285 |
+
if ( !empty( $dargs[ 'field-settings' ][ 'content' ][ 'allow_html' ] ) || apply_filters( PT_CV_PREFIX_ . 'wpautop', 0 ) ) {
|
286 |
+
$result = wpautop( $result );
|
287 |
}
|
288 |
|
289 |
return $result;
|
297 |
* @return string
|
298 |
*/
|
299 |
static function pt_strip_tags( $string ) {
|
300 |
+
# Remove script, style tags
|
301 |
$string = preg_replace( '@<(script|style)[^>]*?>.*?</\\1>@si', '', $string );
|
302 |
|
303 |
+
# Remove language tag of qTranslateX 3.4.4
|
304 |
+
$string = preg_replace( '/\[:[a-z]{0,2}\]/', '', $string );
|
305 |
|
306 |
+
# Predefined allowable HTML tags
|
307 |
$dargs = PT_CV_Functions::get_global_variable( 'dargs' );
|
|
|
|
|
308 |
$allowed_tags = '';
|
309 |
+
if ( !empty( $dargs[ 'field-settings' ][ 'content' ][ 'allow_html' ] ) ) {
|
310 |
+
$allowable_tags = (array) apply_filters( PT_CV_PREFIX_ . 'allowable_tags', array( '<a>', '<br>', '<strong>', '<em>', '<strike>', '<i>', '<ul>', '<ol>', '<li>' ) );
|
311 |
+
$allowed_tags = implode( '', $allowable_tags );
|
|
|
|
|
|
|
|
|
312 |
}
|
313 |
|
314 |
$string = strip_tags( $string, $allowed_tags );
|
316 |
return trim( $string );
|
317 |
}
|
318 |
|
319 |
+
/**
|
320 |
+
* Handle slug of non-latin languages
|
321 |
+
*
|
322 |
+
* @param string $slug
|
323 |
+
* @return string
|
324 |
+
*/
|
325 |
+
static function term_slug_sanitize( $slug ) {
|
326 |
+
if ( preg_match( '/%[0-9a-f][0-9a-f]/', $slug ) ) {
|
327 |
+
$slug = str_replace( '%', '', $slug );
|
328 |
+
}
|
329 |
+
|
330 |
+
return $slug;
|
331 |
+
}
|
332 |
+
|
333 |
/**
|
334 |
* Get thumbnail dimensions
|
335 |
*
|
362 |
* @param array $array_to_get Array to get values of wanted setting fields
|
363 |
* @param string $prefix Prefix string to looking for fields in $array_to_get
|
364 |
*/
|
365 |
+
static function settings_values( $fields, &$array_to_save, $array_to_get, $prefix ) {
|
|
|
366 |
foreach ( $fields as $tsetting ) {
|
367 |
$array_to_save[ $tsetting ] = PT_CV_Functions::setting_value( $prefix . $tsetting, $array_to_get );
|
368 |
}
|
446 |
$terms = wp_get_object_terms( $post_id, $taxonomies );
|
447 |
|
448 |
foreach ( $terms as $term ) {
|
449 |
+
$include_this = apply_filters( PT_CV_PREFIX_ . 'terms_include_this', true, $term );
|
450 |
+
if ( $include_this ) {
|
451 |
+
$links[] = sprintf(
|
452 |
+
'<a href="%1$s" title="%2$s %3$s" class="%4$s">%3$s</a>', esc_url( get_term_link( $term, $term->taxonomy ) ), __( 'View all posts in', PT_CV_DOMAIN ), $term->name, PT_CV_PREFIX . 'tax-' . PT_CV_Functions::term_slug_sanitize( $term->slug )
|
453 |
+
);
|
454 |
+
}
|
455 |
|
456 |
+
// Add this term to terms list of an item
|
457 |
if ( !isset( $pt_cv_glb[ 'item_terms' ][ $post_id ] ) ) {
|
458 |
$pt_cv_glb[ 'item_terms' ][ $post_id ] = array();
|
459 |
}
|
460 |
+
$pt_cv_glb[ 'item_terms' ][ $post_id ][ PT_CV_Functions::term_slug_sanitize( $term->slug ) ] = $term->name;
|
461 |
}
|
462 |
|
463 |
// Adjust terms list
|
598 |
/* Backward compatibility
|
599 |
* since 1.3.2
|
600 |
*/
|
601 |
+
$trans_name = PT_CV_PREFIX . 'compatible-' . $post_id;
|
602 |
+
$trans = get_transient( $trans_name );
|
603 |
+
if ( empty( $trans ) ) {
|
604 |
+
self::view_backward_comp( $view_settings );
|
605 |
+
set_transient( $trans_name, 1, 10 * YEAR_IN_SECONDS );
|
606 |
+
}
|
607 |
|
608 |
return is_array( $view_settings ) ? $view_settings : array();
|
609 |
}
|
1448 |
* @param int $current_page Current page number
|
1449 |
* @param int $pages_to_show Number of page to show
|
1450 |
*/
|
1451 |
+
static function pagination( $total_pages, $current_page = 1, $pages_to_show = 4 ) {
|
|
|
1452 |
if ( $total_pages == 1 )
|
1453 |
return '';
|
1454 |
|
includes/html-viewtype.php
CHANGED
@@ -62,10 +62,7 @@ if ( !class_exists( 'PT_CV_Html_ViewType' ) ) {
|
|
62 |
*
|
63 |
* @return array Array of rows, each row contains columns
|
64 |
*/
|
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,7 +88,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 |
|
62 |
*
|
63 |
* @return array Array of rows, each row contains columns
|
64 |
*/
|
65 |
+
static function grid_wrapper( $content_items, &$content, $column = 0, $class = '' ) {
|
|
|
|
|
|
|
66 |
|
67 |
list( $columns, $span_width_last, $span_width, $span_class, $row_class ) = self::process_column_width( $column );
|
68 |
|
88 |
$list_item = implode( "\n", $row_html );
|
89 |
|
90 |
// Only wrap in row if shuffle filter is not enable
|
91 |
+
if ( PT_CV_Functions::get_global_variable( 'enable_shuffle_filter' ) != 'yes' ) {
|
92 |
$list_item = sprintf( '<div class="%s">%s</div>', esc_attr( $row_class ), $list_item );
|
93 |
}
|
94 |
|
includes/html.php
CHANGED
@@ -79,8 +79,7 @@ if ( !class_exists( 'PT_CV_Html' ) ) {
|
|
79 |
* @param string $content Content
|
80 |
* @param bool $show Show/hide the content
|
81 |
*/
|
82 |
-
static function html_collapse_one( $parent_id, $id, $heading, $content = '',
|
83 |
-
$show = true ) {
|
84 |
$class = $show ? 'in' : '';
|
85 |
ob_start();
|
86 |
?>
|
@@ -155,8 +154,7 @@ if ( !class_exists( 'PT_CV_Html' ) ) {
|
|
155 |
*
|
156 |
* @return string
|
157 |
*/
|
158 |
-
static function link_button( $link, $style, $text = 'Button', $class = '',
|
159 |
-
$size = '' ) {
|
160 |
return sprintf( '<a href="%s" class="btn btn-%s %s %s">%s</a>', $link, $style, $class, $size, $text );
|
161 |
}
|
162 |
|
@@ -248,8 +246,7 @@ if ( !class_exists( 'PT_CV_Html' ) ) {
|
|
248 |
}
|
249 |
|
250 |
// Get wrapper class of a item
|
251 |
-
$
|
252 |
-
$item_class = apply_filters( PT_CV_PREFIX_ . 'content_item_class', array( $class, PT_CV_PREFIX . 'content-item', PT_CV_PREFIX . $layout ) );
|
253 |
|
254 |
$item_filter = apply_filters( PT_CV_PREFIX_ . 'content_item_filter_value', '', $post_id );
|
255 |
|
@@ -273,8 +270,7 @@ if ( !class_exists( 'PT_CV_Html' ) ) {
|
|
273 |
*
|
274 |
* @return string Full HTML output for Content View
|
275 |
*/
|
276 |
-
static function content_items_wrap( $content_items, $current_page,
|
277 |
-
$post_per_page, $id ) {
|
278 |
global $pt_cv_glb, $pt_cv_id;
|
279 |
$dargs = PT_CV_Functions::get_global_variable( 'dargs' );
|
280 |
|
@@ -368,7 +364,7 @@ if ( !class_exists( 'PT_CV_Html' ) ) {
|
|
368 |
/**
|
369 |
* HTML output of a field (thumbnail, title, content, meta fields...)
|
370 |
*
|
371 |
-
* @param string $field_name The name
|
372 |
* @param object $post The post object
|
373 |
* @param array $fargs The array of Field settings
|
374 |
*
|
@@ -511,13 +507,15 @@ if ( !class_exists( 'PT_CV_Html' ) ) {
|
|
511 |
|
512 |
// Get excerpt
|
513 |
if ( $length > 0 ) {
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
//
|
518 |
-
$
|
|
|
|
|
519 |
// Append readmore button
|
520 |
-
$content
|
521 |
} else {
|
522 |
// Display only readmore button if length <= 0
|
523 |
$content = $readmore_btn;
|
79 |
* @param string $content Content
|
80 |
* @param bool $show Show/hide the content
|
81 |
*/
|
82 |
+
static function html_collapse_one( $parent_id, $id, $heading, $content = '', $show = true ) {
|
|
|
83 |
$class = $show ? 'in' : '';
|
84 |
ob_start();
|
85 |
?>
|
154 |
*
|
155 |
* @return string
|
156 |
*/
|
157 |
+
static function link_button( $link, $style, $text = 'Button', $class = '', $size = '' ) {
|
|
|
158 |
return sprintf( '<a href="%s" class="btn btn-%s %s %s">%s</a>', $link, $style, $class, $size, $text );
|
159 |
}
|
160 |
|
246 |
}
|
247 |
|
248 |
// Get wrapper class of a item
|
249 |
+
$item_class = apply_filters( PT_CV_PREFIX_ . 'content_item_class', array( $class, PT_CV_PREFIX . 'content-item', PT_CV_PREFIX . $dargs[ 'layout-format' ] ) );
|
|
|
250 |
|
251 |
$item_filter = apply_filters( PT_CV_PREFIX_ . 'content_item_filter_value', '', $post_id );
|
252 |
|
270 |
*
|
271 |
* @return string Full HTML output for Content View
|
272 |
*/
|
273 |
+
static function content_items_wrap( $content_items, $current_page, $post_per_page, $id ) {
|
|
|
274 |
global $pt_cv_glb, $pt_cv_id;
|
275 |
$dargs = PT_CV_Functions::get_global_variable( 'dargs' );
|
276 |
|
364 |
/**
|
365 |
* HTML output of a field (thumbnail, title, content, meta fields...)
|
366 |
*
|
367 |
+
* @param string $field_name The field name
|
368 |
* @param object $post The post object
|
369 |
* @param array $fargs The array of Field settings
|
370 |
*
|
507 |
|
508 |
// Get excerpt
|
509 |
if ( $length > 0 ) {
|
510 |
+
// Get manual excerpt, apply filters
|
511 |
+
$full_excerpt = apply_filters( PT_CV_PREFIX_ . 'field_content_excerpt', get_the_content(), $fargs, $post );
|
512 |
+
|
513 |
+
// Limit length
|
514 |
+
$trimmed_excerpt = PT_CV_Functions::wp_trim_words( $full_excerpt, $length );
|
515 |
+
$excerpt = apply_filters( PT_CV_PREFIX_ . 'trim_length_excerpt', $trimmed_excerpt, $full_excerpt, $length );
|
516 |
+
|
517 |
// Append readmore button
|
518 |
+
$content = $excerpt . $readmore_html;
|
519 |
} else {
|
520 |
// Display only readmore button if length <= 0
|
521 |
$content = $readmore_btn;
|
includes/settings.php
CHANGED
@@ -156,7 +156,7 @@ if ( !class_exists( 'PT_CV_Settings' ) ) {
|
|
156 |
'std' => '5',
|
157 |
'placeholder' => 'e.g. 5',
|
158 |
'append_text' => '1 → 100',
|
159 |
-
'desc' => __( 'The number of items per page
|
160 |
),
|
161 |
),
|
162 |
'dependence' => array( 'enable-pagination', 'yes' ),
|
@@ -286,7 +286,7 @@ if ( !class_exists( 'PT_CV_Settings' ) ) {
|
|
286 |
'params' => array(
|
287 |
array(
|
288 |
'type' => 'html',
|
289 |
-
'content' => sprintf( '<p class="text-muted" style="margin-top: -
|
290 |
),
|
291 |
),
|
292 |
) : '',
|
@@ -299,7 +299,8 @@ if ( !class_exists( 'PT_CV_Settings' ) ) {
|
|
299 |
),
|
300 |
'extra_setting' => array(
|
301 |
'params' => array(
|
302 |
-
'
|
|
|
303 |
),
|
304 |
),
|
305 |
'params' => array(
|
@@ -312,10 +313,15 @@ if ( !class_exists( 'PT_CV_Settings' ) ) {
|
|
312 |
),
|
313 |
// Content settings
|
314 |
array(
|
315 |
-
'label'
|
316 |
'text' => __( 'Content settings', PT_CV_DOMAIN ),
|
317 |
),
|
318 |
-
'
|
|
|
|
|
|
|
|
|
|
|
319 |
array(
|
320 |
'type' => 'radio',
|
321 |
'name' => $prefix . 'content-show',
|
@@ -326,7 +332,7 @@ if ( !class_exists( 'PT_CV_Settings' ) ) {
|
|
326 |
'std' => 'excerpt',
|
327 |
),
|
328 |
),
|
329 |
-
'dependence'
|
330 |
),
|
331 |
// Excerpt settings
|
332 |
array(
|
@@ -335,7 +341,8 @@ if ( !class_exists( 'PT_CV_Settings' ) ) {
|
|
335 |
),
|
336 |
'extra_setting' => array(
|
337 |
'params' => array(
|
338 |
-
'
|
|
|
339 |
),
|
340 |
),
|
341 |
'params' => array(
|
@@ -381,7 +388,6 @@ if ( !class_exists( 'PT_CV_Settings' ) ) {
|
|
381 |
'name' => $prefix . 'excerpt-allow_html',
|
382 |
'options' => PT_CV_Values::yes_no( 'yes', __( 'Allow HTML tags (a, br, strong, em, strike, i, ul, ol, li) in excerpt', PT_CV_DOMAIN ) ),
|
383 |
'std' => '',
|
384 |
-
'desc' => __( 'This option can cause broken HTML output. Please be careful when tick it', PT_CV_DOMAIN ),
|
385 |
),
|
386 |
),
|
387 |
),
|
@@ -398,7 +404,8 @@ if ( !class_exists( 'PT_CV_Settings' ) ) {
|
|
398 |
),
|
399 |
'extra_setting' => array(
|
400 |
'params' => array(
|
401 |
-
'
|
|
|
402 |
),
|
403 |
),
|
404 |
'params' => array(
|
156 |
'std' => '5',
|
157 |
'placeholder' => 'e.g. 5',
|
158 |
'append_text' => '1 → 100',
|
159 |
+
'desc' => __( 'The number of items per page.<br>If value of "Limit" option is not blank (empty), this value should be smaller than "Limit" value', PT_CV_DOMAIN ),
|
160 |
),
|
161 |
),
|
162 |
'dependence' => array( 'enable-pagination', 'yes' ),
|
286 |
'params' => array(
|
287 |
array(
|
288 |
'type' => 'html',
|
289 |
+
'content' => sprintf( '<p class="text-muted" style="margin-top: -15px; margin-bottom: 5px;">→ %s</p>', __( 'Customize display order of above fields by a simple drag-and-drop ?', PT_CV_DOMAIN ) . sprintf( ' <a href="%s" target="_blank">%s</a>', esc_url( 'http://www.contentviewspro.com/pricing/?utm_source=client&utm_medium=view' ), __( 'Please upgrade to Pro', PT_CV_DOMAIN ) ) ),
|
290 |
),
|
291 |
),
|
292 |
) : '',
|
299 |
),
|
300 |
'extra_setting' => array(
|
301 |
'params' => array(
|
302 |
+
'group-class' => PT_CV_PREFIX . 'field-setting',
|
303 |
+
'wrap-class' => PT_CV_Html::html_group_class() . ' ' . PT_CV_PREFIX . 'thumbnail-setting' . ' ' . PT_CV_PREFIX . 'w50',
|
304 |
),
|
305 |
),
|
306 |
'params' => array(
|
313 |
),
|
314 |
// Content settings
|
315 |
array(
|
316 |
+
'label' => array(
|
317 |
'text' => __( 'Content settings', PT_CV_DOMAIN ),
|
318 |
),
|
319 |
+
'extra_setting' => array(
|
320 |
+
'params' => array(
|
321 |
+
'group-class' => PT_CV_PREFIX . 'field-setting' . ' ' . PT_CV_PREFIX . 'content-setting',
|
322 |
+
),
|
323 |
+
),
|
324 |
+
'params' => array(
|
325 |
array(
|
326 |
'type' => 'radio',
|
327 |
'name' => $prefix . 'content-show',
|
332 |
'std' => 'excerpt',
|
333 |
),
|
334 |
),
|
335 |
+
'dependence' => array( $prefix2 . 'content', 'yes' ),
|
336 |
),
|
337 |
// Excerpt settings
|
338 |
array(
|
341 |
),
|
342 |
'extra_setting' => array(
|
343 |
'params' => array(
|
344 |
+
'group-class' => PT_CV_PREFIX . 'field-setting' . ' ' . PT_CV_PREFIX . 'excerpt-setting',
|
345 |
+
'wrap-id' => PT_CV_Html::html_group_id( 'excerpt-settings' ),
|
346 |
),
|
347 |
),
|
348 |
'params' => array(
|
388 |
'name' => $prefix . 'excerpt-allow_html',
|
389 |
'options' => PT_CV_Values::yes_no( 'yes', __( 'Allow HTML tags (a, br, strong, em, strike, i, ul, ol, li) in excerpt', PT_CV_DOMAIN ) ),
|
390 |
'std' => '',
|
|
|
391 |
),
|
392 |
),
|
393 |
),
|
404 |
),
|
405 |
'extra_setting' => array(
|
406 |
'params' => array(
|
407 |
+
'group-class' => PT_CV_PREFIX . 'field-setting' . ' ' . PT_CV_PREFIX . 'metafield-setting',
|
408 |
+
'wrap-class' => PT_CV_Html::html_group_class() . ' ' . PT_CV_PREFIX . 'meta-fields-settings',
|
409 |
),
|
410 |
),
|
411 |
'params' => array(
|
includes/values.php
CHANGED
@@ -162,7 +162,7 @@ if ( !class_exists( 'PT_CV_Values' ) ) {
|
|
162 |
|
163 |
$term_slug_name = array();
|
164 |
foreach ( $terms as $term ) {
|
165 |
-
$term_slug_name[ $term->slug ] = $term->name;
|
166 |
}
|
167 |
|
168 |
// Sort values of param by saved order
|
162 |
|
163 |
$term_slug_name = array();
|
164 |
foreach ( $terms as $term ) {
|
165 |
+
$term_slug_name[ PT_CV_Functions::term_slug_sanitize( $term->slug ) ] = $term->name;
|
166 |
}
|
167 |
|
168 |
// Sort values of param by saved order
|
public/assets/css/public.css
CHANGED
@@ -133,6 +133,7 @@
|
|
133 |
}
|
134 |
|
135 |
.pt-cv-spinner {
|
|
|
136 |
margin: 0 auto !important;
|
137 |
|
138 |
display: inline-block;
|
@@ -168,6 +169,10 @@
|
|
168 |
padding: 0;
|
169 |
}
|
170 |
|
|
|
|
|
|
|
|
|
171 |
.pt-cv-pagination a {
|
172 |
cursor: pointer;
|
173 |
}
|
133 |
}
|
134 |
|
135 |
.pt-cv-spinner {
|
136 |
+
width: 12px !important;
|
137 |
margin: 0 auto !important;
|
138 |
|
139 |
display: inline-block;
|
169 |
padding: 0;
|
170 |
}
|
171 |
|
172 |
+
.pt-cv-pagination li {
|
173 |
+
display: inline !important;
|
174 |
+
}
|
175 |
+
|
176 |
.pt-cv-pagination a {
|
177 |
cursor: pointer;
|
178 |
}
|
public/content-views.php
CHANGED
@@ -227,8 +227,10 @@ class PT_Content_Views {
|
|
227 |
* Start SESSION
|
228 |
*/
|
229 |
public function register_session() {
|
230 |
-
if ( !session_id() )
|
|
|
231 |
session_start();
|
|
|
232 |
}
|
233 |
|
234 |
/**
|
227 |
* Start SESSION
|
228 |
*/
|
229 |
public function register_session() {
|
230 |
+
if ( !session_id() ) {
|
231 |
+
do_action( PT_CV_PREFIX_ . 'session_start' );
|
232 |
session_start();
|
233 |
+
}
|
234 |
}
|
235 |
|
236 |
/**
|