Content Views – Post Grid & List for WordPress - Version 1.4.3

Version Description

  • Bug fixed: Scrollable list without image display blank output
  • Bug fixed: Position of pagination button is incorrect after pagination finished (in some case)
  • Improvement: Code refinement
Download this release

Release Info

Developer PT Guy
Plugin Icon 128x128 Content Views – Post Grid & List for WordPress
Version 1.4.3
Comparing to
See all releases

Code changes from version 1.4.2 to 1.4.3

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.0.1
7
- Stable tag: 1.4.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -144,6 +144,11 @@ You can create Unlimited Views, in Unlimited websites
144
 
145
  == Changelog ==
146
 
 
 
 
 
 
147
  = 1.4.2 =
148
  * Bug fixed: Style of Panel (.panel) is weird
149
 
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.0.1
7
+ Stable tag: 1.4.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
144
 
145
  == Changelog ==
146
 
147
+ = 1.4.3 =
148
+ * Bug fixed: Scrollable list without image display blank output
149
+ * Bug fixed: Position of pagination button is incorrect after pagination finished (in some case)
150
+ * Improvement: Code refinement
151
+
152
  = 1.4.2 =
153
  * Bug fixed: Style of Panel (.panel) is weird
154
 
admin/assets/css/admin.css CHANGED
@@ -17,9 +17,9 @@
17
  .pt-wrap *,
18
  .pt-wrap *:before,
19
  .pt-wrap *:after {
20
- -webkit-box-sizing: border-box;
21
- -moz-box-sizing: border-box;
22
- box-sizing: border-box;
23
  }
24
 
25
  /* Fix small error when use Bootstrap */
@@ -157,10 +157,11 @@ html {
157
 
158
  /* Activate group */
159
  #pt-cv-filter-settings .pt-cv-group-activate {
160
- padding: 5px;
161
  -webkit-box-shadow: inset 0 1px 1px rgba(255, 105, 105, 0.075), 0 0 8px rgba(0, 142, 255, 0.6) !important;
162
  box-shadow: inset 0 1px 1px rgba(255, 105, 105, 0.075), 0 0 8px rgba(0, 142, 255, 0.6) !important;
163
  }
 
164
  #pt-cv-filter-settings .pt-cv-group-activate .panel-body {
165
  background: #FFCFCF;
166
  }
@@ -203,10 +204,10 @@ html {
203
 
204
  /* View shortcode text */
205
  #view-shortcode {
206
- background: #ADFFAD;
207
- cursor: pointer;
208
  margin-bottom: 20px;
209
- float: left;
210
- position: relative;
211
- width: 50%;
212
  }
17
  .pt-wrap *,
18
  .pt-wrap *:before,
19
  .pt-wrap *:after {
20
+ -webkit-box-sizing: border-box;
21
+ -moz-box-sizing: border-box;
22
+ box-sizing: border-box;
23
  }
24
 
25
  /* Fix small error when use Bootstrap */
157
 
158
  /* Activate group */
159
  #pt-cv-filter-settings .pt-cv-group-activate {
160
+ padding: 5px;
161
  -webkit-box-shadow: inset 0 1px 1px rgba(255, 105, 105, 0.075), 0 0 8px rgba(0, 142, 255, 0.6) !important;
162
  box-shadow: inset 0 1px 1px rgba(255, 105, 105, 0.075), 0 0 8px rgba(0, 142, 255, 0.6) !important;
163
  }
164
+
165
  #pt-cv-filter-settings .pt-cv-group-activate .panel-body {
166
  background: #FFCFCF;
167
  }
204
 
205
  /* View shortcode text */
206
  #view-shortcode {
207
+ background: #ADFFAD;
208
+ cursor: pointer;
209
  margin-bottom: 20px;
210
+ float: left;
211
+ position: relative;
212
+ width: 50%;
213
  }
admin/assets/js/admin.js CHANGED
@@ -436,9 +436,9 @@
436
 
437
  // Sent POST request
