Version Description
- May 27 2016 =
- New: Add setting to configure responsive output for Mobile, Tablet devices easily
- Update: Hide all notices of other plugins in Add/Edit View page
- Improvement: Faster performance with optimized core filter "item_col_class"
Download this release
Release Info
Developer | PT Guy |
Plugin | Content Views – Post Grid & List for WordPress |
Version | 1.8.5 |
Comparing to | |
See all releases |
Code changes from version 1.8.4.1 to 1.8.5
- README.txt +6 -1
- admin/assets/css/admin.css +4 -1
- admin/views/view.php +39 -2
- content-views.php +2 -2
- includes/functions.php +23 -22
- includes/hooks.php +28 -11
- includes/html-viewtype.php +11 -4
- includes/html.php +1 -1
- includes/values.php +1 -1
- languages/content-views-query-and-display-post-page.po +47 -45
- public/assets/css/public.css +28 -6
- public/assets/js/public.js +9 -1
- public/content-views.php +32 -43
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, post grid, grid, grid post, recent post, page, query, column, author, category, tag, responsive, excerpt, title, taxonomy, thumbnail, pagination, date, scrollable, collapsible
|
5 |
Requires at least: 3.3
|
6 |
Tested up to: 4.5.2
|
7 |
-
Stable tag: 1.8.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -128,6 +128,11 @@ If you are using "Your latest posts" as home page, you should paste this code `<
|
|
128 |
|
129 |
== Changelog ==
|
130 |
|
|
|
|
|
|
|
|
|
|
|
131 |
= 1.8.4.1 - May 11 2016 =
|
132 |
* Fix: [View dashboard] Term boxes under "Select taxonomy" panel are not shown after saving View
|
133 |
|
4 |
Tags: post, post grid, grid, grid post, recent post, page, query, column, author, category, tag, responsive, excerpt, title, taxonomy, thumbnail, pagination, date, scrollable, collapsible
|
5 |
Requires at least: 3.3
|
6 |
Tested up to: 4.5.2
|
7 |
+
Stable tag: 1.8.5
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
128 |
|
129 |
== Changelog ==
|
130 |
|
131 |
+
= 1.8.5 - May 27 2016 =
|
132 |
+
* New: Add setting to configure responsive output for Mobile, Tablet devices easily
|
133 |
+
* Update: Hide all notices of other plugins in Add/Edit View page
|
134 |
+
* Improvement: Faster performance with optimized core filter "item_col_class"
|
135 |
+
|
136 |
= 1.8.4.1 - May 11 2016 =
|
137 |
* Fix: [View dashboard] Term boxes under "Select taxonomy" panel are not shown after saving View
|
138 |
|
admin/assets/css/admin.css
CHANGED
@@ -10,7 +10,7 @@
|
|
10 |
|
11 |
/* Overwrite WP */
|
12 |
.wrap .updated,
|
13 |
-
.wrap .
|
14 |
.update-nag {
|
15 |
display: none;
|
16 |
}
|
@@ -68,6 +68,9 @@ html {
|
|
68 |
.hide {
|
69 |
display: none;
|
70 |
}
|
|
|
|
|
|
|
71 |
|
72 |
/* Fix style bug */
|
73 |
#pt-cv-form-view .nav {
|
10 |
|
11 |
/* Overwrite WP */
|
12 |
.wrap .updated,
|
13 |
+
.wrap .notice,
|
14 |
.update-nag {
|
15 |
display: none;
|
16 |
}
|
68 |
.hide {
|
69 |
display: none;
|
70 |
}
|
71 |
+
.control-label {
|
72 |
+
padding-right: 0 !important;
|
73 |
+
}
|
74 |
|
75 |
/* Fix style bug */
|
76 |
#pt-cv-form-view .nav {
|
admin/views/view.php
CHANGED
@@ -504,8 +504,45 @@ PT_CV_Functions::view_submit();
|
|
504 |
),
|
505 |
),
|
506 |
),
|
507 |
-
apply_filters( PT_CV_PREFIX_ . '
|
508 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
509 |
array(
|
510 |
'label' => array(
|
511 |
'text' => __( 'Layout format', 'content-views-query-and-display-post-page' ),
|
504 |
),
|
505 |
),
|
506 |
),
|
507 |
+
apply_filters( PT_CV_PREFIX_ . 'more_responsive_settings', array(
|
508 |
+
'label' => array(
|
509 |
+
'text' => __( 'Responsive settings', 'content-views-query-and-display-post-page' ),
|
510 |
+
),
|
511 |
+
'params' => array(
|
512 |
+
array(
|
513 |
+
'type' => 'group',
|
514 |
+
'params' => array(
|
515 |
+
array(
|
516 |
+
'label' => array(
|
517 |
+
'text' => sprintf( '%s (%s)', __( 'Items per row', 'content-views-query-and-display-post-page' ), __( 'Tablet', 'content-views-query-and-display-post-page' ) ),
|
518 |
+
),
|
519 |
+
'params' => array(
|
520 |
+
array(
|
521 |
+
'type' => 'number',
|
522 |
+
'name' => 'resp-tablet-number-columns',
|
523 |
+
'std' => '2',
|
524 |
+
'append_text' => '1 → 4',
|
525 |
+
),
|
526 |
+
),
|
527 |
+
),
|
528 |
+
array(
|
529 |
+
'label' => array(
|
530 |
+
'text' => sprintf( '%s (%s)', __( 'Items per row', 'content-views-query-and-display-post-page' ), __( 'Mobile', 'content-views-query-and-display-post-page' ) ),
|
531 |
+
),
|
532 |
+
'params' => array(
|
533 |
+
array(
|
534 |
+
'type' => 'number',
|
535 |
+
'name' => 'resp-number-columns',
|
536 |
+
'std' => '1',
|
537 |
+
'append_text' => '1 → 4',
|
538 |
+
),
|
539 |
+
),
|
540 |
+
),
|
541 |
+
),
|
542 |
+
),
|
543 |
+
),
|
544 |
+
'dependence' => array( 'view-type', !get_option( 'pt_cv_version_pro' ) ? array( 'grid' ) : array( 'grid', 'scrollable', 'pinterest', 'glossary' ) ),
|
545 |
+
) ),
|
546 |
array(
|
547 |
'label' => array(
|
548 |
'text' => __( 'Layout format', 'content-views-query-and-display-post-page' ),
|
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.8.
|
15 |
* Author: PT Guy
|
16 |
* Author URI: http://profiles.wordpress.org/pt-guy
|
17 |
* Text Domain: content-views-query-and-display-post-page
|
@@ -26,7 +26,7 @@ if ( !defined( 'WPINC' ) ) {
|
|
26 |
}
|
27 |
|
28 |
// Define Constant
|
29 |
-
define( 'PT_CV_VERSION', '1.8.
|
30 |
define( 'PT_CV_FILE', __FILE__ );
|
31 |
define( 'PT_CV_PATH', plugin_dir_path( __FILE__ ) );
|
32 |
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.8.5
|
15 |
* Author: PT Guy
|
16 |
* Author URI: http://profiles.wordpress.org/pt-guy
|
17 |
* Text Domain: content-views-query-and-display-post-page
|
26 |
}
|
27 |
|
28 |
// Define Constant
|
29 |
+
define( 'PT_CV_VERSION', '1.8.5' );
|
30 |
define( 'PT_CV_FILE', __FILE__ );
|
31 |
define( 'PT_CV_PATH', plugin_dir_path( __FILE__ ) );
|
32 |
include_once( PT_CV_PATH . 'includes/defines.php' );
|
includes/functions.php
CHANGED
@@ -428,36 +428,29 @@ if ( !class_exists( 'PT_CV_Functions' ) ) {
|
|
428 |
* @return string
|
429 |
*/
|
430 |
static function post_terms( $post ) {
|
431 |
-
global $pt_cv_glb
|
432 |
|
433 |
if ( !isset( $pt_cv_glb[ 'item_terms' ] ) ) {
|
434 |
$pt_cv_glb[ 'item_terms' ] = array();
|
435 |
}
|
436 |
|
437 |
-
|
438 |
-
$
|
439 |
-
|
440 |
-
|
441 |
-
$
|
442 |
-
|
443 |
-
// List of taxonomies to show
|
444 |
-
$taxonomies_to_show = apply_filters( PT_CV_PREFIX_ . 'taxonomies_to_show', $taxonomies );
|
445 |
-
|
446 |
-
// Get post ID
|
447 |
-
$post_id = is_object( $post ) ? $post->ID : $post;
|
448 |
-
|
449 |
-
// Get lists of terms of this post
|
450 |
-
$terms = wp_get_object_terms( $post_id, $taxonomies );
|
451 |
|
452 |
foreach ( $terms as $term ) {
|
453 |
-
$
|
454 |
-
|
|
|
455 |
$href = esc_url( get_term_link( $term, $term->taxonomy ) );
|
456 |
$text = __( 'View all posts in', 'content-views-query-and-display-post-page' );
|
457 |
$term_name = esc_attr( $term->name );
|
458 |
$class = esc_attr( PT_CV_PREFIX . 'tax-' . PT_CV_Functions::term_slug_sanitize( $term->slug ) );
|
459 |
-
$term_html = "<a href='$href' title='$text $term_name' class='$class'>{$term->name}</a>";
|
460 |
-
$links[] =
|
461 |
}
|
462 |
|
463 |
// Add this term to terms list of an item
|
@@ -465,10 +458,15 @@ if ( !class_exists( 'PT_CV_Functions' ) ) {
|
|
465 |
$pt_cv_glb[ 'item_terms' ][ $post_id ] = array();
|
466 |
}
|
467 |
$pt_cv_glb[ 'item_terms' ][ $post_id ][ PT_CV_Functions::term_slug_sanitize( $term->slug ) ] = $term->name;
|
|
|
|
|
|
|
|
|
|
|
|
|
468 |
}
|
469 |
|
470 |
-
|
471 |
-
return implode( $separator, apply_filters( PT_CV_PREFIX_ . 'terms_list', $links, $pt_cv_id ) );
|
472 |
}
|
473 |
|
474 |
/**
|
@@ -725,7 +723,10 @@ if ( !class_exists( 'PT_CV_Functions' ) ) {
|
|
725 |
|
726 |
// Output pagination
|
727 |
if ( (int) $max_num_pages > 0 ) {
|
728 |
-
$
|
|
|
|
|
|
|
729 |
}
|
730 |
}
|
731 |
}
|
428 |
* @return string
|
429 |
*/
|
430 |
static function post_terms( $post ) {
|
431 |
+
global $pt_cv_glb;
|
432 |
|
433 |
if ( !isset( $pt_cv_glb[ 'item_terms' ] ) ) {
|
434 |
$pt_cv_glb[ 'item_terms' ] = array();
|
435 |
}
|
436 |
|
437 |
+
$links = array();
|
438 |
+
$taxonomy_terms = array();
|
439 |
+
$taxonomies = get_taxonomies( '', 'names' );
|
440 |
+
$taxonomies_to_show = apply_filters( PT_CV_PREFIX_ . 'taxonomies_to_show', $taxonomies );
|
441 |
+
$post_id = is_object( $post ) ? $post->ID : $post;
|
442 |
+
$terms = wp_get_object_terms( $post_id, $taxonomies );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
443 |
|
444 |
foreach ( $terms as $term ) {
|
445 |
+
$term_html = '';
|
446 |
+
$include_this = apply_filters( PT_CV_PREFIX_ . 'terms_include_this', true, $term ) && in_array( $term->taxonomy, $taxonomies_to_show );
|
447 |
+
if ( $include_this ) {
|
448 |
$href = esc_url( get_term_link( $term, $term->taxonomy ) );
|
449 |
$text = __( 'View all posts in', 'content-views-query-and-display-post-page' );
|
450 |
$term_name = esc_attr( $term->name );
|
451 |
$class = esc_attr( PT_CV_PREFIX . 'tax-' . PT_CV_Functions::term_slug_sanitize( $term->slug ) );
|
452 |
+
$term_html = apply_filters( PT_CV_PREFIX_ . 'post_term_html', "<a href='$href' title='$text $term_name' class='$class'>{$term->name}</a>", $term );
|
453 |
+
$links[] = $term_html;
|
454 |
}
|
455 |
|
456 |
// Add this term to terms list of an item
|
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 |
+
// Add this term to terms list of an item
|
463 |
+
if ( !isset( $taxonomy_terms[ $term->taxonomy ] ) ) {
|
464 |
+
$taxonomy_terms[ $term->taxonomy ] = array();
|
465 |
+
}
|
466 |
+
$taxonomy_terms[ $term->taxonomy ][] = $term_html;
|
467 |
}
|
468 |
|
469 |
+
return apply_filters( PT_CV_PREFIX_ . 'post_terms_output', implode( ', ', $links ), $links, $taxonomy_terms );
|
|
|
470 |
}
|
471 |
|
472 |
/**
|
723 |
|
724 |
// Output pagination
|
725 |
if ( (int) $max_num_pages > 0 ) {
|
726 |
+
$pagination_html = PT_CV_Html::pagination_output( $max_num_pages, $current_page, $view_id );
|
727 |
+
$before_view = apply_filters( PT_CV_PREFIX_ . 'pagination_before_view', false ) ? $pagination_html . "\n" : '';
|
728 |
+
$after_view = apply_filters( PT_CV_PREFIX_ . 'pagination_after_view', true ) ? "\n" . $pagination_html : '';
|
729 |
+
$html = $before_view . $html . $after_view;
|
730 |
}
|
731 |
}
|
732 |
}
|
includes/hooks.php
CHANGED
@@ -21,6 +21,7 @@ if ( !class_exists( 'PT_CV_Hooks' ) ) {
|
|
21 |
static function init() {
|
22 |
add_filter( PT_CV_PREFIX_ . 'validate_settings', array( __CLASS__, 'filter_validate_settings' ), 10, 2 );
|
23 |
add_filter( PT_CV_PREFIX_ . 'field_content_excerpt', array( __CLASS__, 'filter_field_content_excerpt' ), 9, 3 );
|
|
|
24 |
|
25 |
/**
|
26 |
* @since 1.7.5
|
@@ -64,20 +65,14 @@ if ( !class_exists( 'PT_CV_Hooks' ) ) {
|
|
64 |
),
|
65 |
);
|
66 |
|
67 |
-
/**
|
68 |
-
* Validate Query parameters
|
69 |
-
*/
|
70 |
// Post type
|
71 |
if ( empty( $args[ 'post_type' ] ) ) {
|
72 |
$errors[] = $messages[ 'field' ][ 'select' ] . $messages[ 'tab' ][ 'filter' ] . ' > ' . __( 'Content type', 'content-views-query-and-display-post-page' );
|
73 |
}
|
74 |
|
75 |
-
/**
|
76 |
-
* Validate common Display parameters
|
77 |
-
*/
|
78 |
// View type
|
79 |
if ( empty( $dargs[ 'view-type' ] ) ) {
|
80 |
-
$errors[] = $messages[ 'field' ][ 'select' ] . $messages[ 'tab' ][ 'display' ] . ' > ' . __( 'View type', 'content-views-query-and-display-post-page' );
|
81 |
}
|
82 |
|
83 |
// Layout format
|
@@ -87,7 +82,7 @@ if ( !class_exists( 'PT_CV_Hooks' ) ) {
|
|
87 |
|
88 |
// Field settings
|
89 |
if ( !isset( $dargs[ 'fields' ] ) ) {
|
90 |
-
$errors[] = $messages[ 'field' ][ 'select' ] . $messages[ 'tab' ][ 'display' ] . ' > ' . __( 'Fields
|
91 |
}
|
92 |
|
93 |
// Item per page
|
@@ -97,9 +92,6 @@ if ( !class_exists( 'PT_CV_Hooks' ) ) {
|
|
97 |
}
|
98 |
}
|
99 |
|
100 |
-
/**
|
101 |
-
* Validate Display parameters of view types
|
102 |
-
*/
|
103 |
if ( !empty( $dargs[ 'view-type' ] ) ) {
|
104 |
switch ( $dargs[ 'view-type' ] ) {
|
105 |
case 'grid':
|
@@ -134,6 +126,31 @@ if ( !class_exists( 'PT_CV_Hooks' ) ) {
|
|
134 |
return $args;
|
135 |
}
|
136 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
137 |
// Disable WP 4.4 responsive image
|
138 |
public static function filter_disable_wp_responsive_image( $args ) {
|
139 |
if ( PT_CV_Html::is_responsive_image_disabled() ) {
|
21 |
static function init() {
|
22 |
add_filter( PT_CV_PREFIX_ . 'validate_settings', array( __CLASS__, 'filter_validate_settings' ), 10, 2 );
|
23 |
add_filter( PT_CV_PREFIX_ . 'field_content_excerpt', array( __CLASS__, 'filter_field_content_excerpt' ), 9, 3 );
|
24 |
+
add_filter( PT_CV_PREFIX_ . 'item_col_class', array( __CLASS__, 'filter_item_col_class' ), 20, 2 );
|
25 |
|
26 |
/**
|
27 |
* @since 1.7.5
|
65 |
),
|
66 |
);
|
67 |
|
|
|
|
|
|
|
68 |
// Post type
|
69 |
if ( empty( $args[ 'post_type' ] ) ) {
|
70 |
$errors[] = $messages[ 'field' ][ 'select' ] . $messages[ 'tab' ][ 'filter' ] . ' > ' . __( 'Content type', 'content-views-query-and-display-post-page' );
|
71 |
}
|
72 |
|
|
|
|
|
|
|
73 |
// View type
|
74 |
if ( empty( $dargs[ 'view-type' ] ) ) {
|
75 |
+
$errors[] = $messages[ 'field' ][ 'select' ] . $messages[ 'tab' ][ 'display' ] . ' > ' . __( 'View type (Layout)', 'content-views-query-and-display-post-page' );
|
76 |
}
|
77 |
|
78 |
// Layout format
|
82 |
|
83 |
// Field settings
|
84 |
if ( !isset( $dargs[ 'fields' ] ) ) {
|
85 |
+
$errors[] = $messages[ 'field' ][ 'select' ] . $messages[ 'tab' ][ 'display' ] . ' > ' . __( 'Fields settings', 'content-views-query-and-display-post-page' );
|
86 |
}
|
87 |
|
88 |
// Item per page
|
92 |
}
|
93 |
}
|
94 |
|
|
|
|
|
|
|
95 |
if ( !empty( $dargs[ 'view-type' ] ) ) {
|
96 |
switch ( $dargs[ 'view-type' ] ) {
|
97 |
case 'grid':
|
126 |
return $args;
|
127 |
}
|
128 |
|
129 |
+
/**
|
130 |
+
* Filter span with
|
131 |
+
* @since 1.8.5
|
132 |
+
*
|
133 |
+
* @param array $args
|
134 |
+
* @param int $span_width
|
135 |
+
*
|
136 |
+
* @return array
|
137 |
+
*/
|
138 |
+
public static function filter_item_col_class( $args, $span_width ) {
|
139 |
+
// In CV: apply for Grid only
|
140 |
+
if ( PT_CV_Functions::get_global_variable( 'view_type' ) === 'grid' ) {
|
141 |
+
// If was not applied in CVPro
|
142 |
+
if ( array_key_exists( 'pt_cv_item_col_class', $GLOBALS[ 'wp_filter' ] ) && count( $GLOBALS[ 'wp_filter' ][ 'pt_cv_item_col_class' ] ) == 1 ) {
|
143 |
+
$tablet_col = (int) PT_CV_Functions::setting_value( PT_CV_PREFIX . 'resp-tablet-number-columns' );
|
144 |
+
$mobile_col = (int) PT_CV_Functions::setting_value( PT_CV_PREFIX . 'resp-number-columns' );
|
145 |
+
|
146 |
+
$args[] = 'col-sm-' . (int) ( 12 / ($tablet_col ? $tablet_col : 2) );
|
147 |
+
$args[] = 'col-xs-' . (int) ( 12 / ($mobile_col ? $mobile_col : 1) );
|
148 |
+
}
|
149 |
+
}
|
150 |
+
|
151 |
+
return $args;
|
152 |
+
}
|
153 |
+
|
154 |
// Disable WP 4.4 responsive image
|
155 |
public static function filter_disable_wp_responsive_image( $args ) {
|
156 |
if ( PT_CV_Html::is_responsive_image_disabled() ) {
|
includes/html-viewtype.php
CHANGED
@@ -68,6 +68,9 @@ if ( !class_exists( 'PT_CV_Html_ViewType' ) ) {
|
|
68 |
// Split items to rows
|
69 |
$columns_item = array_chunk( $content_items, $columns, true );
|
70 |
|
|
|
|
|
|
|
71 |
// Get HTML of each row
|
72 |
foreach ( $columns_item as $items_per_row ) {
|
73 |
$row_html = array();
|
@@ -78,7 +81,7 @@ if ( !class_exists( 'PT_CV_Html_ViewType' ) ) {
|
|
78 |
$_span_width = ( $count == $columns && $idx + 1 == $count ) ? $span_width_last : $span_width;
|
79 |
|
80 |
// Wrap content of item
|
81 |
-
$item_classes =
|
82 |
$item_class = implode( ' ', array_filter( $item_classes ) );
|
83 |
$row_html[] = PT_CV_Html::content_item_wrap( $content_item, $item_class, $post_id );
|
84 |
|
@@ -191,6 +194,9 @@ if ( !class_exists( 'PT_CV_Html_ViewType' ) ) {
|
|
191 |
// Get wrapper class of a scrollable slide
|
192 |
$slide_class = apply_filters( PT_CV_PREFIX_ . 'scrollable_slide_class', 'item' );
|
193 |
|
|
|
|
|
|
|
194 |
// Split items to slide
|
195 |
$slides_item = array_chunk( $content_items, $columns * $rows );
|
196 |
$pids = array_keys( $content_items );
|
@@ -212,9 +218,10 @@ if ( !class_exists( 'PT_CV_Html_ViewType' ) ) {
|
|
212 |
$_span_width = ( $count == $columns && $idx + 1 == $count ) ? $span_width_last : $span_width;
|
213 |
|
214 |
// Wrap content of item
|
215 |
-
$item_classes
|
216 |
-
|
217 |
-
$
|
|
|
218 |
}
|
219 |
|
220 |
$slide_html[] = implode( "\n", $row_html );
|
68 |
// Split items to rows
|
69 |
$columns_item = array_chunk( $content_items, $columns, true );
|
70 |
|
71 |
+
// Get responsive class
|
72 |
+
$res_class = apply_filters( PT_CV_PREFIX_ . 'item_col_class', array(), 6 );
|
73 |
+
|
74 |
// Get HTML of each row
|
75 |
foreach ( $columns_item as $items_per_row ) {
|
76 |
$row_html = array();
|
81 |
$_span_width = ( $count == $columns && $idx + 1 == $count ) ? $span_width_last : $span_width;
|
82 |
|
83 |
// Wrap content of item
|
84 |
+
$item_classes = array_merge( array( $span_class . $_span_width, $class ), $res_class );
|
85 |
$item_class = implode( ' ', array_filter( $item_classes ) );
|
86 |
$row_html[] = PT_CV_Html::content_item_wrap( $content_item, $item_class, $post_id );
|
87 |
|
194 |
// Get wrapper class of a scrollable slide
|
195 |
$slide_class = apply_filters( PT_CV_PREFIX_ . 'scrollable_slide_class', 'item' );
|
196 |
|
197 |
+
// Get responsive class
|
198 |
+
$res_class = apply_filters( PT_CV_PREFIX_ . 'item_col_class', array(), 6 );
|
199 |
+
|
200 |
// Split items to slide
|
201 |
$slides_item = array_chunk( $content_items, $columns * $rows );
|
202 |
$pids = array_keys( $content_items );
|
218 |
$_span_width = ( $count == $columns && $idx + 1 == $count ) ? $span_width_last : $span_width;
|
219 |
|
220 |
// Wrap content of item
|
221 |
+
$item_classes = array_merge( array( $span_class . $_span_width ), $res_class );
|
222 |
+
|
223 |
+
$item_class = implode( ' ', array_filter( $item_classes ) );
|
224 |
+
$row_html[] = PT_CV_Html::content_item_wrap( $content_item, $item_class, $pids[ $pidx++ ] );
|
225 |
}
|
226 |
|
227 |
$slide_html[] = implode( "\n", $row_html );
|
includes/html.php
CHANGED
@@ -115,7 +115,7 @@ if ( !class_exists( 'PT_CV_Html' ) ) {
|
|
115 |
* @return type
|
116 |
*/
|
117 |
static function html_loading_img( $dimension = 15, $class = '' ) {
|
118 |
-
$img = sprintf( '<img width="%1$s" height="%1$s" class="%2$s" alt="%3$s" src="%4$s" /><div class="clear %5$s"></div>', esc_attr( $dimension ), esc_attr( $class ), __( 'Loading
|
119 |
|
120 |
return apply_filters( PT_CV_PREFIX_ . 'loading_image', $img );
|
121 |
}
|
115 |
* @return type
|
116 |
*/
|
117 |
static function html_loading_img( $dimension = 15, $class = '' ) {
|
118 |
+
$img = sprintf( '<img width="%1$s" height="%1$s" class="%2$s" alt="%3$s" src="%4$s" /><div class="clear %5$s"></div>', esc_attr( $dimension ), esc_attr( $class ), __( 'Loading...', 'content-views-query-and-display-post-page' ), self::loading_img_src(), PT_CV_PREFIX . 'clear-pagination' );
|
119 |
|
120 |
return apply_filters( PT_CV_PREFIX_ . 'loading_image', $img );
|
121 |
}
|
includes/values.php
CHANGED
@@ -168,7 +168,7 @@ if ( !class_exists( 'PT_CV_Values' ) ) {
|
|
168 |
// Sort values of param by saved order
|
169 |
$term_slug_name = apply_filters( PT_CV_PREFIX_ . 'settings_sort_single', $term_slug_name, $taxonomy . '-' . 'terms' );
|
170 |
|
171 |
-
$terms_of_taxonomies[ $taxonomy ] = $term_slug_name;
|
172 |
}
|
173 |
|
174 |
/**
|
168 |
// Sort values of param by saved order
|
169 |
$term_slug_name = apply_filters( PT_CV_PREFIX_ . 'settings_sort_single', $term_slug_name, $taxonomy . '-' . 'terms' );
|
170 |
|
171 |
+
$terms_of_taxonomies[ $taxonomy ] = array_filter( $term_slug_name ); /* prevent term with empty name */
|
172 |
}
|
173 |
|
174 |
/**
|
languages/content-views-query-and-display-post-page.po
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: Content Views\n"
|
4 |
-
"POT-Creation-Date: 2016-05-
|
5 |
-
"PO-Revision-Date: 2016-05-
|
6 |
"Last-Translator: \n"
|
7 |
"Language-Team: PT Guy <support@contentviewspro.com>\n"
|
8 |
"MIME-Version: 1.0\n"
|
@@ -48,11 +48,11 @@ msgstr ""
|
|
48 |
msgid "Content Views"
|
49 |
msgstr ""
|
50 |
|
51 |
-
#: code/admin/content-views-admin.php:300 code/public/content-views.php:
|
52 |
msgid "All Views"
|
53 |
msgstr ""
|
54 |
|
55 |
-
#: code/admin/content-views-admin.php:304 code/public/content-views.php:
|
56 |
msgid "Add New View"
|
57 |
msgstr ""
|
58 |
|
@@ -79,7 +79,7 @@ msgstr ""
|
|
79 |
msgid "Date"
|
80 |
msgstr ""
|
81 |
|
82 |
-
#: code/admin/views/view.php:36 code/public/content-views.php:
|
83 |
msgid "Edit View"
|
84 |
msgstr ""
|
85 |
|
@@ -100,19 +100,19 @@ msgstr ""
|
|
100 |
msgid "Enter a name to identify your views easily"
|
101 |
msgstr ""
|
102 |
|
103 |
-
#: code/admin/views/view.php:117 code/admin/views/view.php:
|
104 |
msgid "Save"
|
105 |
msgstr ""
|
106 |
|
107 |
-
#: code/admin/views/view.php:124 code/includes/hooks.php:
|
108 |
msgid "Filter Settings"
|
109 |
msgstr ""
|
110 |
|
111 |
-
#: code/admin/views/view.php:128 code/includes/hooks.php:
|
112 |
msgid "Display Settings"
|
113 |
msgstr ""
|
114 |
|
115 |
-
#: code/admin/views/view.php:143 code/includes/hooks.php:
|
116 |
msgid "Content type"
|
117 |
msgstr ""
|
118 |
|
@@ -224,81 +224,83 @@ msgstr ""
|
|
224 |
msgid "Enter keyword to searching for posts"
|
225 |
msgstr ""
|
226 |
|
227 |
-
#: code/admin/views/view.php:480 code/includes/hooks.php:
|
|
|
228 |
msgid "View type (Layout)"
|
229 |
msgstr ""
|
230 |
|
231 |
-
#: code/admin/views/view.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
232 |
msgid "Layout format"
|
233 |
msgstr ""
|
234 |
|
235 |
-
#: code/admin/views/view.php:
|
236 |
msgid "Disable this format on mobile devices & extra small screens"
|
237 |
msgstr ""
|
238 |
|
239 |
-
#: code/admin/views/view.php:
|
240 |
msgid "Fields settings"
|
241 |
msgstr ""
|
242 |
|
243 |
-
#: code/admin/views/view.php:
|
244 |
msgid "Pagination"
|
245 |
msgstr ""
|
246 |
|
247 |
-
#: code/admin/views/view.php:
|
248 |
msgid "Others"
|
249 |
msgstr ""
|
250 |
|
251 |
-
#: code/includes/functions.php:
|
252 |
msgid "View all posts in"
|
253 |
msgstr ""
|
254 |
|
255 |
-
#: code/includes/functions.php:
|
256 |
msgid "(no title)"
|
257 |
msgstr ""
|
258 |
|
259 |
-
#: code/includes/functions.php:
|
260 |
msgid "Cheatin’ uh?"
|
261 |
msgstr ""
|
262 |
|
263 |
-
#: code/includes/functions.php:
|
264 |
#, php-format
|
265 |
msgid "Empty settings (View %s is not existed)"
|
266 |
msgstr ""
|
267 |
|
268 |
-
#: code/includes/hooks.php:
|
269 |
msgid "Please select an option in"
|
270 |
msgstr ""
|
271 |
|
272 |
-
#: code/includes/hooks.php:
|
273 |
msgid "Please set value in"
|
274 |
msgstr ""
|
275 |
|
276 |
-
#: code/includes/hooks.php:
|
277 |
-
msgid "View type"
|
278 |
-
msgstr ""
|
279 |
-
|
280 |
-
#: code/includes/hooks.php:90
|
281 |
-
msgid "Fields"
|
282 |
-
msgstr ""
|
283 |
-
|
284 |
-
#: code/includes/hooks.php:90
|
285 |
-
msgid "Fields display"
|
286 |
-
msgstr ""
|
287 |
-
|
288 |
-
#: code/includes/hooks.php:96 code/includes/settings.php:152
|
289 |
msgid "Items per page"
|
290 |
msgstr ""
|
291 |
|
292 |
-
#: code/includes/hooks.php:107 code/includes/settings.php:736
|
293 |
-
msgid "Items per row"
|
294 |
-
msgstr ""
|
295 |
-
|
296 |
#: code/includes/html.php:79
|
297 |
msgid "Click to toggle"
|
298 |
msgstr ""
|
299 |
|
300 |
#: code/includes/html.php:118
|
301 |
-
msgid "Loading
|
302 |
msgstr ""
|
303 |
|
304 |
#: code/includes/html.php:249
|
@@ -669,26 +671,26 @@ msgstr ""
|
|
669 |
msgid "Right"
|
670 |
msgstr ""
|
671 |
|
672 |
-
#: code/public/content-views.php:
|
673 |
msgid "New View"
|
674 |
msgstr ""
|
675 |
|
676 |
-
#: code/public/content-views.php:
|
677 |
msgid "View View"
|
678 |
msgstr ""
|
679 |
|
680 |
-
#: code/public/content-views.php:
|
681 |
msgid "Search Views"
|
682 |
msgstr ""
|
683 |
|
684 |
-
#: code/public/content-views.php:
|
685 |
msgid "Parent Views:"
|
686 |
msgstr ""
|
687 |
|
688 |
-
#: code/public/content-views.php:
|
689 |
msgid "No views found."
|
690 |
msgstr ""
|
691 |
|
692 |
-
#: code/public/content-views.php:
|
693 |
msgid "No views found in Trash."
|
694 |
msgstr ""
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: Content Views\n"
|
4 |
+
"POT-Creation-Date: 2016-05-27 16:04+0700\n"
|
5 |
+
"PO-Revision-Date: 2016-05-27 16:04+0700\n"
|
6 |
"Last-Translator: \n"
|
7 |
"Language-Team: PT Guy <support@contentviewspro.com>\n"
|
8 |
"MIME-Version: 1.0\n"
|
48 |
msgid "Content Views"
|
49 |
msgstr ""
|
50 |
|
51 |
+
#: code/admin/content-views-admin.php:300 code/public/content-views.php:281
|
52 |
msgid "All Views"
|
53 |
msgstr ""
|
54 |
|
55 |
+
#: code/admin/content-views-admin.php:304 code/public/content-views.php:277
|
56 |
msgid "Add New View"
|
57 |
msgstr ""
|
58 |
|
79 |
msgid "Date"
|
80 |
msgstr ""
|
81 |
|
82 |
+
#: code/admin/views/view.php:36 code/public/content-views.php:279
|
83 |
msgid "Edit View"
|
84 |
msgstr ""
|
85 |
|
100 |
msgid "Enter a name to identify your views easily"
|
101 |
msgstr ""
|
102 |
|
103 |
+
#: code/admin/views/view.php:117 code/admin/views/view.php:669
|
104 |
msgid "Save"
|
105 |
msgstr ""
|
106 |
|
107 |
+
#: code/admin/views/view.php:124 code/includes/hooks.php:63
|
108 |
msgid "Filter Settings"
|
109 |
msgstr ""
|
110 |
|
111 |
+
#: code/admin/views/view.php:128 code/includes/hooks.php:64
|
112 |
msgid "Display Settings"
|
113 |
msgstr ""
|
114 |
|
115 |
+
#: code/admin/views/view.php:143 code/includes/hooks.php:70
|
116 |
msgid "Content type"
|
117 |
msgstr ""
|
118 |
|
224 |
msgid "Enter keyword to searching for posts"
|
225 |
msgstr ""
|
226 |
|
227 |
+
#: code/admin/views/view.php:480 code/includes/hooks.php:75
|
228 |
+
#: code/includes/hooks.php:99
|
229 |
msgid "View type (Layout)"
|
230 |
msgstr ""
|
231 |
|
232 |
+
#: code/admin/views/view.php:509
|
233 |
+
msgid "Responsive settings"
|
234 |
+
msgstr ""
|
235 |
+
|
236 |
+
#: code/admin/views/view.php:517 code/admin/views/view.php:530
|
237 |
+
#: code/includes/hooks.php:99 code/includes/settings.php:736
|
238 |
+
msgid "Items per row"
|
239 |
+
msgstr ""
|
240 |
+
|
241 |
+
#: code/admin/views/view.php:517
|
242 |
+
msgid "Tablet"
|
243 |
+
msgstr ""
|
244 |
+
|
245 |
+
#: code/admin/views/view.php:530
|
246 |
+
msgid "Mobile"
|
247 |
+
msgstr ""
|
248 |
+
|
249 |
+
#: code/admin/views/view.php:548 code/includes/hooks.php:80
|
250 |
msgid "Layout format"
|
251 |
msgstr ""
|
252 |
|
253 |
+
#: code/admin/views/view.php:590
|
254 |
msgid "Disable this format on mobile devices & extra small screens"
|
255 |
msgstr ""
|
256 |
|
257 |
+
#: code/admin/views/view.php:603 code/includes/hooks.php:85
|
258 |
msgid "Fields settings"
|
259 |
msgstr ""
|
260 |
|
261 |
+
#: code/admin/views/view.php:621 code/includes/hooks.php:91
|
262 |
msgid "Pagination"
|
263 |
msgstr ""
|
264 |
|
265 |
+
#: code/admin/views/view.php:638
|
266 |
msgid "Others"
|
267 |
msgstr ""
|
268 |
|
269 |
+
#: code/includes/functions.php:449
|
270 |
msgid "View all posts in"
|
271 |
msgstr ""
|
272 |
|
273 |
+
#: code/includes/functions.php:516 code/includes/html.php:430
|
274 |
msgid "(no title)"
|
275 |
msgstr ""
|
276 |
|
277 |
+
#: code/includes/functions.php:580
|
278 |
msgid "Cheatin’ uh?"
|
279 |
msgstr ""
|
280 |
|
281 |
+
#: code/includes/functions.php:618
|
282 |
#, php-format
|
283 |
msgid "Empty settings (View %s is not existed)"
|
284 |
msgstr ""
|
285 |
|
286 |
+
#: code/includes/hooks.php:59
|
287 |
msgid "Please select an option in"
|
288 |
msgstr ""
|
289 |
|
290 |
+
#: code/includes/hooks.php:60
|
291 |
msgid "Please set value in"
|
292 |
msgstr ""
|
293 |
|
294 |
+
#: code/includes/hooks.php:91 code/includes/settings.php:152
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
295 |
msgid "Items per page"
|
296 |
msgstr ""
|
297 |
|
|
|
|
|
|
|
|
|
298 |
#: code/includes/html.php:79
|
299 |
msgid "Click to toggle"
|
300 |
msgstr ""
|
301 |
|
302 |
#: code/includes/html.php:118
|
303 |
+
msgid "Loading..."
|
304 |
msgstr ""
|
305 |
|
306 |
#: code/includes/html.php:249
|
671 |
msgid "Right"
|
672 |
msgstr ""
|
673 |
|
674 |
+
#: code/public/content-views.php:278
|
675 |
msgid "New View"
|
676 |
msgstr ""
|
677 |
|
678 |
+
#: code/public/content-views.php:280
|
679 |
msgid "View View"
|
680 |
msgstr ""
|
681 |
|
682 |
+
#: code/public/content-views.php:282
|
683 |
msgid "Search Views"
|
684 |
msgstr ""
|
685 |
|
686 |
+
#: code/public/content-views.php:283
|
687 |
msgid "Parent Views:"
|
688 |
msgstr ""
|
689 |
|
690 |
+
#: code/public/content-views.php:284
|
691 |
msgid "No views found."
|
692 |
msgstr ""
|
693 |
|
694 |
+
#: code/public/content-views.php:285
|
695 |
msgid "No views found in Trash."
|
696 |
msgstr ""
|
public/assets/css/public.css
CHANGED
@@ -62,13 +62,35 @@
|
|
62 |
clear: left !important;
|
63 |
}
|
64 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
@media (min-width: 992px) {
|
66 |
-
.pt-cv-
|
67 |
-
.pt-cv-
|
68 |
-
.pt-cv-
|
69 |
-
.pt-cv-
|
70 |
-
.pt-cv-
|
71 |
-
.pt-cv-
|
72 |
}
|
73 |
|
74 |
/* Link */
|
62 |
clear: left !important;
|
63 |
}
|
64 |
}
|
65 |
+
/* @since 1.8.5 */
|
66 |
+
@media (min-width: 768px) and (max-width: 991px) {
|
67 |
+
.pt-cv-colsys .col-sm-6:nth-child(2n+1),
|
68 |
+
.pt-cv-colsys .col-sm-4:nth-child(3n+1),
|
69 |
+
.pt-cv-colsys .col-sm-3:nth-child(4n+1),
|
70 |
+
.pt-cv-colsys .col-sm-2:nth-child(5n+1),
|
71 |
+
.pt-cv-colsys .col-sm-2:nth-child(6n+1)
|
72 |
+
{
|
73 |
+
clear: left !important;
|
74 |
+
}
|
75 |
+
}
|
76 |
+
|
77 |
+
@media (max-width: 767px) {
|
78 |
+
.pt-cv-colsys .col-xs-6:nth-child(2n+1),
|
79 |
+
.pt-cv-colsys .col-xs-4:nth-child(3n+1),
|
80 |
+
.pt-cv-colsys .col-xs-3:nth-child(4n+1),
|
81 |
+
.pt-cv-colsys .col-xs-2:nth-child(5n+1),
|
82 |
+
.pt-cv-colsys .col-xs-2:nth-child(6n+1)
|
83 |
+
{
|
84 |
+
clear: left !important;
|
85 |
+
}
|
86 |
+
}
|
87 |
@media (min-width: 992px) {
|
88 |
+
.pt-cv-colsys [data-cvc="5"] .pt-cv-content-item {width: 20%}
|
89 |
+
.pt-cv-colsys [data-cvc="7"] .pt-cv-content-item {width: 14.28571428%}
|
90 |
+
.pt-cv-colsys [data-cvc="8"] .pt-cv-content-item {width: 12.5%}
|
91 |
+
.pt-cv-colsys [data-cvc="9"] .pt-cv-content-item {width: 11.11111111%}
|
92 |
+
.pt-cv-colsys [data-cvc="10"] .pt-cv-content-item {width: 10%}
|
93 |
+
.pt-cv-colsys [data-cvc="11"] .pt-cv-content-item {width: 9.09090909%}
|
94 |
}
|
95 |
|
96 |
/* Link */
|
public/assets/js/public.js
CHANGED
@@ -90,7 +90,7 @@
|
|
90 |
}
|
91 |
|
92 |
// Get the View element
|
93 |
-
var pages_holder = pagination_wrapper.
|
94 |
|
95 |
// For Timeline
|
96 |
if ( pages_holder.hasClass( _prefix + 'timeline' ) ) {
|
@@ -200,6 +200,14 @@
|
|
200 |
$( 'html, body' ).animate( {
|
201 |
scrollTop: pages_holder.children( page_selector ).offset().top - 160
|
202 |
}, 1000 );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
203 |
}
|
204 |
|
205 |
return page_existed;
|
90 |
}
|
91 |
|
92 |
// Get the View element
|
93 |
+
var pages_holder = pagination_wrapper.closest( '.' + _prefix + 'wrapper' ).children( '.' + _prefix + 'view' );
|
94 |
|
95 |
// For Timeline
|
96 |
if ( pages_holder.hasClass( _prefix + 'timeline' ) ) {
|
200 |
$( 'html, body' ).animate( {
|
201 |
scrollTop: pages_holder.children( page_selector ).offset().top - 160
|
202 |
}, 1000 );
|
203 |
+
|
204 |
+
// Activate page number before/after View, only work for Numeric pagination w/o Ajax
|
205 |
+
var $paginations = pages_holder.closest( '.' + _prefix + 'wrapper' ).children( '.' + _prefix + 'pagination-wrapper' );
|
206 |
+
if ( $paginations.length === 2 ) {
|
207 |
+
$paginations.each( function () {
|
208 |
+
$( this ).find( 'a' ).eq( selected_page ).trigger( 'click' );
|
209 |
+
} );
|
210 |
+
}
|
211 |
}
|
212 |
|
213 |
return page_existed;
|
public/content-views.php
CHANGED
@@ -242,32 +242,21 @@ class PT_Content_Views {
|
|
242 |
*/
|
243 |
public function load_plugin_textdomain() {
|
244 |
/* In v1.6.8.3, textdomain changed from "content-views" to "content-views-query-and-display-post-page"
|
245 |
-
*
|
246 |
-
* To support existing translation files from before the change, we must look for translation files in several places:
|
247 |
-
*
|
248 |
-
* 1. wp-content/languages/plugins/content-views-query-and-display-post-page (use language packs through translate.wordpress.org)
|
249 |
-
* 2. wp-content/languages/content-views/ (custom folder we have supported since 1.2.4)
|
250 |
-
* 3. wp-content/plugins/content-views-query-and-display-post-page/languages/ (the default language files)
|
251 |
*/
|
252 |
|
253 |
// WPLANG is no longer needed since 4.0
|
254 |
$locale = get_locale();
|
255 |
|
256 |
-
|
257 |
-
$
|
|
|
258 |
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
$cv_lang_dir = dirname( plugin_basename( PT_CV_FILE ) ) . '/languages/';
|
264 |
-
|
265 |
-
if ( file_exists( $custom_mofile ) ) {
|
266 |
-
load_textdomain( 'content-views-query-and-display-post-page', $custom_mofile );
|
267 |
-
} elseif ( file_exists( $language_packs_mofile ) ) {
|
268 |
-
load_textdomain( 'content-views-query-and-display-post-page', $language_packs_mofile );
|
269 |
} else {
|
270 |
-
load_plugin_textdomain( 'content-views-query-and-display-post-page', FALSE, $
|
271 |
}
|
272 |
}
|
273 |
|
@@ -280,35 +269,35 @@ class PT_Content_Views {
|
|
280 |
* Register custom post type : View
|
281 |
*/
|
282 |
$labels = array(
|
283 |
-
'name'
|
284 |
-
'singular_name'
|
285 |
-
'menu_name'
|
286 |
-
'name_admin_bar'
|
287 |
-
'add_new'
|
288 |
-
'add_new_item'
|
289 |
-
'new_item'
|
290 |
-
'edit_item'
|
291 |
-
'view_item'
|
292 |
-
'all_items'
|
293 |
-
'search_items'
|
294 |
-
'parent_item_colon'
|
295 |
-
'not_found'
|
296 |
'not_found_in_trash' => __( 'No views found in Trash.', 'content-views-query-and-display-post-page' ),
|
297 |
);
|
298 |
|
299 |
$args = array(
|
300 |
-
'labels'
|
301 |
-
'public'
|
302 |
// Hide in menu, but can see All Views page
|
303 |
-
'show_ui'
|
304 |
-
'show_in_menu'
|
305 |
-
'query_var'
|
306 |
-
'rewrite'
|
307 |
-
'capability_type'
|
308 |
-
'has_archive'
|
309 |
-
'hierarchical'
|
310 |
-
'menu_position'
|
311 |
-
'supports'
|
312 |
);
|
313 |
|
314 |
register_post_type( PT_CV_POST_TYPE, $args );
|
242 |
*/
|
243 |
public function load_plugin_textdomain() {
|
244 |
/* In v1.6.8.3, textdomain changed from "content-views" to "content-views-query-and-display-post-page"
|
|
|
|
|
|
|
|
|
|
|
|
|
245 |
*/
|
246 |
|
247 |
// WPLANG is no longer needed since 4.0
|
248 |
$locale = get_locale();
|
249 |
|
250 |
+
$old_lang_file = WP_LANG_DIR . "/content-views/content-views-{$locale}.mo";
|
251 |
+
$lang_pack = WP_LANG_DIR . "/plugins/content-views-query-and-display-post-page-{$locale}.mo";
|
252 |
+
$plugin_lang_dir = dirname( plugin_basename( PT_CV_FILE ) ) . '/languages/';
|
253 |
|
254 |
+
if ( file_exists( $old_lang_file ) ) {
|
255 |
+
load_textdomain( 'content-views-query-and-display-post-page', $old_lang_file );
|
256 |
+
} elseif ( file_exists( $lang_pack ) ) {
|
257 |
+
load_textdomain( 'content-views-query-and-display-post-page', $lang_pack );
|
|
|
|
|
|
|
|
|
|
|
|
|
258 |
} else {
|
259 |
+
load_plugin_textdomain( 'content-views-query-and-display-post-page', FALSE, $plugin_lang_dir );
|
260 |
}
|
261 |
}
|
262 |
|
269 |
* Register custom post type : View
|
270 |
*/
|
271 |
$labels = array(
|
272 |
+
'name' => _x( 'Views', 'post type general name', 'content-views-query-and-display-post-page' ),
|
273 |
+
'singular_name' => _x( 'View', 'post type singular name', 'content-views-query-and-display-post-page' ),
|
274 |
+
'menu_name' => _x( 'Views', 'admin menu', 'content-views-query-and-display-post-page' ),
|
275 |
+
'name_admin_bar' => _x( 'View', 'add new on admin bar', 'content-views-query-and-display-post-page' ),
|
276 |
+
'add_new' => _x( 'Add New', 'post' ),
|
277 |
+
'add_new_item' => __( 'Add New View', 'content-views-query-and-display-post-page' ),
|
278 |
+
'new_item' => __( 'New View', 'content-views-query-and-display-post-page' ),
|
279 |
+
'edit_item' => __( 'Edit View', 'content-views-query-and-display-post-page' ),
|
280 |
+
'view_item' => __( 'View View', 'content-views-query-and-display-post-page' ),
|
281 |
+
'all_items' => __( 'All Views', 'content-views-query-and-display-post-page' ),
|
282 |
+
'search_items' => __( 'Search Views', 'content-views-query-and-display-post-page' ),
|
283 |
+
'parent_item_colon' => __( 'Parent Views:', 'content-views-query-and-display-post-page' ),
|
284 |
+
'not_found' => __( 'No views found.', 'content-views-query-and-display-post-page' ),
|
285 |
'not_found_in_trash' => __( 'No views found in Trash.', 'content-views-query-and-display-post-page' ),
|
286 |
);
|
287 |
|
288 |
$args = array(
|
289 |
+
'labels' => $labels,
|
290 |
+
'public' => false,
|
291 |
// Hide in menu, but can see All Views page
|
292 |
+
'show_ui' => true, // set "true" to fix "Invalid post type" error
|
293 |
+
'show_in_menu' => false,
|
294 |
+
'query_var' => true,
|
295 |
+
'rewrite' => array( 'slug' => PT_CV_POST_TYPE ),
|
296 |
+
'capability_type' => 'post',
|
297 |
+
'has_archive' => true,
|
298 |
+
'hierarchical' => false,
|
299 |
+
'menu_position' => null,
|
300 |
+
'supports' => array( 'title', 'author', 'custom-fields' ),
|
301 |
);
|
302 |
|
303 |
register_post_type( PT_CV_POST_TYPE, $args );
|