Category Posts Widget - Version 4.9.2

Version Description

  • Mai 23th 2019 =
  • Fixed Starts with post
  • Fixed Replace the figure-element
Download this release

Release Info

Developer Kometschuh
Plugin Icon 128x128 Category Posts Widget
Version 4.9.2
Comparing to
See all releases

Code changes from version 4.9.1 to 4.9.2

cat-posts.php CHANGED
@@ -12,7 +12,7 @@ Plugin Name: Category Posts Widget
12
  Plugin URI: https://wordpress.org/plugins/category-posts/
13
  Description: Adds a widget that shows the most recent posts from a single category.
14
  Author: TipTopPress
15
- Version: 4.9.1
16
  Author URI: http://tiptoppress.com
17
  Text Domain: category-posts
18
  Domain Path: /languages
@@ -25,7 +25,7 @@ if ( ! defined( 'ABSPATH' ) ) {
25
  exit;
26
  }
27
 
28
- const VERSION = '4.9.1';
29
  const DOC_URL = 'http://tiptoppress.com/category-posts-widget/documentation-4-9/';
30
  const PRO_URL = 'http://tiptoppress.com/term-and-category-based-posts-widget/';
31
  const SUPPORT_URL = 'https://wordpress.org/support/plugin/category-posts/';
@@ -563,7 +563,7 @@ function default_settings() {
563
  'use_css_cropping' => true,
564
  'thumb_hover' => 'none',
565
  'hide_post_titles' => false,
566
- 'excerpt_lines' => 5,
567
  'excerpt_length' => 0,
568
  'excerpt_more_text' => __( '...', 'category-posts' ),
569
  'excerpt_filters' => false,
12
  Plugin URI: https://wordpress.org/plugins/category-posts/
13
  Description: Adds a widget that shows the most recent posts from a single category.
14
  Author: TipTopPress
15
+ Version: 4.9.2
16
  Author URI: http://tiptoppress.com
17
  Text Domain: category-posts
18
  Domain Path: /languages
25
  exit;
26
  }
27
 
28
+ const VERSION = '4.9.2';
29
  const DOC_URL = 'http://tiptoppress.com/category-posts-widget/documentation-4-9/';
30
  const PRO_URL = 'http://tiptoppress.com/term-and-category-based-posts-widget/';
31
  const SUPPORT_URL = 'https://wordpress.org/support/plugin/category-posts/';
563
  'use_css_cropping' => true,
564
  'thumb_hover' => 'none',
565
  'hide_post_titles' => false,
566
+ 'excerpt_lines' => 0,
567
  'excerpt_length' => 0,
568
  'excerpt_more_text' => __( '...', 'category-posts' ),
569
  'excerpt_filters' => false,
class-widget.php CHANGED
@@ -73,7 +73,7 @@ class Widget extends \WP_Widget {
73
  $format = get_post_format() ? : 'standard';
74
  $post_format_class = 'cat-post-format cat-post-format-' . $format;
75
  }