438
  $.ajax({
439
- type : "POST",
440
- url : ajaxurl,
441
- data : data,
442
  }).done(function (response) {
443
  preview_box.css('opacity', '1');
444
  // Hide loading icon
@@ -538,8 +538,8 @@
538
  var $self = this;
539
  var _prefix = $self.options._prefix;
540
 
541
- var _fn = function ( is_trigger ) {
542
- if ( ! is_trigger ) {
543
  $self.options.onload = 0;
544
  }
545
 
@@ -551,7 +551,7 @@
551
  };
552
  // Bind on change input after page load
553
  $('.pt-wrap .tab-content').on('change', 'input, select, textarea', function (evt, is_trigger) {
554
- _fn( is_trigger );
555
  });
556
 
557
  $('body').bind(_prefix + 'preview-btn-toggle', function () {
@@ -635,7 +635,7 @@
635
 
636
  // Handle Pagination actions
637
  $('body').bind(_prefix + 'custom-trigger', function () {
638
- var $pt_cv_public_js = new $.PT_CV_Public({_prefix: _prefix,_autoload: 0});
639
  $pt_cv_public_js.pagination();
640
  });
641
  },
436
 
437
  // Sent POST request
438
  $.ajax({
439
+ type: "POST",
440
+ url : ajaxurl,
441
+ data: data,
442
  }).done(function (response) {
443
  preview_box.css('opacity', '1');
444
  // Hide loading icon
538
  var $self = this;
539
  var _prefix = $self.options._prefix;
540
 
541
+ var _fn = function (is_trigger) {
542
+ if (!is_trigger) {
543
  $self.options.onload = 0;
544
  }
545
 
551
  };
552
  // Bind on change input after page load
553
  $('.pt-wrap .tab-content').on('change', 'input, select, textarea', function (evt, is_trigger) {
554
+ _fn(is_trigger);
555
  });
556
 
557
  $('body').bind(_prefix + 'preview-btn-toggle', function () {
635
 
636
  // Handle Pagination actions
637
  $('body').bind(_prefix + 'custom-trigger', function () {
638
+ var $pt_cv_public_js = new $.PT_CV_Public({_prefix: _prefix, _autoload: 0});
639
  $pt_cv_public_js.pagination();
640
  });
641
  },
admin/content-views-admin.php CHANGED
@@ -78,7 +78,7 @@ class PT_Content_Views_Admin {
78
 
79
 
80
  // Add an action link pointing to the options page.
81
- $plugin_basename = plugin_basename( plugin_dir_path( dirname(__FILE__) ) . $this->plugin_slug . '.php' );
82
  add_filter( 'plugin_action_links_' . $plugin_basename, array( $this, 'filter_add_action_links' ) );
83
 
84
  // Filter link of actions in All Views page
@@ -426,9 +426,10 @@ class PT_Content_Views_Admin {
426
  */
427
  public function filter_admin_title( $admin_title, $title ) {
428
  $screen = get_current_screen();
429
-
430
- if ( ! $this || ! isset ( $this->plugin_sub_screen_hook_suffix ) )
431
  return $admin_title;
 
432
 
433
  // If is View page
434
  if ( $this->plugin_screen_hook_suffix == $screen->id || in_array( $screen->id, $this->plugin_sub_screen_hook_suffix ) ) {
78
 
79
 
80
  // Add an action link pointing to the options page.
81
+ $plugin_basename = plugin_basename( plugin_dir_path( dirname( __FILE__ ) ) . $this->plugin_slug . '.php' );
82
  add_filter( 'plugin_action_links_' . $plugin_basename, array( $this, 'filter_add_action_links' ) );
83
 
84
  // Filter link of actions in All Views page
426
  */
427
  public function filter_admin_title( $admin_title, $title ) {
428
  $screen = get_current_screen();
429
+
430
+ if ( ! $this || ! isset ( $this->plugin_sub_screen_hook_suffix ) ) {
431
  return $admin_title;
432
+ }
433
 
434
  // If is View page
435
  if ( $this->plugin_screen_hook_suffix == $screen->id || in_array( $screen->id, $this->plugin_sub_screen_hook_suffix ) ) {
admin/includes/templates/settings-section-two.php CHANGED
@@ -5,7 +5,8 @@
5
 
6
  <p>
7
  <a href="http://www.contentviewspro.com/pricing/?utm_source=settings_page&utm_medium=link&utm_campaign=content-views" target="_blank" class="btn btn-success">Upgrade now</a>
8
- or <a href="http://sample.contentviewspro.com/?utm_source=client&utm_medium=view" target="_blank" class="btn btn-info">Check demo site</a>
 
9
  </p>
10
 
11
  <div class="row">
5
 
6
  <p>
7
  <a href="http://www.contentviewspro.com/pricing/?utm_source=settings_page&utm_medium=link&utm_campaign=content-views" target="_blank" class="btn btn-success">Upgrade now</a>
8
+ or
9
+ <a href="http://sample.contentviewspro.com/?utm_source=client&utm_medium=view" target="_blank" class="btn btn-info">Check demo site</a>
10
  </p>
11
 
12
  <div class="row">
admin/views/view.php CHANGED
@@ -116,10 +116,12 @@ echo balanceTags( PT_Options_Framework::do_settings( $options, $settings ) );
116
  <!-- Nav tabs -->
117
  <ul class="nav nav-tabs">
118
  <li class="active">
119
- <a href="#<?php echo esc_attr( PT_CV_PREFIX ); ?>filter-settings" data-toggle="tab"><span class="glyphicon glyphicon-search"></span><?php _e( 'Filter Settings', PT_CV_DOMAIN ); ?></a>
 
120
  </li>
121
  <li>
122
- <a href="#<?php echo esc_attr( PT_CV_PREFIX ); ?>display-settings" data-toggle="tab"><span class="glyphicon glyphicon-th-large"></span><?php _e( 'Display Settings', PT_CV_DOMAIN ); ?></a>
 
123
  </li>
124
  <?php do_action( PT_CV_PREFIX_ . 'setting_tabs_header', $settings ); ?>
125
  </ul>
@@ -218,12 +220,12 @@ $options = array(
218
  ),
219
  'params' => array(
220
  array(
221
- 'type' => 'number',
222
- 'name' => 'limit',
223
- 'std' => '10',
224
- 'min' => '1',
225
  'append_text' => '1 &rarr; 999',
226
- 'desc' => __( 'The number of posts to show. Leaving it blank to show all found posts (which match all filter settings)', PT_CV_DOMAIN ),
227
  ),
228
  ),
229
  ),
116
  <!-- Nav tabs -->
117
  <ul class="nav nav-tabs">
118
  <li class="active">
119
+ <a href="#<?php echo esc_attr( PT_CV_PREFIX ); ?>filter-settings" data-toggle="tab"><span class="glyphicon glyphicon-search"></span><?php _e( 'Filter Settings', PT_CV_DOMAIN ); ?>
120
+ </a>
121
  </li>
122
  <li>
123
+ <a href="#<?php echo esc_attr( PT_CV_PREFIX ); ?>display-settings" data-toggle="tab"><span class="glyphicon glyphicon-th-large"></span><?php _e( 'Display Settings', PT_CV_DOMAIN ); ?>
124
+ </a>
125
  </li>
126
  <?php do_action( PT_CV_PREFIX_ . 'setting_tabs_header', $settings ); ?>
127
  </ul>
220
  ),
221
  'params' => array(
222
  array(
223
+ 'type' => 'number',
224
+ 'name' => 'limit',
225
+ 'std' => '10',
226
+ 'min' => '1',
227
  'append_text' => '1 &rarr; 999',
228
+ 'desc' => __( 'The number of posts to show. Leaving it blank to show all found posts (which match all filter settings)', PT_CV_DOMAIN ),
229
  ),
230
  ),
231
  ),
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.4.2
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.4.2' );
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.4.3
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.4.3' );
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
@@ -237,8 +237,8 @@ if ( ! class_exists( 'PT_CV_Functions' ) ) {
237
  /**
238
  * Get value of some setting options by prefix
239
  *
240
- * @param string $prefix The prefix in name of setting options
241
- * @param bool $backend Get settings from Backend form
242
  */
243
  static function settings_values_by_prefix( $prefix, $backend = FALSE ) {
244
  global $pt_view_settings;
@@ -427,7 +427,7 @@ if ( ! class_exists( 'PT_CV_Functions' ) ) {
427
  return;
428
  }
429
 
430
- $post_id = PT_CV_Functions::post_id_from_meta_id( $meta_id );
431
 
432
  // Get view settings
433
  if ( $post_id ) {
@@ -454,7 +454,7 @@ if ( ! class_exists( 'PT_CV_Functions' ) ) {
454
  return $view_settings;
455
  }
456
 
457
- $taxonomies = isset( $view_settings[ PT_CV_PREFIX . 'taxonomy'] ) ? $view_settings[ PT_CV_PREFIX . 'taxonomy'] : array();
458
  if ( is_array( $taxonomies ) ) {
459
  $list = array( '__in', '__not_in' );
460
  foreach ( $taxonomies as $taxonomy ) {
@@ -519,7 +519,7 @@ if ( ! class_exists( 'PT_CV_Functions' ) ) {
519
  $pt_view_sid = $session_id = $id ? $id : PT_CV_Functions::string_random();
520
 
521
  // Store settings
522
- set_transient( PT_CV_PREFIX . 'view-settings-' . $session_id, $settings, 30 * MINUTE_IN_SECONDS );
523
  }
524
 
525
  if ( empty( $args ) || empty( $dargs ) ) {
@@ -626,15 +626,16 @@ if ( ! class_exists( 'PT_CV_Functions' ) ) {
626
  /**
627
  * Get query parameters of View
628
  *
629
- * @param string $content_type The current content type
630
- * @param array $pt_view_settings The settings of View
 
631
  * @return array
632
  */
633
  static function view_filter_settings( $content_type, $pt_view_settings ) {
634
  /**
635
- * Get Query parameters
636
- * Set default values
637
- */
638
  $args = array(
639
  'post_type' => $content_type,
640
  'post_status' => 'publish',
@@ -673,6 +674,7 @@ if ( ! class_exists( 'PT_CV_Functions' ) ) {
673
  * Get display parameters of View
674
  *
675
  * @param string $view_type The view type of View
 
676
  * @return array
677
  */
678
  static function view_display_settings( $view_type ) {
@@ -865,7 +867,7 @@ if ( ! class_exists( 'PT_CV_Functions' ) ) {
865
 
866
  // Get thumbnail settings
867
  case 'thumbnail':
868
- $prefix = PT_CV_PREFIX . 'field-thumbnail-';
869
  $field_setting = PT_CV_Functions::settings_values_by_prefix( $prefix );
870
 
871
  $dargs['field-settings'][$field] = apply_filters( PT_CV_PREFIX_ . 'field_thumbnail_setting_values', $field_setting, $prefix );
@@ -874,7 +876,7 @@ if ( ! class_exists( 'PT_CV_Functions' ) ) {
874
 
875
  // Get meta fields settings
876
  case 'meta-fields':
877
- $prefix = PT_CV_PREFIX . 'meta-fields-';
878
  $field_setting = PT_CV_Functions::settings_values_by_prefix( $prefix );
879
 
880
  $dargs['field-settings'][$field] = apply_filters( PT_CV_PREFIX_ . 'field_meta_fields_setting_values', $field_setting, $prefix );
@@ -883,7 +885,7 @@ if ( ! class_exists( 'PT_CV_Functions' ) ) {
883
 
884
  // Get content settings
885
  case 'content':
886
- $prefix = PT_CV_PREFIX . 'field-content-';
887
  $field_setting = PT_CV_Functions::settings_values_by_prefix( $prefix );
888
 
889
  if ( $field_setting['show'] == 'excerpt' ) {
@@ -920,7 +922,7 @@ if ( ! class_exists( 'PT_CV_Functions' ) ) {
920
  // Get pagination enable/disable
921
  $pagination = PT_CV_Functions::setting_value( PT_CV_PREFIX . 'enable-pagination', $pt_view_settings );
922
  if ( $pagination ) {
923
- $prefix = PT_CV_PREFIX . 'pagination-';
924
  $field_setting = PT_CV_Functions::settings_values_by_prefix( $prefix );
925
 
926
  $dargs['pagination-settings'] = apply_filters( PT_CV_PREFIX_ . 'pagination_settings', $field_setting, $prefix );
@@ -958,7 +960,7 @@ if ( ! class_exists( 'PT_CV_Functions' ) ) {
958
  * @param array $dargs The settings array of Fields
959
  */
960
  static function view_get_other_settings( &$dargs ) {
961
- $prefix = PT_CV_PREFIX . 'other-';
962
  $field_setting = PT_CV_Functions::settings_values_by_prefix( $prefix );
963
 
964
  $dargs['other-settings'] = apply_filters( PT_CV_PREFIX_ . 'other_settings', $field_setting );
@@ -1064,7 +1066,7 @@ if ( ! class_exists( 'PT_CV_Functions' ) ) {
1064
  * Generate link to View page: Add view/ Edit view
1065
  *
1066
  * @param string $view_id The view id
1067
- * @param array $action Custom parameters
1068
  *
1069
  * @return string
1070
  */
@@ -1073,7 +1075,7 @@ if ( ! class_exists( 'PT_CV_Functions' ) ) {
1073
  $edit_link = admin_url( 'admin.php?page=' . PT_CV_DOMAIN . '-add' );
1074
  if ( ! empty( $view_id ) ) {
1075
  $query_args = array( 'id' => $view_id ) + $action;
1076
- $edit_link = add_query_arg( $query_args, $edit_link );
1077
  }
1078
 
1079
  return $edit_link;
@@ -1147,9 +1149,10 @@ if ( ! class_exists( 'PT_CV_Functions' ) ) {
1147
  ?>
1148
  <div class="pull-right" style="margin-top: -54px;">
1149
  <a class="btn btn-success" target="_blank" href="http://www.contentviewspro.com/pricing/?utm_source=client&utm_medium=view">&#187; Get Pro version</a>
1150
- or <a class="btn btn-info" target="_blank" href="http://sample.contentviewspro.com/?utm_source=client&utm_medium=view">Check demo site</a>
 
1151
  </div>
1152
- <?php
1153
  }
1154
  }
1155
 
237
  /**
238
  * Get value of some setting options by prefix
239
  *
240
+ * @param string $prefix The prefix in name of setting options
241
+ * @param bool $backend Get settings from Backend form
242
  */
243
  static function settings_values_by_prefix( $prefix, $backend = FALSE ) {
244
  global $pt_view_settings;
427
  return;
428
  }
429
 
430
+ $post_id = apply_filters( PT_CV_PREFIX_ . 'view_get_post_id', PT_CV_Functions::post_id_from_meta_id( $meta_id ), $meta_id );
431
 
432
  // Get view settings
433
  if ( $post_id ) {
454
  return $view_settings;
455
  }
456
 
457
+ $taxonomies = isset( $view_settings[PT_CV_PREFIX . 'taxonomy'] ) ? $view_settings[PT_CV_PREFIX . 'taxonomy'] : array();
458
  if ( is_array( $taxonomies ) ) {
459
  $list = array( '__in', '__not_in' );
460
  foreach ( $taxonomies as $taxonomy ) {
519
  $pt_view_sid = $session_id = $id ? $id : PT_CV_Functions::string_random();
520
 
521
  // Store settings
522
+ set_transient( PT_CV_PREFIX . 'view-settings-' . $session_id, $settings, 30 * MINUTE_IN_SECONDS );
523
  }
524
 
525
  if ( empty( $args ) || empty( $dargs ) ) {
626
  /**
627
  * Get query parameters of View
628
  *
629
+ * @param string $content_type The current content type
630
+ * @param array $pt_view_settings The settings of View
631
+ *
632
  * @return array
633
  */
634
  static function view_filter_settings( $content_type, $pt_view_settings ) {
635
  /**
636
+ * Get Query parameters
637
+ * Set default values
638
+ */
639
  $args = array(
640
  'post_type' => $content_type,
641
  'post_status' => 'publish',
674
  * Get display parameters of View
675
  *
676
  * @param string $view_type The view type of View
677
+ *
678
  * @return array
679
  */
680
  static function view_display_settings( $view_type ) {
867
 
868
  // Get thumbnail settings
869
  case 'thumbnail':
870
+ $prefix = PT_CV_PREFIX . 'field-thumbnail-';
871
  $field_setting = PT_CV_Functions::settings_values_by_prefix( $prefix );
872
 
873
  $dargs['field-settings'][$field] = apply_filters( PT_CV_PREFIX_ . 'field_thumbnail_setting_values', $field_setting, $prefix );
876
 
877
  // Get meta fields settings
878
  case 'meta-fields':
879
+ $prefix = PT_CV_PREFIX . 'meta-fields-';
880
  $field_setting = PT_CV_Functions::settings_values_by_prefix( $prefix );
881
 
882
  $dargs['field-settings'][$field] = apply_filters( PT_CV_PREFIX_ . 'field_meta_fields_setting_values', $field_setting, $prefix );
885
 
886
  // Get content settings
887
  case 'content':
888
+ $prefix = PT_CV_PREFIX . 'field-content-';
889
  $field_setting = PT_CV_Functions::settings_values_by_prefix( $prefix );
890
 
891
  if ( $field_setting['show'] == 'excerpt' ) {
922
  // Get pagination enable/disable
923
  $pagination = PT_CV_Functions::setting_value( PT_CV_PREFIX . 'enable-pagination', $pt_view_settings );
924
  if ( $pagination ) {
925
+ $prefix = PT_CV_PREFIX . 'pagination-';
926
  $field_setting = PT_CV_Functions::settings_values_by_prefix( $prefix );
927
 
928
  $dargs['pagination-settings'] = apply_filters( PT_CV_PREFIX_ . 'pagination_settings', $field_setting, $prefix );
960
  * @param array $dargs The settings array of Fields
961
  */
962
  static function view_get_other_settings( &$dargs ) {
963
+ $prefix = PT_CV_PREFIX . 'other-';
964
  $field_setting = PT_CV_Functions::settings_values_by_prefix( $prefix );
965
 
966
  $dargs['other-settings'] = apply_filters( PT_CV_PREFIX_ . 'other_settings', $field_setting );
1066
  * Generate link to View page: Add view/ Edit view
1067
  *
1068
  * @param string $view_id The view id
1069
+ * @param array $action Custom parameters
1070
  *
1071
  * @return string
1072
  */
1075
  $edit_link = admin_url( 'admin.php?page=' . PT_CV_DOMAIN . '-add' );
1076
  if ( ! empty( $view_id ) ) {
1077
  $query_args = array( 'id' => $view_id ) + $action;
1078
+ $edit_link = add_query_arg( $query_args, $edit_link );
1079
  }
1080
 
1081
  return $edit_link;
1149
  ?>
1150
  <div class="pull-right" style="margin-top: -54px;">
1151
  <a class="btn btn-success" target="_blank" href="http://www.contentviewspro.com/pricing/?utm_source=client&utm_medium=view">&#187; Get Pro version</a>
1152
+ or
1153
+ <a class="btn btn-info" target="_blank" href="http://sample.contentviewspro.com/?utm_source=client&utm_medium=view">Check demo site</a>
1154
  </div>
1155
+ <?php
1156
  }
1157
  }
1158
 
includes/html-viewtype.php CHANGED
@@ -21,7 +21,9 @@ if ( ! class_exists( 'PT_CV_Html_ViewType' ) ) {
21
  * Generate class for columns
22
  *
23
  * @global array $dargs
24
- * @param array $content_items
 
 
25
  * @return array
26
  */
27
  static function process_column_width( $content_items ) {
@@ -157,14 +159,14 @@ if ( ! class_exists( 'PT_CV_Html_ViewType' ) ) {
157
  $scrollable_html[] = PT_CV_Html::inline_script( $js );
158
 
159
  // Indicator html
160
- $show_indicator = isset( $dargs['view-type-settings']['indicator'] ) ? $dargs['view-type-settings']['indicator'] : 'yes';
161
  $scrollable_html[] = self::scrollable_indicator( $show_indicator == 'yes', $wrapper_id, $count_slides );
162
 
163
  // Content html
164
  $scrollable_html[] = $scrollable_content;
165
 
166
  // Control html
167
- $show_navigation = isset( $dargs['view-type-settings']['navigation'] ) ? $dargs['view-type-settings']['navigation'] : 'yes';
168
  $scrollable_html[] = self::scrollable_control( $show_navigation == 'yes', $wrapper_id, $count_slides );
169
 
170
  // Get wrapper class scrollable
21
  * Generate class for columns
22
  *
23
  * @global array $dargs
24
+ *
25
+ * @param array $content_items
26
+ *
27
  * @return array
28
  */
29
  static function process_column_width( $content_items ) {
159
  $scrollable_html[] = PT_CV_Html::inline_script( $js );
160
 
161
  // Indicator html
162
+ $show_indicator = isset( $dargs['view-type-settings']['indicator'] ) ? $dargs['view-type-settings']['indicator'] : 'no';
163
  $scrollable_html[] = self::scrollable_indicator( $show_indicator == 'yes', $wrapper_id, $count_slides );
164
 
165
  // Content html
166
  $scrollable_html[] = $scrollable_content;
167
 
168
  // Control html
169
+ $show_navigation = isset( $dargs['view-type-settings']['navigation'] ) ? $dargs['view-type-settings']['navigation'] : 'no';
170
  $scrollable_html[] = self::scrollable_control( $show_navigation == 'yes', $wrapper_id, $count_slides );
171
 
172
  // Get wrapper class scrollable
includes/html.php CHANGED
@@ -434,7 +434,8 @@ if ( ! class_exists( 'PT_CV_Html' ) ) {
434
  * Get content
435
  *
436
  * @param object $post
437
- * @param array $fargs
 
438
  * @return string
439
  */
440
  static function _field_content( $post, $fargs ) {
@@ -465,8 +466,8 @@ if ( ! class_exists( 'PT_CV_Html' ) ) {
465
 
466
  // Read more button
467
  if ( apply_filters( PT_CV_PREFIX_ . 'field_content_readmore_enable', 1, $fargs['content'] ) ) {
468
- $text = apply_filters( PT_CV_PREFIX_ . 'field_content_readmore_text', __( 'Read More', PT_CV_DOMAIN ), $fargs['content'] );
469
- $readmore .= self::_field_href( $oargs, $post, $text, PT_CV_PREFIX . 'readmore' . ' btn btn-success btn-sm' );
470
  $readmore_btn .= '<br/>' . $readmore;
471
  }
472
 
@@ -629,7 +630,7 @@ if ( ! class_exists( 'PT_CV_Html' ) ) {
629
 
630
  $terms = PT_CV_Functions::post_terms( $post );
631
  if ( ! empty( $terms ) ) {
632
- $term_html = sprintf( '<span class="%s">%s %s</span>', esc_attr( $term_class ), balanceTags( $prefix_text ), balanceTags( $terms ) );
633
  $html['taxonomy'] = apply_filters( PT_CV_PREFIX_ . 'field_term_html', $term_html, $terms );
634
  }
635
  break;
@@ -847,12 +848,12 @@ if ( ! class_exists( 'PT_CV_Html' ) ) {
847
  // Localize for Public script
848
  PT_CV_Asset::localize_script(
849
  'public', PT_CV_PREFIX_UPPER . 'PUBLIC', array(
850
- 'is_admin' => is_admin(),
851
  'is_mobile' => wp_is_mobile(),
852
- '_prefix' => PT_CV_PREFIX,
853
- 'ajaxurl' => admin_url( 'admin-ajax.php' ),
854
- 'lang' => PT_CV_Functions::get_language(),
855
- '_nonce' => wp_create_nonce( PT_CV_PREFIX_ . 'ajax_nonce' ),
856
  )
857
  );
858
  }
@@ -909,10 +910,10 @@ if ( ! class_exists( 'PT_CV_Html' ) ) {
909
  ob_start();
910
  ?>
911
  <script type="text/javascript" id="<?php echo esc_attr( PT_CV_PREFIX . 'inline-script-' . $random_id ); ?>">
912
- <?php
913
- $format = $wrap ? "(function ($) {\n $(function () { %s }); \n}(jQuery));" : '%s';
914
- printf( $format, $js );
915
- ?>
916
  </script>
917
  <?php
918
  return ob_get_clean();
434
  * Get content
435
  *
436
  * @param object $post
437
+ * @param array $fargs
438
+ *
439
  * @return string
440
  */
441
  static function _field_content( $post, $fargs ) {
466
 
467
  // Read more button
468
  if ( apply_filters( PT_CV_PREFIX_ . 'field_content_readmore_enable', 1, $fargs['content'] ) ) {
469
+ $text = apply_filters( PT_CV_PREFIX_ . 'field_content_readmore_text', __( 'Read More', PT_CV_DOMAIN ), $fargs['content'] );
470
+ $readmore .= self::_field_href( $oargs, $post, $text, PT_CV_PREFIX . 'readmore' . ' btn btn-success btn-sm' );
471
  $readmore_btn .= '<br/>' . $readmore;
472
  }
473
 
630
 
631
  $terms = PT_CV_Functions::post_terms( $post );
632
  if ( ! empty( $terms ) ) {
633
+ $term_html = sprintf( '<span class="%s">%s %s</span>', esc_attr( $term_class ), balanceTags( $prefix_text ), balanceTags( $terms ) );
634
  $html['taxonomy'] = apply_filters( PT_CV_PREFIX_ . 'field_term_html', $term_html, $terms );
635
  }
636
  break;
848
  // Localize for Public script
849
  PT_CV_Asset::localize_script(
850
  'public', PT_CV_PREFIX_UPPER . 'PUBLIC', array(
851
+ 'is_admin' => is_admin(),
852
  'is_mobile' => wp_is_mobile(),
853
+ '_prefix' => PT_CV_PREFIX,
854
+ 'ajaxurl' => admin_url( 'admin-ajax.php' ),
855
+ 'lang' => PT_CV_Functions::get_language(),
856
+ '_nonce' => wp_create_nonce( PT_CV_PREFIX_ . 'ajax_nonce' ),
857
  )
858
  );
859
  }
910
  ob_start();
911
  ?>
912
  <script type="text/javascript" id="<?php echo esc_attr( PT_CV_PREFIX . 'inline-script-' . $random_id ); ?>">
913
+ <?php
914
+ $format = $wrap ? "(function ($) {\n $(function () { %s }); \n}(jQuery));" : '%s';
915
+ printf( $format, $js );
916
+ ?>
917
  </script>
918
  <?php
919
  return ob_get_clean();
includes/settings.php CHANGED
@@ -661,11 +661,11 @@ if ( ! class_exists( 'PT_CV_Settings' ) ) {
661
  ),
662
  'params' => array(
663
  array(
664
- 'type' => 'number',
665
- 'name' => $prefix . 'number-columns',
666
- 'std' => '2',
667
  'append_text' => '1 &rarr; 4',
668
- 'desc' => __( 'The number of items on each row of grid', PT_CV_DOMAIN ),
669
  ),
670
  ),
671
  'dependence' => array( 'view-type', 'grid' ),
661
  ),
662
  'params' => array(
663
  array(
664
+ 'type' => 'number',
665
+ 'name' => $prefix . 'number-columns',
666
+ 'std' => '2',
667
  'append_text' => '1 &rarr; 4',
668
+ 'desc' => __( 'The number of items on each row of grid', PT_CV_DOMAIN ),
669
  ),
670
  ),
671
  'dependence' => array( 'view-type', 'grid' ),
includes/values.php CHANGED
@@ -101,9 +101,9 @@ if ( ! class_exists( 'PT_CV_Values' ) ) {
101
  */
102
  static function taxonomy_operators() {
103
  return array(
104
- 'IN' => '<strong>' . __( 'IN', PT_CV_DOMAIN ) . '</strong> &#8212; ' .__( 'A post is displayed only if it associated with at least one value in terms list', PT_CV_DOMAIN ),
105
- 'NOT IN' => '<strong>' . __( 'NOT IN', PT_CV_DOMAIN ) . '</strong> &#8212; ' .__( 'A post is displayed only if it did NOT associated with any values in terms list', PT_CV_DOMAIN ),
106
- 'AND' => '<strong>' . __( 'AND', PT_CV_DOMAIN ) . '</strong> &#8212; ' .__( 'A post is displayed only if it associated with all values in terms list', PT_CV_DOMAIN ),
107
  );
108
  }
109
 
101
  */
102
  static function taxonomy_operators() {
103
  return array(
104
+ 'IN' => '<strong>' . __( 'IN', PT_CV_DOMAIN ) . '</strong> &#8212; ' . __( 'A post is displayed only if it associated with at least one value in terms list', PT_CV_DOMAIN ),
105
+ 'NOT IN' => '<strong>' . __( 'NOT IN', PT_CV_DOMAIN ) . '</strong> &#8212; ' . __( 'A post is displayed only if it did NOT associated with any values in terms list', PT_CV_DOMAIN ),
106
+ 'AND' => '<strong>' . __( 'AND', PT_CV_DOMAIN ) . '</strong> &#8212; ' . __( 'A post is displayed only if it associated with all values in terms list', PT_CV_DOMAIN ),
107
  );
108
  }
109
 
public/assets/css/public.css CHANGED
@@ -15,16 +15,16 @@
15
  .pt-cv-view *,
16
  .pt-cv-view *:before,
17
  .pt-cv-view *:after {
18
- -webkit-box-sizing: border-box;
19
- -moz-box-sizing: border-box;
20
- box-sizing: border-box;
21
  }
22
 
23
  /* Common */
24
  .pt-cv-view {
25
- position: relative;
26
  /*margin-bottom: 30px;*/
27
- clear: both;
28
  }
29
 
30
  .pt-cv-page {
@@ -123,8 +123,7 @@
123
  margin: 0 auto !important;
124
  }
125
 
126
- .pagination > li
127
- {
128
  background: none !important;
129
  }
130
 
@@ -200,7 +199,7 @@
200
 
201
  /* Caption without image */
202
  .pt-cv-cap-wo-img {
203
- position: relative;
204
  }
205
 
206
  .pt-cv-cap-wo-img * {
@@ -245,29 +244,31 @@
245
 
246
  /* Collapsible layout */
247
  .pt-cv-view .collapse {
248
- display: none;
249
  visibility: hidden;
250
  }
 
251
  .pt-cv-view .collapse.in {
252
- display: block;
253
  visibility: visible;
254
  }
255
 
256
  /* @Panels-minified */
257
  .pt-cv-view .panel {
258
- margin-bottom: 20px;
259
- background-color: #ffffff;
260
- border: 1px solid transparent;
261
- border-radius: 4px;
262
- -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
263
- box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
264
  }
265
 
266
  .pt-cv-view .panel-default {
267
- border-color: #dddddd;
268
  }
 
269
  .pt-cv-view .panel-default > .panel-heading {
270
- color: #333333;
271
- background-color: #f5f5f5;
272
- border-color: #dddddd;
273
  }
15
  .pt-cv-view *,
16
  .pt-cv-view *:before,
17
  .pt-cv-view *:after {
18
+ -webkit-box-sizing: border-box;
19
+ -moz-box-sizing: border-box;
20
+ box-sizing: border-box;
21
  }
22
 
23
  /* Common */
24
  .pt-cv-view {
25
+ position: relative;
26
  /*margin-bottom: 30px;*/
27
+ clear: both;
28
  }
29
 
30
  .pt-cv-page {
123
  margin: 0 auto !important;
124
  }
125
 
126
+ .pagination > li {
 
127
  background: none !important;
128
  }
129
 
199
 
200
  /* Caption without image */
201
  .pt-cv-cap-wo-img {
202
+ position: relative !important;
203
  }
204
 
205
  .pt-cv-cap-wo-img * {
244
 
245
  /* Collapsible layout */
246
  .pt-cv-view .collapse {
247
+ display: none;
248
  visibility: hidden;
249
  }
250
+
251
  .pt-cv-view .collapse.in {
252
+ display: block;
253
  visibility: visible;
254
  }
255
 
256
  /* @Panels-minified */
257
  .pt-cv-view .panel {
258
+ margin-bottom: 20px;
259
+ background-color: #ffffff;
260
+ border: 1px solid transparent;
261
+ border-radius: 4px;
262
+ -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
263
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
264
  }
265
 
266
  .pt-cv-view .panel-default {
267
+ border-color: #dddddd;
268
  }
269
+
270
  .pt-cv-view .panel-default > .panel-heading {
271
+ color: #333333;
272
+ background-color: #f5f5f5;
273
+ border-color: #dddddd;
274
  }
public/assets/js/public.js CHANGED
@@ -15,7 +15,7 @@
15
 
16
  $.PT_CV_Public = function (options) {
17
  this.options = $.extend({
18
- _autoload : 1
19
  }, options);
20
 
21
  // Autoload all registered functions
@@ -38,7 +38,7 @@
38
  var selector = _prefix + 'bootstrap-style-css';
39
  var bootstrap_css = $('#' + selector);
40
  bootstrap_css.remove();
41
- $('title').after( "<!-- Manually move Bootstrap to top of all styles --><link rel='stylesheet' id='" + selector + "' href='" + bootstrap_css.attr('href') + "' type='text/css' media='all' />" );
42
  },
43
 
44
  /**
@@ -205,6 +205,7 @@
205
  // Trigger to make Pinterest layout works when do pagination
206
  if ($('.' + _prefix + 'pinterest').length || $('.' + _prefix + 'same-height').length) {
207
  $('body').trigger(_prefix + 'custom-trigger');
 
208
  }
209
 
210
  // Trigger action after pagination finished
15
 
16
  $.PT_CV_Public = function (options) {
17
  this.options = $.extend({
18
+ _autoload: 1
19
  }, options);
20
 
21
  // Autoload all registered functions
38
  var selector = _prefix + 'bootstrap-style-css';
39
  var bootstrap_css = $('#' + selector);
40
  bootstrap_css.remove();
41
+ $('title').after("<!-- Manually move Bootstrap to top of all styles --><link rel='stylesheet' id='" + selector + "' href='" + bootstrap_css.attr('href') + "' type='text/css' media='all' />");
42
  },
43
 
44
  /**
205
  // Trigger to make Pinterest layout works when do pagination
206
  if ($('.' + _prefix + 'pinterest').length || $('.' + _prefix + 'same-height').length) {
207
  $('body').trigger(_prefix + 'custom-trigger');
208
+ $(window).trigger(_prefix + 'resize');
209
  }
210
 
211
  // Trigger action after pagination finished