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

Version Description

  • Update translation feature: load translation file from /wp-content/languages/content-views/
  • Fix pagination bug
Download this release

Release Info

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

Code changes from version 1.2.3 to 1.2.4

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, shortcode, thumbnail, title, content, excerpt, meta, date, author, term, taxonomy, pagination, grid, scrollable, collapsible, list, slide, layout, ui
5
  Requires at least: 3.3
6
  Tested up to: 3.9.1
7
- Stable tag: 1.2.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -148,6 +148,10 @@ You can create Unlimited Views, in Unlimited websites
148
 
149
  == Changelog ==
150
 
 
 
 
 
151
  = 1.2.3 =
152
  * Fix warning: Cannot send session cache limiter - headers already sent
153
 
@@ -211,6 +215,9 @@ You can create Unlimited Views, in Unlimited websites
211
 
212
  == Upgrade Notice ==
213
 
 
 
 
214
  = 1.2.3 =
215
  Fix warning: Cannot send session cache limiter - headers already sent
216
 
4
  Tags: post, posts, page, pages, query, queries, search, display, show, shortcode, thumbnail, title, content, excerpt, meta, date, author, term, taxonomy, pagination, grid, scrollable, collapsible, list, slide, layout, ui
5
  Requires at least: 3.3
6
  Tested up to: 3.9.1
7
+ Stable tag: 1.2.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
148
 
149
  == Changelog ==
150
 
151
+ = 1.2.4 =
152
+ * Update translation feature: load translation file from /wp-content/languages/content-views/
153
+ * Fix pagination bug
154
+
155
  = 1.2.3 =
156
  * Fix warning: Cannot send session cache limiter - headers already sent
157
 
215
 
216
  == Upgrade Notice ==
217
 
218
+ = 1.2.4 =
219
+ Update translation feature: load translation file from /wp-content/languages/content-views/. Fix pagination bug
220
+
221
  = 1.2.3 =
222
  Fix warning: Cannot send session cache limiter - headers already sent
223
 
admin/views/view.php CHANGED
@@ -30,7 +30,6 @@ if ( ! empty ( $_GET['id'] ) ) {
30
  }
31
 
32
  // Store settings
33
- session_start();
34
  $_SESSION[PT_CV_PREFIX . 'settings'] = $settings;
35
 
36
  // Submit handle
@@ -556,6 +555,8 @@ echo balanceTags( PT_Options_Framework::do_settings( $options, $settings ) );
556
  ),
557
 
558
  );
 
 
559
  echo balanceTags( PT_Options_Framework::do_settings( $options, $settings ) );
560
  ?>
561
  </div>
30
  }
31
 
32
  // Store settings
 
33
  $_SESSION[PT_CV_PREFIX . 'settings'] = $settings;
34
 
35
  // Submit handle
555
  ),
556
 
557
  );
558
+
559
+ $options = apply_filters( PT_CV_PREFIX_ . 'display_settings', $options );
560
  echo balanceTags( PT_Options_Framework::do_settings( $options, $settings ) );
561
  ?>
562
  </div>
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.2.3
14
  * Author: Palace Of Themes
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.2.3' );
31
  define( 'PT_CV_FILE', __FILE__ );
32
  include_once( plugin_dir_path( __FILE__ ) . 'includes/defines.php' );
33
 
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.2.4
14
  * Author: Palace Of Themes
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.2.4' );
31
  define( 'PT_CV_FILE', __FILE__ );
32
  include_once( plugin_dir_path( __FILE__ ) . 'includes/defines.php' );
33
 
