Related Posts Thumbnails Plugin for WordPress - Version 1.2.6

Version Description

  • Fixed relative custom url
Download this release

Release Info

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

Code changes from version 1.2.5 to 1.2.6

Files changed (2) hide show
  1. readme.txt +7 -1
  2. related-posts-thumbnails.php +8 -1
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://wordpress.shaldybina.com/donate
4
  Tags: related, posts, thumbnail
5
  Requires at least: 2.9
6
  Tested up to: 3.0
7
- Stable tag: 1.2.5
8
 
9
  Customizable plugin, that nicely displays related posts thumbnails under the post.
10
 
@@ -59,6 +59,9 @@ If there are no images of the specified size in the post, or file does not exist
59
 
60
  == Changelog ==
61
 
 
 
 
62
  = 1.2.5 =
63
  * Fixed selection of categories on plugin settings page
64
 
@@ -106,6 +109,9 @@ If there are no images of the specified size in the post, or file does not exist
106
 
107
  == Upgrade Notice ==
108
 
 
 
 
109
  = 1.2.5 =
110
  * Fixed selection of categories on plugin settings page
111
 
4
  Tags: related, posts, thumbnail
5
  Requires at least: 2.9
6
  Tested up to: 3.0
7
+ Stable tag: 1.2.6
8
 
9
  Customizable plugin, that nicely displays related posts thumbnails under the post.
10
 
59
 
60
  == Changelog ==
61
 
62
+ = 1.2.6 =
63
+ * Fixed relative custom url
64
+
65
  = 1.2.5 =
66
  * Fixed selection of categories on plugin settings page
67
 
109
 
110
  == Upgrade Notice ==
111
 
112
+ = 1.2.6 =
113
+ * Fixed relative custom URL
114
+
115
  = 1.2.5 =
116
  * Fixed selection of categories on plugin settings page
117
 
related-posts-thumbnails.php CHANGED
@@ -2,7 +2,7 @@
2
  Plugin Name: Related Posts Thumbnails
3
  Plugin URI: http://wordpress.shaldybina.com/plugins/related-posts-thumbnails/
4
  Description: Showing related posts thumbnails under the post.
5
- Version: 1.2.5
6
  Author: Maria Shaldybina
7
  Author URI: http://shaldybina.com/
8
  */
@@ -211,6 +211,7 @@ class RelatedPostsThumbnails {
211
  $debug .= 'Post-thumbnails enabled in theme;';
212
  if ( $post_thumbnail_id !== false ) { // post has thumbnail
213
  $debug .= 'Post has thumbnail;';
 
214
  $image = wp_get_attachment_image_src( $post_thumbnail_id, $poststhname );
215
  $url = $image[0];
216
  $from_post_body = false;
@@ -242,6 +243,12 @@ class RelatedPostsThumbnails {
242
  $debug .= 'Found wrong formatted image;';
243
  }
244
  }
 
 
 
 
 
 
245
 
246
  $debug .= 'Image URL: '.$url.';';
247
  if ( empty($url) || ( ini_get( 'allow_url_fopen' ) && false === @fopen( $url, 'r' ) ) ) { // parsed URL is empty or no file if can check
2
  Plugin Name: Related Posts Thumbnails
3
  Plugin URI: http://wordpress.shaldybina.com/plugins/related-posts-thumbnails/
4
  Description: Showing related posts thumbnails under the post.
5
+ Version: 1.2.6
6
  Author: Maria Shaldybina
7
  Author URI: http://shaldybina.com/
8
  */
211
  $debug .= 'Post-thumbnails enabled in theme;';
212
  if ( $post_thumbnail_id !== false ) { // post has thumbnail
213
  $debug .= 'Post has thumbnail;';
214
+ $debug .= 'Postthname: '.$poststhname.';';
215
  $image = wp_get_attachment_image_src( $post_thumbnail_id, $poststhname );
216
  $url = $image[0];
217
  $from_post_body = false;
243
  $debug .= 'Found wrong formatted image;';
244
  }
245
  }
246
+
247
+ if (strpos($url, '/') === 0)
248
+ {
249
+ $debug .= 'Relative url: '.$url.';';
250
+ $url = get_bloginfo('url') . $url;
251
+ }
252
 
253
  $debug .= 'Image URL: '.$url.';';
254
  if ( empty($url) || ( ini_get( 'allow_url_fopen' ) && false === @fopen( $url, 'r' ) ) ) { // parsed URL is empty or no file if can check