Version Description
- Bug fixed: Javascript error in WordPress version 3.4
- Improvement: Code & description clearance
Download this release
Release Info
Developer | PT Guy |
Plugin | Content Views – Post Grid & List for WordPress |
Version | 1.5.1 |
Comparing to | |
See all releases |
Code changes from version 1.5.0 to 1.5.1
- README.txt +20 -6
- admin/assets/js/admin.js +1 -4
- admin/content-views-admin.php +1 -0
- admin/includes/plugin.php +1 -1
- admin/views/view.php +1 -1
- content-views.php +2 -2
- includes/functions.php +16 -19
- includes/html.php +56 -41
- includes/settings.php +1 -1
- public/assets/css/assets.css +0 -1
- public/assets/css/public.css +3 -2
- public/assets/js/assets.js +0 -1
- public/assets/js/public.js +4 -0
- public/templates/_view_type_/css/main.css +0 -10
- public/templates/_view_type_/html/main.php +0 -42
- public/templates/_view_type_/js/main.js +0 -10
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.5.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -108,7 +108,7 @@ Just give a try (30 day money back guarantee), then you will know how it is awes
|
|
108 |
|
109 |
= How can I start? =
|
110 |
|
111 |
-
In left menu of your Admin dashboard, click Content View Settings > Add View
|
112 |
|
113 |
= What is 'View'? =
|
114 |
|
@@ -116,20 +116,30 @@ In left menu of your Admin dashboard, click Content View Settings > Add View
|
|
116 |
|
117 |
= How can I see all my Views? =
|
118 |
|
119 |
-
In left menu of your Admin dashboard, click Content View Settings > All Views
|
120 |
|
121 |
= How can I edit a View? =
|
122 |
|
123 |
Firstly, you should go to "All Views" page (please check above question).
|
124 |
-
If you have View ID or View title, paste it to
|
125 |
-
|
126 |
You will be forwarded to editing page of View.
|
127 |
|
128 |
= How many Views I can create? =
|
129 |
|
130 |
You can create Unlimited Views, in Unlimited websites
|
131 |
|
|
|
132 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
133 |
|
134 |
== Screenshots ==
|
135 |
|
@@ -144,6 +154,10 @@ You can create Unlimited Views, in Unlimited websites
|
|
144 |
|
145 |
== Changelog ==
|
146 |
|
|
|
|
|
|
|
|
|
147 |
= 1.5.0 =
|
148 |
* New feature: Able to use Normal pagination (without Ajax)
|
149 |
* Update: Add filter allows to customize labels for pagination
|
@@ -164,7 +178,7 @@ You can create Unlimited Views, in Unlimited websites
|
|
164 |
* Improvement: Add some css properties to prevent style overwrite problem
|
165 |
|
166 |
= 1.4.4 =
|
167 |
-
* Bug fixed: Length of excerpt is wrong if there is filter of other
|
168 |
* Improvement: GUI improvement in "Fields settings" group
|
169 |
|
170 |
= 1.4.3 =
|
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.1
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
108 |
|
109 |
= How can I start? =
|
110 |
|
111 |
+
In left menu of your Admin dashboard, click 'Content View Settings > Add View'
|
112 |
|
113 |
= What is 'View'? =
|
114 |
|
116 |
|
117 |
= How can I see all my Views? =
|
118 |
|
119 |
+
In left menu of your Admin dashboard, click 'Content View Settings > All Views'
|
120 |
|
121 |
= How can I edit a View? =
|
122 |
|
123 |
Firstly, you should go to "All Views" page (please check above question).
|
124 |
+
If you have View ID or View title, paste it to text field beside "Search Views" button then click the button to search.
|
125 |
+
After that, click on Title of View you want to edit.
|
126 |
You will be forwarded to editing page of View.
|
127 |
|
128 |
= How many Views I can create? =
|
129 |
|
130 |
You can create Unlimited Views, in Unlimited websites
|
131 |
|
132 |
+
= [BUG] When I minify CSS with W3TC plugin, Bootstrap style has "undefined" href. How to fix it? =
|
133 |
|
134 |
+
Please add this code to file **functions.php** of your theme
|
135 |
+
`
|
136 |
+
// CV plugin - Fix Bootstrap undefined error
|
137 |
+
add_filter( 'pt_cv_move_bootstrap', 'my_move_bootstrap' );
|
138 |
+
function my_move_bootstrap( $args ) {
|
139 |
+
$args = 0;
|
140 |
+
return $args;
|
141 |
+
}
|
142 |
+
`
|
143 |
|
144 |
== Screenshots ==
|
145 |
|
154 |
|
155 |
== Changelog ==
|
156 |
|
157 |
+
= 1.5.1 =
|
158 |
+
* Bug fixed: Javascript error in WordPress version 3.4
|
159 |
+
* Improvement: Code & description clearance
|
160 |
+
|
161 |
= 1.5.0 =
|
162 |
* New feature: Able to use Normal pagination (without Ajax)
|
163 |
* Update: Add filter allows to customize labels for pagination
|
178 |
* Improvement: Add some css properties to prevent style overwrite problem
|
179 |
|
180 |
= 1.4.4 =
|
181 |
+
* Bug fixed: Length of excerpt is wrong if there is filter of other plugins or active theme
|
182 |
* Improvement: GUI improvement in "Fields settings" group
|
183 |
|
184 |
= 1.4.3 =
|
admin/assets/js/admin.js
CHANGED
@@ -175,7 +175,7 @@
|
|
175 |
}
|
176 |
break;
|
177 |
default :
|
178 |
-
if (typeof expect_val !== '
|
179 |
pass = eval("this_val " + operator + " expect_val");
|
180 |
break;
|
181 |
|
@@ -610,9 +610,6 @@
|
|
610 |
// Toggle panel of 'Advanced filters'
|
611 |
$self._toggle_panel('.' + _prefix + 'group .panel-heading');
|
612 |
|
613 |
-
// Color picker
|
614 |
-
$('.' + _prefix + 'color').wpColorPicker();
|
615 |
-
|
616 |
// 'Thumbnail settings' toggle
|
617 |
$self._thumbnail_settings();
|
618 |
|
175 |
}
|
176 |
break;
|
177 |
default :
|
178 |
+
if (typeof expect_val !== 'object')
|
179 |
pass = eval("this_val " + operator + " expect_val");
|
180 |
break;
|
181 |
|
610 |
// Toggle panel of 'Advanced filters'
|
611 |
$self._toggle_panel('.' + _prefix + 'group .panel-heading');
|
612 |
|
|
|
|
|
|
|
613 |
// 'Thumbnail settings' toggle
|
614 |
$self._thumbnail_settings();
|
615 |
|
admin/content-views-admin.php
CHANGED
@@ -248,6 +248,7 @@ class PT_Content_Views_Admin {
|
|
248 |
// Localize strings
|
249 |
PT_CV_Asset::localize_script(
|
250 |
'admin', PT_CV_PREFIX_UPPER . 'ADMIN', array(
|
|
|
251 |
'text' => array(
|
252 |
'no_taxonomy' => __( 'There is no taxonomy for selected content type', PT_CV_DOMAIN ),
|
253 |
'pagination_disable' => __( 'Pagination is disabled when Limit = -1', PT_CV_DOMAIN ),
|
248 |
// Localize strings
|
249 |
PT_CV_Asset::localize_script(
|
250 |
'admin', PT_CV_PREFIX_UPPER . 'ADMIN', array(
|
251 |
+
'supported_version' => PT_CV_Functions::wp_version_compare( '3.5' ),
|
252 |
'text' => array(
|
253 |
'no_taxonomy' => __( 'There is no taxonomy for selected content type', PT_CV_DOMAIN ),
|
254 |
'pagination_disable' => __( 'Pagination is disabled when Limit = -1', PT_CV_DOMAIN ),
|
admin/includes/plugin.php
CHANGED
@@ -169,7 +169,7 @@ if ( ! class_exists( 'PT_CV_Plugin' ) ) {
|
|
169 |
$field_name,
|
170 |
'checkbox',
|
171 |
__( "Don't load <b>Bootstrap</b> style & script (in frontend of website)", PT_CV_DOMAIN ),
|
172 |
-
__( 'Only check this option if Bootstrap has been loaded by active theme or other
|
173 |
);
|
174 |
}
|
175 |
|
169 |
$field_name,
|
170 |
'checkbox',
|
171 |
__( "Don't load <b>Bootstrap</b> style & script (in frontend of website)", PT_CV_DOMAIN ),
|
172 |
+
__( 'Only check this option if Bootstrap has been loaded by active theme or other plugins', PT_CV_DOMAIN )
|
173 |
);
|
174 |
}
|
175 |
|
admin/views/view.php
CHANGED
@@ -213,7 +213,7 @@ $options = array(
|
|
213 |
),
|
214 |
),
|
215 |
),
|
216 |
-
|
217 |
apply_filters( PT_CV_PREFIX_ . 'exclude_extra_settings', array() ),
|
218 |
|
219 |
// Parent page
|
213 |
),
|
214 |
),
|
215 |
),
|
216 |
+
|
217 |
apply_filters( PT_CV_PREFIX_ . 'exclude_extra_settings', array() ),
|
218 |
|
219 |
// Parent page
|
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.1
|
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.1' );
|
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
@@ -166,7 +166,7 @@ if ( ! class_exists( 'PT_CV_Functions' ) ) {
|
|
166 |
* @return string
|
167 |
*/
|
168 |
static function string_slug_to_text( $slug ) {
|
169 |
-
$slug = preg_replace( '/[^a-
|
170 |
|
171 |
return ucwords( $slug );
|
172 |
}
|
@@ -187,15 +187,12 @@ if ( ! class_exists( 'PT_CV_Functions' ) ) {
|
|
187 |
$result = implode( ' ', $array );
|
188 |
}
|
189 |
|
190 |
-
// Trim space, dot at the end of string
|
191 |
-
$result = rtrim( $result, '\s.' );
|
192 |
-
|
193 |
return $result;
|
194 |
}
|
195 |
-
|
196 |
/**
|
197 |
* Custom strip tags, allow some tags
|
198 |
-
*
|
199 |
* @since 1.4.6
|
200 |
* @param string $string
|
201 |
* @return string
|
@@ -989,7 +986,7 @@ if ( ! class_exists( 'PT_CV_Functions' ) ) {
|
|
989 |
|
990 |
// Get offset
|
991 |
$paged = self::get_current_page( $pargs );
|
992 |
-
|
993 |
$offset = $posts_per_page * ( (int) $paged - 1 );
|
994 |
|
995 |
// Update posts_per_page
|
@@ -1205,7 +1202,7 @@ if ( ! class_exists( 'PT_CV_Functions' ) ) {
|
|
1205 |
<?php
|
1206 |
}
|
1207 |
}
|
1208 |
-
|
1209 |
/**
|
1210 |
* Generate pagination button for each page
|
1211 |
* @param string $class Class name
|
@@ -1228,7 +1225,7 @@ if ( ! class_exists( 'PT_CV_Functions' ) ) {
|
|
1228 |
|
1229 |
/**
|
1230 |
* Pagination output
|
1231 |
-
*
|
1232 |
* @param int $total_pages Total pages
|
1233 |
* @param int $current_page Current page number
|
1234 |
* @param int $pages_to_show Number of page to show
|
@@ -1236,9 +1233,9 @@ if ( ! class_exists( 'PT_CV_Functions' ) ) {
|
|
1236 |
static function pagination( $total_pages, $current_page = 1, $pages_to_show = 4 ) {
|
1237 |
if ( $total_pages == 1 )
|
1238 |
return '';
|
1239 |
-
|
1240 |
$pages_to_show = apply_filters( PT_CV_PREFIX_ . 'pages_to_show', $pages_to_show );
|
1241 |
-
|
1242 |
// Define labels
|
1243 |
$labels = apply_filters( PT_CV_PREFIX_ . 'pagination_label', array(
|
1244 |
'prev' => '‹',
|
@@ -1246,7 +1243,7 @@ if ( ! class_exists( 'PT_CV_Functions' ) ) {
|
|
1246 |
'first' => '«',
|
1247 |
'last' => '»',
|
1248 |
) );
|
1249 |
-
|
1250 |
$start = ( ( $current_page - $pages_to_show ) > 0 ) ? $current_page - $pages_to_show : 1;
|
1251 |
$end = ( ( $current_page + $pages_to_show ) < $total_pages ) ? $current_page + $pages_to_show : $total_pages;
|
1252 |
|
@@ -1255,13 +1252,13 @@ if ( ! class_exists( 'PT_CV_Functions' ) ) {
|
|
1255 |
$compared_page = 1;
|
1256 |
// First
|
1257 |
if ( $start > $compared_page ) {
|
1258 |
-
$html .= self::pagination_generate_link( '', $compared_page, $labels['first'] );
|
1259 |
}
|
1260 |
// Prev
|
1261 |
if ( $current_page > $compared_page ) {
|
1262 |
$html .= self::pagination_generate_link( '', $current_page - 1, $labels['prev'] );
|
1263 |
}
|
1264 |
-
|
1265 |
for ( $i = $start ; $i <= $end; $i++ ) {
|
1266 |
$html .= self::pagination_generate_link( ( $current_page == $i ) ? 'active' : '', $i );
|
1267 |
}
|
@@ -1275,24 +1272,24 @@ if ( ! class_exists( 'PT_CV_Functions' ) ) {
|
|
1275 |
if ( $end < $compared_page ) {
|
1276 |
$html .= self::pagination_generate_link( '', $compared_page, $labels['last'] );
|
1277 |
}
|
1278 |
-
|
1279 |
return $html;
|
1280 |
}
|
1281 |
-
|
1282 |
/**
|
1283 |
* Get current page number
|
1284 |
*/
|
1285 |
static function get_current_page( $pargs ) {
|
1286 |
$paged = 1;
|
1287 |
-
|
1288 |
if ( ! empty( $pargs['page'] ) ) {
|
1289 |
$paged = intval( $pargs['page'] );
|
1290 |
}
|
1291 |
-
|
1292 |
if ( ! empty( $_GET['vpage'] ) ) {
|
1293 |
$paged = intval( $_GET['vpage'] );
|
1294 |
}
|
1295 |
-
|
1296 |
return $paged;
|
1297 |
}
|
1298 |
|
166 |
* @return string
|
167 |
*/
|
168 |
static function string_slug_to_text( $slug ) {
|
169 |
+
$slug = preg_replace( '/[^a-zA-Z]+/', ' ', $slug );
|
170 |
|
171 |
return ucwords( $slug );
|
172 |
}
|
187 |
$result = implode( ' ', $array );
|
188 |
}
|
189 |
|
|
|
|
|
|
|
190 |
return $result;
|
191 |
}
|
192 |
+
|
193 |
/**
|
194 |
* Custom strip tags, allow some tags
|
195 |
+
*
|
196 |
* @since 1.4.6
|
197 |
* @param string $string
|
198 |
* @return string
|
986 |
|
987 |
// Get offset
|
988 |
$paged = self::get_current_page( $pargs );
|
989 |
+
|
990 |
$offset = $posts_per_page * ( (int) $paged - 1 );
|
991 |
|
992 |
// Update posts_per_page
|
1202 |
<?php
|
1203 |
}
|
1204 |
}
|
1205 |
+
|
1206 |
/**
|
1207 |
* Generate pagination button for each page
|
1208 |
* @param string $class Class name
|
1225 |
|
1226 |
/**
|
1227 |
* Pagination output
|
1228 |
+
*
|
1229 |
* @param int $total_pages Total pages
|
1230 |
* @param int $current_page Current page number
|
1231 |
* @param int $pages_to_show Number of page to show
|
1233 |
static function pagination( $total_pages, $current_page = 1, $pages_to_show = 4 ) {
|
1234 |
if ( $total_pages == 1 )
|
1235 |
return '';
|
1236 |
+
|
1237 |
$pages_to_show = apply_filters( PT_CV_PREFIX_ . 'pages_to_show', $pages_to_show );
|
1238 |
+
|
1239 |
// Define labels
|
1240 |
$labels = apply_filters( PT_CV_PREFIX_ . 'pagination_label', array(
|
1241 |
'prev' => '‹',
|
1243 |
'first' => '«',
|
1244 |
'last' => '»',
|
1245 |
) );
|
1246 |
+
|
1247 |
$start = ( ( $current_page - $pages_to_show ) > 0 ) ? $current_page - $pages_to_show : 1;
|
1248 |
$end = ( ( $current_page + $pages_to_show ) < $total_pages ) ? $current_page + $pages_to_show : $total_pages;
|
1249 |
|
1252 |
$compared_page = 1;
|
1253 |
// First
|
1254 |
if ( $start > $compared_page ) {
|
1255 |
+
$html .= self::pagination_generate_link( '', $compared_page, $labels['first'] );
|
1256 |
}
|
1257 |
// Prev
|
1258 |
if ( $current_page > $compared_page ) {
|
1259 |
$html .= self::pagination_generate_link( '', $current_page - 1, $labels['prev'] );
|
1260 |
}
|
1261 |
+
|
1262 |
for ( $i = $start ; $i <= $end; $i++ ) {
|
1263 |
$html .= self::pagination_generate_link( ( $current_page == $i ) ? 'active' : '', $i );
|
1264 |
}
|
1272 |
if ( $end < $compared_page ) {
|
1273 |
$html .= self::pagination_generate_link( '', $compared_page, $labels['last'] );
|
1274 |
}
|
1275 |
+
|
1276 |
return $html;
|
1277 |
}
|
1278 |
+
|
1279 |
/**
|
1280 |
* Get current page number
|
1281 |
*/
|
1282 |
static function get_current_page( $pargs ) {
|
1283 |
$paged = 1;
|
1284 |
+
|
1285 |
if ( ! empty( $pargs['page'] ) ) {
|
1286 |
$paged = intval( $pargs['page'] );
|
1287 |
}
|
1288 |
+
|
1289 |
if ( ! empty( $_GET['vpage'] ) ) {
|
1290 |
$paged = intval( $_GET['vpage'] );
|
1291 |
}
|
1292 |
+
|
1293 |
return $paged;
|
1294 |
}
|
1295 |
|
includes/html.php
CHANGED
@@ -478,27 +478,35 @@ if ( ! class_exists( 'PT_CV_Html' ) ) {
|
|
478 |
switch ( $fargs['content']['show'] ) {
|
479 |
case 'excerpt':
|
480 |
$length = (int) $fargs['content']['length'];
|
481 |
-
$
|
482 |
-
$
|
|
|
483 |
|
484 |
// Read more button
|
485 |
if ( apply_filters( PT_CV_PREFIX_ . 'field_content_readmore_enable', 1, $fargs['content'] ) ) {
|
486 |
$text = apply_filters( PT_CV_PREFIX_ . 'field_content_readmore_text', __( 'Read More', PT_CV_DOMAIN ), $fargs['content'] );
|
487 |
-
$
|
488 |
-
$readmore_btn .= '
|
|
|
489 |
}
|
490 |
|
491 |
-
//
|
492 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
493 |
|
494 |
-
|
495 |
-
|
496 |
-
* Don't set $readmore_btn as 3rd parameter for wp_trim_words(),
|
497 |
-
* to show Read more button always (even if manual excerpt length < $length)
|
498 |
-
*/
|
499 |
-
$content = $length ? PT_CV_Functions::wp_trim_words( $content, $length ) . $readmore_btn : $readmore;
|
500 |
|
501 |
-
// Force balance tags
|
502 |
$content = force_balance_tags( strip_shortcodes( $content ) );
|
503 |
|
504 |
$content = apply_filters( PT_CV_PREFIX_ . 'field_content_final', $content, $post );
|
@@ -782,33 +790,39 @@ if ( ! class_exists( 'PT_CV_Html' ) ) {
|
|
782 |
}
|
783 |
$did_assets_of_view_types[$pt_view_sid] = 1;
|
784 |
|
785 |
-
|
786 |
-
$
|
787 |
-
|
788 |
-
// Get content of asset files in directory of view type
|
789 |
-
foreach ( self::$view_type_dir as $idx => $view_type_dir ) {
|
790 |
-
// Get selected style of current view type
|
791 |
-
$style = self::$style[$idx];
|
792 |
|
793 |
-
|
794 |
-
|
795 |
-
|
796 |
-
|
797 |
-
|
798 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
799 |
}
|
800 |
}
|
801 |
-
}
|
802 |
|
803 |
-
|
804 |
-
|
805 |
-
|
806 |
-
|
807 |
|
808 |
-
|
809 |
-
|
810 |
-
|
811 |
-
|
|
|
812 |
}
|
813 |
}
|
814 |
}
|
@@ -838,7 +852,9 @@ if ( ! class_exists( 'PT_CV_Html' ) ) {
|
|
838 |
}
|
839 |
|
840 |
// Output custom inline style for Views
|
841 |
-
|
|
|
|
|
842 |
}
|
843 |
|
844 |
/**
|
@@ -874,11 +890,12 @@ if ( ! class_exists( 'PT_CV_Html' ) ) {
|
|
874 |
'is_mobile' => wp_is_mobile(),
|
875 |
'_prefix' => PT_CV_PREFIX,
|
876 |
'ajaxurl' => admin_url( 'admin-ajax.php' ),
|
877 |
-
'lang' => PT_CV_Functions::get_language(),
|
878 |
'_nonce' => wp_create_nonce( PT_CV_PREFIX_ . 'ajax_nonce' ),
|
|
|
|
|
879 |
)
|
880 |
);
|
881 |
-
|
882 |
// Localize for Pagination script
|
883 |
PT_CV_Asset::localize_script(
|
884 |
'bootstrap-paginator', PT_CV_PREFIX_UPPER . 'PAGINATION', array(
|
@@ -970,9 +987,7 @@ if ( ! class_exists( 'PT_CV_Html' ) ) {
|
|
970 |
|
971 |
ob_start();
|
972 |
?>
|
973 |
-
<style type="text/css" id="<?php echo esc_attr( PT_CV_PREFIX . 'inline-style-' . $random_id ); ?>">
|
974 |
-
<?php echo '' . $css; ?>
|
975 |
-
</style>
|
976 |
<?php
|
977 |
return ob_get_clean();
|
978 |
}
|
478 |
switch ( $fargs['content']['show'] ) {
|
479 |
case 'excerpt':
|
480 |
$length = (int) $fargs['content']['length'];
|
481 |
+
$readmore_btn = '';
|
482 |
+
$dots = ' ...';
|
483 |
+
$readmore_html = apply_filters( PT_CV_PREFIX_ . 'field_excerpt_dots', 1, $fargs ) ? $dots : '';
|
484 |
|
485 |
// Read more button
|
486 |
if ( apply_filters( PT_CV_PREFIX_ . 'field_content_readmore_enable', 1, $fargs['content'] ) ) {
|
487 |
$text = apply_filters( PT_CV_PREFIX_ . 'field_content_readmore_text', __( 'Read More', PT_CV_DOMAIN ), $fargs['content'] );
|
488 |
+
$btn_class = apply_filters( PT_CV_PREFIX_ . 'field_content_readmore_class', 'btn btn-success btn-sm', $fargs );
|
489 |
+
$readmore_btn .= self::_field_href( $oargs, $post, $text, PT_CV_PREFIX . 'readmore ' . $btn_class );
|
490 |
+
$readmore_html .= apply_filters( PT_CV_PREFIX_ . 'field_content_readmore_seperated', '<br/>', $fargs ) . $readmore_btn;
|
491 |
}
|
492 |
|
493 |
+
// Get excerpt
|
494 |
+
if ( $length > 0 ) {
|
495 |
+
// Extract excerpt from content
|
496 |
+
$excerpt = PT_CV_Functions::wp_trim_words( get_the_content(), $length );
|
497 |
+
// Get manual excerpt
|
498 |
+
$excerpt = apply_filters( PT_CV_PREFIX_ . 'field_content_excerpt', $excerpt, $fargs, $post );
|
499 |
+
// Append readmore button
|
500 |
+
$content = $excerpt . $readmore_html;
|
501 |
+
} else {
|
502 |
+
// Display only readmore button if length <= 0
|
503 |
+
$content = $readmore_btn;
|
504 |
+
}
|
505 |
|
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 );
|
790 |
}
|
791 |
$did_assets_of_view_types[$pt_view_sid] = 1;
|
792 |
|
793 |
+
// Get settings option
|
794 |
+
$options = get_option( PT_CV_OPTION_NAME );
|
|
|
|
|
|
|
|
|
|
|
795 |
|
796 |
+
// Print inline view styles & scripts
|
797 |
+
if ( apply_filters( PT_CV_PREFIX_ . 'assets_verbose_loading', 1 ) ) {
|
798 |
+
$assets = array( 'css', 'js' );
|
799 |
+
$assets_output = $assets_files = array();
|
800 |
+
|
801 |
+
// Get content of asset files in directory of view type
|
802 |
+
foreach ( self::$view_type_dir as $idx => $view_type_dir ) {
|
803 |
+
// Get selected style of current view type
|
804 |
+
$style = self::$style[$idx];
|
805 |
+
|
806 |
+
// With each type of asset (css, js), looking for suit file of selected style
|
807 |
+
foreach ( $assets as $type ) {
|
808 |
+
$file_path = $view_type_dir . '/' . $type . '/' . $style . '.' . $type;
|
809 |
+
$content = PT_CV_Functions::file_include_content( $file_path );
|
810 |
+
if ( $content ) {
|
811 |
+
$assets_output[$type][] = $content;
|
812 |
+
}
|
813 |
}
|
814 |
}
|
|
|
815 |
|
816 |
+
// Echo script, style inline
|
817 |
+
if ( $assets_output ) {
|
818 |
+
foreach ( $assets_output as $type => $contents ) {
|
819 |
+
$content = implode( "\n", $contents );
|
820 |
|
821 |
+
if ( $type == 'js' ) {
|
822 |
+
echo '' . self::inline_script( $content, false );
|
823 |
+
} else {
|
824 |
+
echo '' . self::inline_style( $content );
|
825 |
+
}
|
826 |
}
|
827 |
}
|
828 |
}
|
852 |
}
|
853 |
|
854 |
// Output custom inline style for Views
|
855 |
+
if ( apply_filters( PT_CV_PREFIX_ . 'output_view_style', 1 ) ) {
|
856 |
+
do_action( PT_CV_PREFIX_ . 'print_view_style' );
|
857 |
+
}
|
858 |
}
|
859 |
|
860 |
/**
|
890 |
'is_mobile' => wp_is_mobile(),
|
891 |
'_prefix' => PT_CV_PREFIX,
|
892 |
'ajaxurl' => admin_url( 'admin-ajax.php' ),
|
|
|
893 |
'_nonce' => wp_create_nonce( PT_CV_PREFIX_ . 'ajax_nonce' ),
|
894 |
+
'lang' => PT_CV_Functions::get_language(), #Get current language of site
|
895 |
+
'move_bootstrap' => apply_filters( PT_CV_PREFIX_ . 'move_bootstrap', 1 ), #Should I move Bootstrap to top of all styles
|
896 |
)
|
897 |
);
|
898 |
+
|
899 |
// Localize for Pagination script
|
900 |
PT_CV_Asset::localize_script(
|
901 |
'bootstrap-paginator', PT_CV_PREFIX_UPPER . 'PAGINATION', array(
|
987 |
|
988 |
ob_start();
|
989 |
?>
|
990 |
+
<style type="text/css" id="<?php echo esc_attr( PT_CV_PREFIX . 'inline-style-' . $random_id ); ?>"><?php echo '' . $css; ?></style>
|
|
|
|
|
991 |
<?php
|
992 |
return ob_get_clean();
|
993 |
}
|
includes/settings.php
CHANGED
@@ -49,7 +49,7 @@ if ( ! class_exists( 'PT_CV_Settings' ) ) {
|
|
49 |
'name' => $taxonomy_slug . '-terms[]',
|
50 |
'options' => $terms,
|
51 |
'std' => '',
|
52 |
-
'class' => 'select2',
|
53 |
'multiple' => '1',
|
54 |
),
|
55 |
),
|
49 |
'name' => $taxonomy_slug . '-terms[]',
|
50 |
'options' => $terms,
|
51 |
'std' => '',
|
52 |
+
'class' => apply_filters( PT_CV_PREFIX_ . 'select_term_class', 'select2' ),
|
53 |
'multiple' => '1',
|
54 |
),
|
55 |
),
|
public/assets/css/assets.css
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
/* Do not paste code here, this page used to show code generated automatically */
|
|
public/assets/css/public.css
CHANGED
@@ -88,11 +88,11 @@
|
|
88 |
}
|
89 |
|
90 |
.pt-cv-thumbnail.pull-left {
|
91 |
-
margin-right:
|
92 |
}
|
93 |
|
94 |
.pt-cv-thumbnail.pull-right {
|
95 |
-
margin-left:
|
96 |
}
|
97 |
|
98 |
.pt-cv-no-image {
|
@@ -103,6 +103,7 @@
|
|
103 |
/* Content */
|
104 |
.pt-cv-content, .pt-cv-content * {
|
105 |
font-size: 14px;
|
|
|
106 |
zoom: 1;
|
107 |
line-height: 1.6em;
|
108 |
}
|
88 |
}
|
89 |
|
90 |
.pt-cv-thumbnail.pull-left {
|
91 |
+
margin-right: 20px;
|
92 |
}
|
93 |
|
94 |
.pt-cv-thumbnail.pull-right {
|
95 |
+
margin-left: 20px;
|
96 |
}
|
97 |
|
98 |
.pt-cv-no-image {
|
103 |
/* Content */
|
104 |
.pt-cv-content, .pt-cv-content * {
|
105 |
font-size: 14px;
|
106 |
+
font-weight: 400;
|
107 |
zoom: 1;
|
108 |
line-height: 1.6em;
|
109 |
}
|
public/assets/js/assets.js
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
/* Do not paste code here, this page used to show code generated automatically */
|
|
public/assets/js/public.js
CHANGED
@@ -33,6 +33,10 @@
|
|
33 |
* @returns {undefined}
|
34 |
*/
|
35 |
move_bootstrap_to_top: function () {
|
|
|
|
|
|
|
|
|
36 |
var _prefix = PT_CV_PUBLIC._prefix;
|
37 |
|
38 |
var selector = _prefix + 'bootstrap-style-css';
|
33 |
* @returns {undefined}
|
34 |
*/
|
35 |
move_bootstrap_to_top: function () {
|
36 |
+
if ( PT_CV_PUBLIC.move_bootstrap === 0 ) {
|
37 |
+
return;
|
38 |
+
}
|
39 |
+
|
40 |
var _prefix = PT_CV_PUBLIC._prefix;
|
41 |
|
42 |
var selector = _prefix + 'bootstrap-style-css';
|
public/templates/_view_type_/css/main.css
DELETED
@@ -1,10 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* Style Name: View type
|
3 |
-
*
|
4 |
-
* @package PT_Content_Views
|
5 |
-
* @author PT Guy <palaceofthemes@gmail.com>
|
6 |
-
* @license GPL-2.0+
|
7 |
-
* @link http://www.contentviewspro.com/
|
8 |
-
* @copyright 2014 PT Guy
|
9 |
-
*/
|
10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public/templates/_view_type_/html/main.php
DELETED
@@ -1,42 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Layout Name: View type
|
4 |
-
*
|
5 |
-
* @package PT_Content_Views
|
6 |
-
* @author PT Guy <palaceofthemes@gmail.com>
|
7 |
-
* @license GPL-2.0+
|
8 |
-
* @link http://www.contentviewspro.com/
|
9 |
-
* @copyright 2014 PT Guy
|
10 |
-
*/
|
11 |
-
|
12 |
-
$html = array();
|
13 |
-
|
14 |
-
$layout = $dargs['layout-format'];
|
15 |
-
|
16 |
-
// Prevent the case: there are 2 columns but have not setting for thumbnail position
|
17 |
-
if ( $layout == '2-col' && ! isset( $dargs['field-settings']['thumbnail'] ) ) {
|
18 |
-
$layout = '1-col';
|
19 |
-
}
|
20 |
-
|
21 |
-
switch ( $layout ) {
|
22 |
-
case '1-col':
|
23 |
-
foreach ( $fields_html as $field_html ) {
|
24 |
-
$html[] = $field_html;
|
25 |
-
}
|
26 |
-
break;
|
27 |
-
case '2-col':
|
28 |
-
|
29 |
-
// Thumbnail html
|
30 |
-
$thumbnail_html = $fields_html['thumbnail'];
|
31 |
-
|
32 |
-
// Other fields html
|
33 |
-
unset( $fields_html['thumbnail'] );
|
34 |
-
$others_html = implode( "\n", $fields_html );
|
35 |
-
|
36 |
-
$html[] = $thumbnail_html;
|
37 |
-
$html[] = $others_html;
|
38 |
-
|
39 |
-
break;
|
40 |
-
}
|
41 |
-
|
42 |
-
echo balanceTags( implode( "\n", $html ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public/templates/_view_type_/js/main.js
DELETED
@@ -1,10 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* Script Name: View type
|
3 |
-
*
|
4 |
-
* @package PT_Content_Views
|
5 |
-
* @author PT Guy <palaceofthemes@gmail.com>
|
6 |
-
* @license GPL-2.0+
|
7 |
-
* @link http://www.contentviewspro.com/
|
8 |
-
* @copyright 2014 PT Guy
|
9 |
-
*/
|
10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|