List category posts - Version 0.80.2

Version Description

  • Bugfix release: With 0.80, using the post title as alt attribute in thumbnails made a change to use get_the_post_thumbnail_url. But thanks to a post in the support forum, I noticed we lost some of the sizing functionality in get_the_post_thumbnail. So this version goes back to using get_the_post_thumbnail but keeping the new alt attribute for thumbnails.
Download this release

Release Info

Developer fernandobt
Plugin Icon 128x128 List category posts
Version 0.80.2
Comparing to
See all releases

Code changes from version 0.80.1 to 0.80.2

include/lcp-thumbnail.php CHANGED
@@ -41,16 +41,15 @@ class LcpThumbnail{
41
  $lcp_thumbnail = '<a href="' . esc_url(get_permalink($single->ID)) .
42
  '" title="' . esc_attr($single->post_title) . '">';
43
 
44
- $lcp_thumbnail .= '<img src="' . get_the_post_thumbnail_url($single->ID, $lcp_thumb_size) .'"';
45
- if ( $lcp_thumb_class != null ) { // thumbnail class passed as parameter to shortcode
46
- $lcp_thumbnail .= ' class="' . $lcp_thumb_class . '" ';
47
- }
48
- else { // Otherwise, use this class name
49
- $lcp_thumbnail .= ' class="lcp_thumbnail" ';
50
- }
51
- $lcp_thumbnail .= ' alt="' . esc_attr($single->post_title) . '" />';
52
-
53
- $lcp_thumbnail .= '</a>';
54
  } else {
55
  // if thumbnail is requested but not found as featured image, grab first image in the content of the post
56
  if ( ($force_thumbnail === 'yes'|| $force_thumbnail === 'true') && preg_match('~<img[^>]*src\s?=\s?[\'"]([^\'"]*)~i',get_the_content(), $imgMatches)) {
41
  $lcp_thumbnail = '<a href="' . esc_url(get_permalink($single->ID)) .
42
  '" title="' . esc_attr($single->post_title) . '">';
43
 
44
+ $lcp_thumbnail .= get_the_post_thumbnail(
45
+ $single->ID,
46
+ $lcp_thumb_size,
47
+ array(
48
+ 'alt' => esc_attr($single->post_title),
49
+ // If we have a class use it, otherwise use default
50
+ 'class' => ( $lcp_thumb_class != null ) ? $lcp_thumb_class : 'lcp_thumbnail'
51
+ )
52
+ );
 
53
  } else {
54
  // if thumbnail is requested but not found as featured image, grab first image in the content of the post
55
  if ( ($force_thumbnail === 'yes'|| $force_thumbnail === 'true') && preg_match('~<img[^>]*src\s?=\s?[\'"]([^\'"]*)~i',get_the_content(), $imgMatches)) {
list-category-posts.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: List category posts
4
  Plugin URI: https://github.com/picandocodigo/List-Category-Posts
5
  Description: List Category Posts allows you to list posts by category in a post/page using the [catlist] shortcode. This shortcode accepts a category name or id, the order in which you want the posts to display, the number of posts to display and many more parameters. You can use [catlist] as many times as needed with different arguments. Usage: [catlist argument1=value1 argument2=value2].
6
- Version: 0.80.1
7
  Author: Fernando Briano
8
  Author URI: http://fernandobriano.com
9
 
3
  Plugin Name: List category posts
4
  Plugin URI: https://github.com/picandocodigo/List-Category-Posts
5
  Description: List Category Posts allows you to list posts by category in a post/page using the [catlist] shortcode. This shortcode accepts a category name or id, the order in which you want the posts to display, the number of posts to display and many more parameters. You can use [catlist] as many times as needed with different arguments. Usage: [catlist argument1=value1 argument2=value2].
6
+ Version: 0.80.2
7
  Author: Fernando Briano
8
  Author URI: http://fernandobriano.com
9
 
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: list, categories, posts, cms
5
  Requires at least: 3.3
6
  Tested up to: 5.2
7
  Requires PHP: 5.4
8
- Stable tag: 0.80.1
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -229,6 +229,10 @@ Template system has changed. Custom templates should be stored in WordPress them
229
 
230
  == Changelog ==
231
 
 
 
 
 
232
  = 0.80.1 =
233
 
234
  * Bugfix release: fix for featured image link to full post not working. Thanks Werner!
5
  Requires at least: 3.3
6
  Tested up to: 5.2
7
  Requires PHP: 5.4
8
+ Stable tag: 0.80.2
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
229
 
230
  == Changelog ==
231
 
232
+ = 0.80.2 =
233
+
234
+ * Bugfix release: With 0.80, using the post title as alt attribute in thumbnails made a change to use `get_the_post_thumbnail_url`. But thanks to [a post in the support forum](https://wordpress.org/support/topic/since-last-update-thumbnail-size-no-more-work-correct/), I noticed we lost some of the sizing functionality in `get_the_post_thumbnail`. So this version goes back to using get_the_post_thumbnail but keeping the new alt attribute for thumbnails.
235
+
236
  = 0.80.1 =
237
 
238
  * Bugfix release: fix for featured image link to full post not working. Thanks Werner!