76
- $html = '<figure class="cat-post-crop">' . $html . '</figure>';
77
  } else {
78
  // use_css_cropping is not used.
79
  // wrap span.
@@ -117,7 +117,7 @@ class Widget extends \WP_Widget {
117
  preg_match( '/(?<=width=")[\d]*/', $post_thumb, $thumb_full_w );
118
  preg_match( '/(?<=height=")[\d]*/', $post_thumb, $thumb_full_h );
119
  $ratio = $thumb_full_w[0] / $thumb_full_h[0];
120
- $size[1] = intval( $size[0] * $ratio );
121
  }
122
  } else {
123
  $size = array( get_option( 'thumbnail_size_w', 150 ), get_option( 'thumbnail_size_h', 150 ) ); // yet another form of junk.
@@ -505,7 +505,7 @@ class Widget extends \WP_Widget {
505
  public function itemThumb( $instance, $no_link ) {
506
  $ret = '';
507
 
508
- if ( ( isset( $instance['default_thunmbnail'] ) && ( 0 !== $instance['default_thunmbnail'] ) ) || has_post_thumbnail() ) {
509
  $class = '';
510
  $disable_css = isset( $instance['disable_css'] ) && $instance['disable_css'];
511
 
@@ -960,7 +960,9 @@ class Widget extends \WP_Widget {
960
 
961
  $this->instance = $instance;
962
 
963
- $instance['offset'] = $start;
 
 
964
  $number = (int) $number; // sanitize number with the side effect of non
965
  // numbers are converted to zero.
966
  if ( 0 < $number ) {
73
  $format = get_post_format() ? : 'standard';
74
  $post_format_class = 'cat-post-format cat-post-format-' . $format;
75
  }
76
+ $html = '<span class="cat-post-crop">' . $html . '</span>';
77
  } else {
78
  // use_css_cropping is not used.
79
  // wrap span.
117
  preg_match( '/(?<=width=")[\d]*/', $post_thumb, $thumb_full_w );
118
  preg_match( '/(?<=height=")[\d]*/', $post_thumb, $thumb_full_h );
119
  $ratio = $thumb_full_w[0] / $thumb_full_h[0];
120
+ $size[1] = intval( $size[0] / $ratio );
121
  }
122
  } else {
123
  $size = array( get_option( 'thumbnail_size_w', 150 ), get_option( 'thumbnail_size_h', 150 ) ); // yet another form of junk.
505
  public function itemThumb( $instance, $no_link ) {
506
  $ret = '';
507
 
508
+ if ( ( isset( $instance['default_thunmbnail'] ) && ( $instance['default_thunmbnail'] ) ) || has_post_thumbnail() ) {
509
  $class = '';
510
  $disable_css = isset( $instance['disable_css'] ) && $instance['disable_css'];
511
 
960
 
961
  $this->instance = $instance;
962
 
963
+ if($start > 0) {
964
+ $instance['offset'] = $start;
965
+ }
966
  $number = (int) $number; // sanitize number with the side effect of non
967
  // numbers are converted to zero.
968
  if ( 0 < $number ) {
js/frontend/category-posts-frontend.js ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Category Posts Widget
3
+ * https://github.com/tiptoppress/category-posts-widget
4
+ *
5
+ * Adds a widget that shows the most recent posts from a single category.
6
+ *
7
+ * Released under the GPLv2 license or later - http://www.gnu.org/licenses/gpl-2.0.html
8
+ */
9
+
10
+ if (typeof jQuery !== 'undefined') {
11
+ jQuery( document ).ready(function () {
12
+ if ('objectFit' in document.documentElement.style === false) {
13
+ jQuery('.cat-post-item span').removeClass('cat-post-crop');
14
+ jQuery('.cat-post-item span').addClass('cat-post-crop-not-supported');
15
+ }
16
+ if (document.documentMode || /Edge/.test(navigator.userAgent)) {
17
+ jQuery('.cat-post-item span img').height('+=1');
18
+ window.setTimeout(function(){
19
+ jQuery('.cat-post-item span img').height('-=1');
20
+ },0);
21
+ }
22
+ });
23
+ }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://wordpress.org/support/plugin/category-posts/reviews/
4
  Tags: category, categories, posts, widget, posts widget, recent posts, category recent posts, shortcode, sidebar, excerpt, multiple widgets
5
  Requires at least: 2.8
6
  Tested up to: 5.2
7
- Stable tag: 4.9.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -126,6 +126,10 @@ The FireFox browser has a coverage of 5%, which we find little. For this 5%, we
126
  == Changelog ==
127
  [Read more on our blog ...](http://tiptoppress.com/category/category-posts-widget)
128
 
 
 
 
 
129
  = 4.9.1 - Mai 17th 2019 =
130
  * 'Load more' button / Ajax API
131
  * Data range filter
4
  Tags: category, categories, posts, widget, posts widget, recent posts, category recent posts, shortcode, sidebar, excerpt, multiple widgets
5
  Requires at least: 2.8
6
  Tested up to: 5.2
7
+ Stable tag: 4.9.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
126
  == Changelog ==
127
  [Read more on our blog ...](http://tiptoppress.com/category/category-posts-widget)
128
 
129
+ = 4.9.2 - Mai 23th 2019 =
130
+ * Fixed Starts with post
131
+ * Fixed Replace the figure-element
132
+
133
  = 4.9.1 - Mai 17th 2019 =
134
  * 'Load more' button / Ajax API
135
  * Data range filter
styles/admin/category-posts-widget.css CHANGED
@@ -58,7 +58,7 @@
58
  clear: both;
59
  margin-top: 2px;
60
  margin-bottom: 2px;
61
- width: auto;
62
  }
63
  .category-widget-cont input[type="range"] {
64
  padding-left: 0;
58
  clear: both;
59
  margin-top: 2px;
60
  margin-bottom: 2px;
61
+ width: 110px;
62
  }
63
  .category-widget-cont input[type="range"] {
64
  padding-left: 0;