includes/functions.php CHANGED
@@ -416,7 +416,7 @@ if ( ! class_exists( 'PT_CV_Functions' ) ) {
416
  * @return string HTML output of Content View
417
  */
418
  static function view_process_settings( $id, $settings, $pargs = array() ) {
419
- if ( ! $settings ) {
420
  return __( 'Empty settings', PT_CV_DOMAIN );
421
  }
422
 
@@ -590,7 +590,7 @@ if ( ! class_exists( 'PT_CV_Functions' ) ) {
590
  // Total number of pages
591
  $max_num_pages = ceil( $total_items / $args['posts_per_page'] );
592
 
593
- $html .= "\n" . PT_CV_Html::pagination_output( $max_num_pages, $unique_id );
594
  }
595
 
596
  return $html;
@@ -1030,7 +1030,6 @@ if ( ! class_exists( 'PT_CV_Functions' ) ) {
1030
  parse_str( $_POST['data'], $settings );
1031
 
1032
  // Store settings
1033
- session_start();
1034
  $_SESSION[PT_CV_PREFIX . 'settings'] = $settings;
1035
 
1036
  // Show View output
@@ -1055,7 +1054,6 @@ if ( ! class_exists( 'PT_CV_Functions' ) ) {
1055
  $post_fix = empty( $id ) ? '' : '_frontend';
1056
 
1057
  // Get saved $settings
1058
- session_start();
1059
  if ( isset( $_SESSION[PT_CV_PREFIX . 'settings' . $post_fix] ) ) {
1060
  $settings = $_SESSION[PT_CV_PREFIX . 'settings' . $post_fix];
1061
  } else {
416
  * @return string HTML output of Content View
417
  */
418
  static function view_process_settings( $id, $settings, $pargs = array() ) {
419
+ if ( empty( $settings ) ) {
420
  return __( 'Empty settings', PT_CV_DOMAIN );
421
  }
422
 
590
  // Total number of pages
591
  $max_num_pages = ceil( $total_items / $args['posts_per_page'] );
592
 
593
+ $html .= "\n" . PT_CV_Html::pagination_output( $max_num_pages, is_admin() ? '' : $unique_id );
594
  }
595
 
596
  return $html;
1030
  parse_str( $_POST['data'], $settings );
1031
 
1032
  // Store settings
 
1033
  $_SESSION[PT_CV_PREFIX . 'settings'] = $settings;
1034
 
1035
  // Show View output
1054
  $post_fix = empty( $id ) ? '' : '_frontend';
1055
 
1056
  // Get saved $settings
 
1057
  if ( isset( $_SESSION[PT_CV_PREFIX . 'settings' . $post_fix] ) ) {
1058
  $settings = $_SESSION[PT_CV_PREFIX . 'settings' . $post_fix];
1059
  } else {
includes/html.php CHANGED
@@ -408,7 +408,7 @@ if ( ! class_exists( 'PT_CV_Html' ) ) {
408
  switch ( $fargs['content']['show'] ) {
409
  case 'excerpt':
410
  $length = (int) $fargs['content']['length'];
411
- $readmore = '<br />' . PT_CV_Html::link_button( get_permalink(), 'success', __( 'Read More' ), PT_CV_PREFIX . 'readmore', 'btn-sm' );
412
  $content = wp_trim_words( strip_shortcodes( get_the_content() ), $length, ' ...' . apply_filters( PT_CV_PREFIX_ . 'field_content_readmore', $readmore, $fargs['content'], get_permalink() ) );
413
  break;
414
 
@@ -702,24 +702,29 @@ if ( ! class_exists( 'PT_CV_Html' ) ) {
702
  fclose( $fp );
703
  }
704
 
705
- $assets_files[$type] = PT_CV_PUBLIC_ASSETS_URI . $asset_file;
706
  }
707
  }
708
 
 
 
709
  if ( is_admin() ) {
710
  // Include assets file in Preview
711
- foreach ( $assets_files as $type => $src ) {
712
- PT_CV_Asset::include_inline( 'preview', $src, $type );
 
 
713
  }
714
  } else {
715
  // Enqueue merged asset contents
716
- foreach ( $assets_files as $type => $src ) {
 
 
 
717
 
718
- $type = ( $type == 'js' ) ? 'script' : 'style';
719
- $function = "wp_enqueue_{$type}";
720
-
721
- if ( function_exists( $function ) ) {
722
- $function( PT_CV_PREFIX . $type, $src );
723
  }
724
  }
725
  }
408
  switch ( $fargs['content']['show'] ) {
409
  case 'excerpt':
410
  $length = (int) $fargs['content']['length'];
411
+ $readmore = '<br />' . PT_CV_Html::link_button( get_permalink(), 'success', __( 'Read More', PT_CV_DOMAIN ), PT_CV_PREFIX . 'readmore', 'btn-sm' );
412
  $content = wp_trim_words( strip_shortcodes( get_the_content() ), $length, ' ...' . apply_filters( PT_CV_PREFIX_ . 'field_content_readmore', $readmore, $fargs['content'], get_permalink() ) );
413
  break;
414
 
702
  fclose( $fp );
703
  }
704
 
705
+ $assets_files[$type][] = PT_CV_PUBLIC_ASSETS_URI . $asset_file;
706
  }
707
  }
708
 
709
+ $assets_files = apply_filters( PT_CV_PREFIX_ . 'assets_files', $assets_files );
710
+
711
  if ( is_admin() ) {
712
  // Include assets file in Preview
713
+ foreach ( $assets_files as $type => $srcs ) {
714
+ foreach ( $srcs as $src ) {
715
+ PT_CV_Asset::include_inline( 'preview', $src, $type );
716
+ }
717
  }
718
  } else {
719
  // Enqueue merged asset contents
720
+ foreach ( $assets_files as $type => $srcs ) {
721
+ foreach ( $srcs as $src ) {
722
+ $type = ( $type == 'js' ) ? 'script' : 'style';
723
+ $function = "wp_enqueue_{$type}";
724
 
725
+ if ( function_exists( $function ) ) {
726
+ $function( PT_CV_PREFIX . $type, $src );
727
+ }
 
 
728
  }
729
  }
730
  }
public/content-views.php CHANGED
@@ -231,8 +231,7 @@ class PT_Content_Views {
231
  $locale = apply_filters( 'plugin_locale', get_locale(), $domain );
232
 
233
  load_textdomain( $domain, trailingslashit( WP_LANG_DIR ) . $domain . '/' . $domain . '-' . $locale . '.mo' );
234
- load_plugin_textdomain( $domain, FALSE, basename( plugin_dir_path( dirname( __FILE__ ) ) ) . '/languages/' );
235
-
236
  }
237
 
238
  /**
231
  $locale = apply_filters( 'plugin_locale', get_locale(), $domain );
232
 
233
  load_textdomain( $domain, trailingslashit( WP_LANG_DIR ) . $domain . '/' . $domain . '-' . $locale . '.mo' );
234
+ load_plugin_textdomain( $domain, FALSE, dirname( plugin_basename( PT_CV_FILE_PRO ) ) . '/languages/' );
 
235
  }
236
 
237
  /**