Related Posts Thumbnails Plugin for WordPress - Version 2.0.3

Version Description

  • Please upgrade immediately.

=

Download this release

Release Info

Developer hiddenpearls
Plugin Icon 128x128 Related Posts Thumbnails Plugin for WordPress
Version 2.0.3
Comparing to
See all releases

Code changes from version 2.0.2 to 2.0.3

Files changed (2) hide show
  1. readme.txt +8 -3
  2. related-posts-thumbnails.php +12 -4
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: hiddenpearls, WPBrigade
3
  Donate link: https://wpbrigade.com/
4
  Tags: easy related posts, Related Posts thumbnails, Free Related Posts, related posts, similar related posts
5
  Requires at least: 3.6
6
- Tested up to: 5.9
7
- Stable tag: 2.0.2
8
  License: GPLv3 or later
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -71,11 +71,16 @@ If there are no images of the specified size in the post, or file does not exist
71
 
72
  == Upgrade Notice ==
73
 
74
- = 2.0.2 =
75
  * Please upgrade immediately.
76
 
77
  == Changelog ==
78
 
 
 
 
 
 
79
  = 2.0.2 - 2022-04-19 =
80
  * BugFix: PHP Warning on Gutenberg block.
81
 
3
  Donate link: https://wpbrigade.com/
4
  Tags: easy related posts, Related Posts thumbnails, Free Related Posts, related posts, similar related posts
5
  Requires at least: 3.6
6
+ Tested up to: 6.0
7
+ Stable tag: 2.0.3
8
  License: GPLv3 or later
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
 
71
 
72
  == Upgrade Notice ==
73
 
74
+ = 2.0.3 =
75
  * Please upgrade immediately.
76
 
77
  == Changelog ==
78
 
79
+ = 2.0.3 - 2022-07-06 =
80
+ * BugFix: Custom field compatible with images object or URL field.
81
+ * Compatibility : Compatible with WordPress 6.0
82
+ * Compatibility : Compatible with PHP 8.1
83
+
84
  = 2.0.2 - 2022-04-19 =
85
  * BugFix: PHP Warning on Gutenberg block.
86
 
related-posts-thumbnails.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: WordPress Related Posts Thumbnails
4
  * Plugin URI: https://wpbrigade.com/wordpress/plugins/related-posts/?utm_source=related-posts-lite&utm_medium=plugin-uri&utm_campaign=pro-upgrade-rp
5
  * Description: Showing related posts thumbnails under the posts.
6
- * Version: 2.0.2
7
  * Author: WPBrigade
8
  * Author URI: https://WPBrigade.com/?utm_source=related-posts-lite&utm_medium=author-link&utm_campaign=pro-upgrade-rp
9
  */
@@ -84,7 +84,6 @@ class RelatedPostsThumbnails {
84
  'relpoststh_top_text' => false,
85
  'relpoststh_number' => false,
86
  'relpoststh_relation' => false,
87
- 'relpoststh_default_image' => false,
88
  'relpoststh_poststhname' => false,
89
  'relpoststh_background' => false,
90
  'relpoststh_hoverbackground' => false,
@@ -100,7 +99,6 @@ class RelatedPostsThumbnails {
100
  'relpoststh_customwidth' => false,
101
  'relpoststh_customheight' => false,
102
  'relpoststh_textblockheight' => false,
103
- 'relpoststh_customwidth' => false,
104
  'rpt_post_sort' => false,
105
  'relpoststh_categories' => false,
106
  'relpoststh_categoriesall' => false,
@@ -761,7 +759,17 @@ class RelatedPostsThumbnails {
761
  $url = $this->default_image;
762
  } else {
763
  $debug .= 'Using custom field;';
764
- $url = isset( wp_get_attachment_image_src( $custom_field_meta )[0] ) ? wp_get_attachment_image_src( $custom_field_meta )[0] : $this->default_image;
 
 
 
 
 
 
 
 
 
 
765
  $theme_resize_url = get_option( 'relpoststh_theme_resize_url', '' );
766
 
767
  if ( strpos( $url, '/wp-content' ) !== false ) {
3
  * Plugin Name: WordPress Related Posts Thumbnails
4
  * Plugin URI: https://wpbrigade.com/wordpress/plugins/related-posts/?utm_source=related-posts-lite&utm_medium=plugin-uri&utm_campaign=pro-upgrade-rp
5
  * Description: Showing related posts thumbnails under the posts.
6
+ * Version: 2.0.3
7
  * Author: WPBrigade
8
  * Author URI: https://WPBrigade.com/?utm_source=related-posts-lite&utm_medium=author-link&utm_campaign=pro-upgrade-rp
9
  */
84
  'relpoststh_top_text' => false,
85
  'relpoststh_number' => false,
86
  'relpoststh_relation' => false,
 
87
  'relpoststh_poststhname' => false,
88
  'relpoststh_background' => false,
89
  'relpoststh_hoverbackground' => false,
99
  'relpoststh_customwidth' => false,
100
  'relpoststh_customheight' => false,
101
  'relpoststh_textblockheight' => false,
 
102
  'rpt_post_sort' => false,
103
  'relpoststh_categories' => false,
104
  'relpoststh_categoriesall' => false,
759
  $url = $this->default_image;
760
  } else {
761
  $debug .= 'Using custom field;';
762
+
763
+ /**
764
+ * Fix the single URL or Image object.
765
+ *
766
+ * @since 2.0.3
767
+ */
768
+ if ( is_array( $custom_field_meta ) && isset( ( $custom_field_meta )[0] ) ) {
769
+ $url = isset( wp_get_attachment_image_src( $custom_field_meta )[0] ) ? wp_get_attachment_image_src( $custom_field_meta )[0] : $this->default_image;;
770
+ } else {
771
+ $url = isset( $custom_field_meta ) && ! empty( $custom_field_meta ) ? $custom_field_meta : $this->default_image;
772
+ }
773
  $theme_resize_url = get_option( 'relpoststh_theme_resize_url', '' );
774
 
775
  if ( strpos( $url, '/wp-content' ) !== false ) {