Version Description
- January 12 2016 =
- Bug fixed: Content floats after View output
- Tweak: Code relates to grid system
- Tweak: Update filter "page_attr"
Download this release
Release Info
Developer | PT Guy |
Plugin | Content Views – Post Grid & List for WordPress |
Version | 1.7.7 |
Comparing to | |
See all releases |
Code changes from version 1.7.6 to 1.7.7
- README.txt +6 -1
- content-views.php +2 -2
- includes/functions.php +6 -1
- includes/html-viewtype.php +12 -7
- includes/html.php +3 -2
- public/assets/css/public.css +28 -27
- public/templates/collapsible/html/main.php +1 -1
- public/templates/scrollable/html/main.php +1 -1
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, display, recent, posts, recent post, 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.4.1
|
7 |
-
Stable tag: 1.7.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -150,6 +150,11 @@ add_filter( 'pt_cv_start_session', '__return_false' );
|
|
150 |
|
151 |
== Changelog ==
|
152 |
|
|
|
|
|
|
|
|
|
|
|
153 |
= 1.7.6 - January 11 2016 =
|
154 |
* Update: Set Administrator (instead of Editor) as default user role who can add, edit, delete View
|
155 |
* Update: Do not wrap items in output to rows anymore
|
4 |
Tags: post, display, recent, posts, recent post, 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.4.1
|
7 |
+
Stable tag: 1.7.7
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
150 |
|
151 |
== Changelog ==
|
152 |
|
153 |
+
= 1.7.7 - January 12 2016 =
|
154 |
+
* Bug fixed: Content floats after View output
|
155 |
+
* Tweak: Code relates to grid system
|
156 |
+
* Tweak: Update filter "page_attr"
|
157 |
+
|
158 |
= 1.7.6 - January 11 2016 =
|
159 |
* Update: Set Administrator (instead of Editor) as default user role who can add, edit, delete View
|
160 |
* Update: Do not wrap items in output to rows anymore
|
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.7.
|
15 |
* Author: PT Guy
|
16 |
* Author URI: http://profiles.wordpress.org/pt-guy
|
17 |
* Text Domain: content-views-query-and-display-post-page
|
@@ -27,7 +27,7 @@ if ( !defined( 'WPINC' ) ) {
|
|
27 |
/*
|
28 |
* Define Constant
|
29 |
*/
|
30 |
-
define( 'PT_CV_VERSION', '1.7.
|
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.7.7
|
15 |
* Author: PT Guy
|
16 |
* Author URI: http://profiles.wordpress.org/pt-guy
|
17 |
* Text Domain: content-views-query-and-display-post-page
|
27 |
/*
|
28 |
* Define Constant
|
29 |
*/
|
30 |
+
define( 'PT_CV_VERSION', '1.7.7' );
|
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
@@ -1478,13 +1478,18 @@ if ( !class_exists( 'PT_CV_Functions' ) ) {
|
|
1478 |
* @param string $variable
|
1479 |
* @return mixed
|
1480 |
*/
|
1481 |
-
static function get_global_variable( $variable ) {
|
1482 |
global $pt_cv_glb, $pt_cv_id;
|
1483 |
if ( !$pt_cv_glb || !$pt_cv_id )
|
1484 |
return null;
|
1485 |
|
1486 |
$value = isset( $pt_cv_glb[ $pt_cv_id ][ $variable ] ) ? $pt_cv_glb[ $pt_cv_id ][ $variable ] : null;
|
1487 |
|
|
|
|
|
|
|
|
|
|
|
1488 |
return $value;
|
1489 |
}
|
1490 |
|
1478 |
* @param string $variable
|
1479 |
* @return mixed
|
1480 |
*/
|
1481 |
+
static function get_global_variable( $variable, $unset = false ) {
|
1482 |
global $pt_cv_glb, $pt_cv_id;
|
1483 |
if ( !$pt_cv_glb || !$pt_cv_id )
|
1484 |
return null;
|
1485 |
|
1486 |
$value = isset( $pt_cv_glb[ $pt_cv_id ][ $variable ] ) ? $pt_cv_glb[ $pt_cv_id ][ $variable ] : null;
|
1487 |
|
1488 |
+
// Unset after get
|
1489 |
+
if ( $unset && $value ) {
|
1490 |
+
unset( $pt_cv_glb[ $pt_cv_id ][ $variable ] );
|
1491 |
+
}
|
1492 |
+
|
1493 |
return $value;
|
1494 |
}
|
1495 |
|
includes/html-viewtype.php
CHANGED
@@ -20,16 +20,16 @@ if ( !class_exists( 'PT_CV_Html_ViewType' ) ) {
|
|
20 |
/**
|
21 |
* Generate class for columns
|
22 |
*
|
23 |
-
* @param int
|
|
|
24 |
*
|
25 |
* @return array
|
26 |
*/
|
27 |
-
static function process_column_width( $
|
28 |
$dargs = PT_CV_Functions::get_global_variable( 'dargs' );
|
29 |
|
30 |
-
//
|
31 |
-
|
32 |
-
$columns = $_columns ? $_columns : (int) $dargs[ 'number-columns' ];
|
33 |
if ( !$columns ) {
|
34 |
$columns = 1;
|
35 |
}
|
@@ -44,6 +44,11 @@ if ( !class_exists( 'PT_CV_Html_ViewType' ) ) {
|
|
44 |
// Get span class
|
45 |
$span_class = apply_filters( PT_CV_PREFIX_ . 'span_class', 'col-md-' );
|
46 |
|
|
|
|
|
|
|
|
|
|
|
47 |
return array( $columns, $span_width_last, $span_width, $span_class, '' );
|
48 |
}
|
49 |
|
@@ -217,7 +222,7 @@ if ( !class_exists( 'PT_CV_Html_ViewType' ) ) {
|
|
217 |
|
218 |
// Show first slide
|
219 |
$this_class = $slide_class . ( ( $s_idx == 0 ) ? ' active' : '' );
|
220 |
-
$scrollable_content[] = sprintf( '<div class="%s">%s</div>', esc_attr( $this_class ), implode( "\n", $slide_html ) );
|
221 |
}
|
222 |
|
223 |
// Get class of wrapper of content of scrollable list
|
@@ -250,7 +255,7 @@ if ( !class_exists( 'PT_CV_Html_ViewType' ) ) {
|
|
250 |
$li[] = sprintf( '<li data-target="#%s" data-slide-to="%s" class="%s"></li>', esc_attr( $wrapper_id ), esc_attr( $index ), $class );
|
251 |
}
|
252 |
|
253 |
-
$output = '<ol class="
|
254 |
}
|
255 |
|
256 |
return $output;
|
20 |
/**
|
21 |
* Generate class for columns
|
22 |
*
|
23 |
+
* @param int $col
|
24 |
+
* @param bool $for_grid
|
25 |
*
|
26 |
* @return array
|
27 |
*/
|
28 |
+
static function process_column_width( $col = 0, $for_grid = true ) {
|
29 |
$dargs = PT_CV_Functions::get_global_variable( 'dargs' );
|
30 |
|
31 |
+
// Get column span
|
32 |
+
$columns = $col ? $col : (int) $dargs[ 'number-columns' ];
|
|
|
33 |
if ( !$columns ) {
|
34 |
$columns = 1;
|
35 |
}
|
44 |
// Get span class
|
45 |
$span_class = apply_filters( PT_CV_PREFIX_ . 'span_class', 'col-md-' );
|
46 |
|
47 |
+
// Mark as using grid system
|
48 |
+
if ( $for_grid ) {
|
49 |
+
PT_CV_Functions::set_global_variable( 'use_grid', 1 );
|
50 |
+
}
|
51 |
+
|
52 |
return array( $columns, $span_width_last, $span_width, $span_class, '' );
|
53 |
}
|
54 |
|
222 |
|
223 |
// Show first slide
|
224 |
$this_class = $slide_class . ( ( $s_idx == 0 ) ? ' active' : '' );
|
225 |
+
$scrollable_content[] = sprintf( '<div class="%s"><div class="%s">%s</div></div>', esc_attr( $this_class ), 'row', implode( "\n", $slide_html ) );
|
226 |
}
|
227 |
|
228 |
// Get class of wrapper of content of scrollable list
|
255 |
$li[] = sprintf( '<li data-target="#%s" data-slide-to="%s" class="%s"></li>', esc_attr( $wrapper_id ), esc_attr( $index ), $class );
|
256 |
}
|
257 |
|
258 |
+
$output = '<ol class="' . PT_CV_PREFIX . 'carousel-indicators">' . implode( "\n", $li ) . '</ol>';
|
259 |
}
|
260 |
|
261 |
return $output;
|
includes/html.php
CHANGED
@@ -314,7 +314,7 @@ if ( !class_exists( 'PT_CV_Html' ) ) {
|
|
314 |
|
315 |
// Custom attribute of a page
|
316 |
$col_count = sprintf( 'data-cvc="%s"', (int) $dargs[ 'number-columns' ] );
|
317 |
-
$page_attr_ = apply_filters( PT_CV_PREFIX_ . 'page_attr', $col_count, $view_type, $content_items
|
318 |
$page_attr = strip_tags( $page_attr_ );
|
319 |
|
320 |
if ( apply_filters( PT_CV_PREFIX_ . 'wrap_in_page', true ) ) {
|
@@ -328,7 +328,8 @@ if ( !class_exists( 'PT_CV_Html' ) ) {
|
|
328 |
|
329 |
if ( $nonpaging_or_firstpage ) {
|
330 |
// Get wrapper class of View
|
331 |
-
$
|
|
|
332 |
|
333 |
// ID for the wrapper
|
334 |
$view_id = PT_CV_PREFIX . 'view-' . $id;
|
314 |
|
315 |
// Custom attribute of a page
|
316 |
$col_count = sprintf( 'data-cvc="%s"', (int) $dargs[ 'number-columns' ] );
|
317 |
+
$page_attr_ = apply_filters( PT_CV_PREFIX_ . 'page_attr', $col_count, $view_type, $content_items );
|
318 |
$page_attr = strip_tags( $page_attr_ );
|
319 |
|
320 |
if ( apply_filters( PT_CV_PREFIX_ . 'wrap_in_page', true ) ) {
|
328 |
|
329 |
if ( $nonpaging_or_firstpage ) {
|
330 |
// Get wrapper class of View
|
331 |
+
$extra_class = PT_CV_Functions::get_global_variable( 'use_grid', true );
|
332 |
+
$view_class = apply_filters( PT_CV_PREFIX_ . 'view_class', array( PT_CV_PREFIX . 'view', PT_CV_PREFIX . $view_type, $extra_class ? PT_CV_PREFIX . 'colsys' : '' ) );
|
333 |
|
334 |
// ID for the wrapper
|
335 |
$view_id = PT_CV_PREFIX . 'view-' . $id;
|
public/assets/css/public.css
CHANGED
@@ -19,39 +19,16 @@
|
|
19 |
|
20 |
/* Common */
|
21 |
.pt-cv-view {
|
22 |
-
margin-left: -15px;
|
23 |
-
margin-right: -15px;
|
24 |
-
|
25 |
position: relative;
|
26 |
clear: both;
|
27 |
}
|
28 |
|
29 |
-
.pt-cv-collapsible {
|
30 |
-
margin-left: 0;
|
31 |
-
margin-right: 0;
|
32 |
-
}
|
33 |
-
|
34 |
.pt-cv-view:after {
|
35 |
clear: both;
|
36 |
-
content:
|
37 |
display: block;
|
38 |
}
|
39 |
|
40 |
-
.pt-cv-view [data-cvc="2"] .col-md-6:nth-child(2n+1),
|
41 |
-
.pt-cv-view [data-cvc="3"] .col-md-4:nth-child(3n+1),
|
42 |
-
.pt-cv-view [data-cvc="4"] .col-md-3:nth-child(4n+1),
|
43 |
-
.pt-cv-view [data-cvc="5"] .col-md-2:nth-child(5n+1),
|
44 |
-
.pt-cv-view [data-cvc="6"] .col-md-2:nth-child(6n+1),
|
45 |
-
.pt-cv-view [data-cvc="7"] .col-md-1:nth-child(7n+1),
|
46 |
-
.pt-cv-view [data-cvc="8"] .col-md-1:nth-child(8n+1),
|
47 |
-
.pt-cv-view [data-cvc="9"] .col-md-1:nth-child(9n+1),
|
48 |
-
.pt-cv-view [data-cvc="10"] .col-md-1:nth-child(10n+1),
|
49 |
-
.pt-cv-view [data-cvc="11"] .col-md-1:nth-child(11n+1),
|
50 |
-
.pt-cv-view [data-cvc="12"] .col-md-1:nth-child(12n+1)
|
51 |
-
{
|
52 |
-
clear: left !important;
|
53 |
-
}
|
54 |
-
|
55 |
.pt-cv-page {
|
56 |
position: relative;
|
57 |
}
|
@@ -64,6 +41,28 @@
|
|
64 |
font-weight: 600 !important;
|
65 |
}
|
66 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
/* Link */
|
68 |
.pt-cv-view a, .pt-cv-wrapper .btn {
|
69 |
text-decoration: none !important;
|
@@ -140,11 +139,11 @@
|
|
140 |
.pt-cv-content, .pt-cv-content * {
|
141 |
font-weight: 400;
|
142 |
zoom: 1;
|
143 |
-
line-height: 1.6em;
|
144 |
}
|
145 |
/* Able to use default font-size if add class "pt-cv-nfs" */
|
146 |
.pt-cv-content:not(.pt-cv-nfs), .pt-cv-content:not(.pt-cv-nfs) * {
|
147 |
font-size: 14px;
|
|
|
148 |
}
|
149 |
|
150 |
/* Meta fields */
|
@@ -258,7 +257,10 @@
|
|
258 |
}
|
259 |
|
260 |
/* View type : Scrollable List */
|
261 |
-
|
|
|
|
|
|
|
262 |
/* Caption */
|
263 |
.pt-cv-view .pt-cv-carousel-caption {
|
264 |
text-align: left;
|
@@ -342,7 +344,6 @@
|
|
342 |
}
|
343 |
}
|
344 |
|
345 |
-
|
346 |
/* @Panels-minified */
|
347 |
.pt-cv-view .panel {
|
348 |
margin-bottom: 20px;
|
19 |
|
20 |
/* Common */
|
21 |
.pt-cv-view {
|
|
|
|
|
|
|
22 |
position: relative;
|
23 |
clear: both;
|
24 |
}
|
25 |
|
|
|
|
|
|
|
|
|
|
|
26 |
.pt-cv-view:after {
|
27 |
clear: both;
|
28 |
+
content: '';
|
29 |
display: block;
|
30 |
}
|
31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
.pt-cv-page {
|
33 |
position: relative;
|
34 |
}
|
41 |
font-weight: 600 !important;
|
42 |
}
|
43 |
|
44 |
+
/* Grid system without row */
|
45 |
+
.pt-cv-colsys {
|
46 |
+
margin-left: -15px;
|
47 |
+
margin-right: -15px;
|
48 |
+
}
|
49 |
+
@media (min-width: 992px) {
|
50 |
+
.pt-cv-colsys [data-cvc="2"] .col-md-6:nth-child(2n+1),
|
51 |
+
.pt-cv-colsys [data-cvc="3"] .col-md-4:nth-child(3n+1),
|
52 |
+
.pt-cv-colsys [data-cvc="4"] .col-md-3:nth-child(4n+1),
|
53 |
+
.pt-cv-colsys [data-cvc="5"] .col-md-2:nth-child(5n+1),
|
54 |
+
.pt-cv-colsys [data-cvc="6"] .col-md-2:nth-child(6n+1),
|
55 |
+
.pt-cv-colsys [data-cvc="7"] .col-md-1:nth-child(7n+1),
|
56 |
+
.pt-cv-colsys [data-cvc="8"] .col-md-1:nth-child(8n+1),
|
57 |
+
.pt-cv-colsys [data-cvc="9"] .col-md-1:nth-child(9n+1),
|
58 |
+
.pt-cv-colsys [data-cvc="10"] .col-md-1:nth-child(10n+1),
|
59 |
+
.pt-cv-colsys [data-cvc="11"] .col-md-1:nth-child(11n+1),
|
60 |
+
.pt-cv-colsys [data-cvc="12"] .col-md-1:nth-child(12n+1)
|
61 |
+
{
|
62 |
+
clear: left !important;
|
63 |
+
}
|
64 |
+
}
|
65 |
+
|
66 |
/* Link */
|
67 |
.pt-cv-view a, .pt-cv-wrapper .btn {
|
68 |
text-decoration: none !important;
|
139 |
.pt-cv-content, .pt-cv-content * {
|
140 |
font-weight: 400;
|
141 |
zoom: 1;
|
|
|
142 |
}
|
143 |
/* Able to use default font-size if add class "pt-cv-nfs" */
|
144 |
.pt-cv-content:not(.pt-cv-nfs), .pt-cv-content:not(.pt-cv-nfs) * {
|
145 |
font-size: 14px;
|
146 |
+
line-height: 1.6em;
|
147 |
}
|
148 |
|
149 |
/* Meta fields */
|
257 |
}
|
258 |
|
259 |
/* View type : Scrollable List */
|
260 |
+
.pt-cv-scrollable {
|
261 |
+
margin-left: 0;
|
262 |
+
margin-right: 0;
|
263 |
+
}
|
264 |
/* Caption */
|
265 |
.pt-cv-view .pt-cv-carousel-caption {
|
266 |
text-align: left;
|
344 |
}
|
345 |
}
|
346 |
|
|
|
347 |
/* @Panels-minified */
|
348 |
.pt-cv-view .panel {
|
349 |
margin-bottom: 20px;
|
public/templates/collapsible/html/main.php
CHANGED
@@ -44,7 +44,7 @@ switch ( $layout ) {
|
|
44 |
|
45 |
$random_id = PT_CV_Functions::string_random();
|
46 |
?>
|
47 |
-
<div class="panel panel-default
|
48 |
<?php echo apply_filters( PT_CV_PREFIX_ . 'collapsible_before_heading', '' ); ?>
|
49 |
<div class="panel-heading">
|
50 |
<a class="panel-title" data-toggle="collapse" data-parent="#<?php echo esc_attr( PT_CV_PREFIX_UPPER . 'ID' ); ?>" href="#<?php echo esc_attr( $random_id ); ?>">
|
44 |
|
45 |
$random_id = PT_CV_Functions::string_random();
|
46 |
?>
|
47 |
+
<div class="panel panel-default <?php echo PT_CV_PREFIX ?>content-item">
|
48 |
<?php echo apply_filters( PT_CV_PREFIX_ . 'collapsible_before_heading', '' ); ?>
|
49 |
<div class="panel-heading">
|
50 |
<a class="panel-title" data-toggle="collapse" data-parent="#<?php echo esc_attr( PT_CV_PREFIX_UPPER . 'ID' ); ?>" href="#<?php echo esc_attr( $random_id ); ?>">
|
public/templates/scrollable/html/main.php
CHANGED
@@ -26,7 +26,7 @@ if ( !empty( $img ) ) {
|
|
26 |
$others_html = implode( "\n", $fields_html );
|
27 |
|
28 |
// Get wrapper class of caption
|
29 |
-
$caption_class = apply_filters( PT_CV_PREFIX_ . 'scrollable_caption_class', array( '
|
30 |
$html[] = sprintf( '<div class="%s">%s</div>', esc_attr( implode( ' ', array_filter( $caption_class ) ) ), $others_html );
|
31 |
|
32 |
echo implode( "\n", $html );
|
26 |
$others_html = implode( "\n", $fields_html );
|
27 |
|
28 |
// Get wrapper class of caption
|
29 |
+
$caption_class = apply_filters( PT_CV_PREFIX_ . 'scrollable_caption_class', array( PT_CV_PREFIX . 'carousel-caption', $ex_cap_cls ) );
|
30 |
$html[] = sprintf( '<div class="%s">%s</div>', esc_attr( implode( ' ', array_filter( $caption_class ) ) ), $others_html );
|
31 |
|
32 |
echo implode( "\n", $html );
|