Crop-Thumbnails - Version 1.0.1

Version Description

  • fix code that mess with old php versions
Download this release

Release Info

Developer Volkmar Kantor
Plugin Icon Crop-Thumbnails
Version 1.0.1
Comparing to
See all releases

Code changes from version 1.0.0 to 1.0.1

Files changed (3) hide show
  1. crop-thumbnails.php +4 -4
  2. functions/save.php +3 -2
  3. readme.txt +4 -1
crop-thumbnails.php CHANGED
@@ -1,11 +1,11 @@
1
  <?php
2
  /**
3
  * Plugin name: Crop Thumbnails
4
- * Plugin URI: http://wordpress.org/extend/plugins/crop-thumbnails/
5
  * Author: Volkmar Kantor
6
- * Author URI: http://www.totalmedial.de
7
  * Text Domain: cpt_lang
8
- * Version: 1.0.0
9
  * Description: The easy way to adjust your cropped image sizes.
10
  *
11
  *
@@ -27,7 +27,7 @@
27
  */
28
 
29
 
30
- define('CROP_THUMBS_VERSION','1.0.0');
31
 
32
 
33
  //cpt - stands for crop-post-thumbnail
1
  <?php
2
  /**
3
  * Plugin name: Crop Thumbnails
4
+ * Plugin URI: https://wordpress.org/extend/plugins/crop-thumbnails/
5
  * Author: Volkmar Kantor
6
+ * Author URI: https://www.totalmedial.de
7
  * Text Domain: cpt_lang
8
+ * Version: 1.0.1
9
  * Description: The easy way to adjust your cropped image sizes.
10
  *
11
  *
27
  */
28
 
29
 
30
+ define('CROP_THUMBS_VERSION','1.0.1');
31
 
32
 
33
  //cpt - stands for crop-post-thumbnail
functions/save.php CHANGED
@@ -203,7 +203,7 @@ class CptSaveThumbnail {
203
  if(!empty(self::$debug)) {
204
  return self::$debug;
205
  }
206
- return [];
207
  }
208
 
209
  private static function updateMetadata($imageMetadata, $imageSizeName, $currentFilePathInfo, $croppedWidth, $croppedHeight) {
@@ -289,7 +289,8 @@ class CptSaveThumbnail {
289
 
290
 
291
  $input->sourceImageId = intval($input->sourceImageId);
292
- if(empty(get_post($input->sourceImageId))) {
 
293
  throw new Exception(esc_html__("ERROR: Can't find original image in database!",'cpt_lang'), 1);
294
  }
295
 
203
  if(!empty(self::$debug)) {
204
  return self::$debug;
205
  }
206
+ return array();
207
  }
208
 
209
  private static function updateMetadata($imageMetadata, $imageSizeName, $currentFilePathInfo, $croppedWidth, $croppedHeight) {
289
 
290
 
291
  $input->sourceImageId = intval($input->sourceImageId);
292
+ $_tmp = get_post($input->sourceImageId);//need to be its own var - cause of old php versions
293
+ if(empty($_tmp)) {
294
  throw new Exception(esc_html__("ERROR: Can't find original image in database!",'cpt_lang'), 1);
295
  }
296
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=volkm
4
  Tags: post-thumbnails, images, media library
5
  Requires at least: 4.6
6
  Tested up to: 4.7
7
- Stable tag: 1.0.0
8
  License: GPL v3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -113,6 +113,9 @@ If you fork and planning to publish the forked plugin, please contact me.
113
 
114
  == Changelog ==
115
 
 
 
 
116
  = 1.0.0 =
117
  * modal dialog rewritten
118
  * crop functionality refactored
4
  Tags: post-thumbnails, images, media library
5
  Requires at least: 4.6
6
  Tested up to: 4.7
7
+ Stable tag: 1.0.1
8
  License: GPL v3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
113
 
114
  == Changelog ==
115
 
116
+ = 1.0.1 =
117
+ * fix code that mess with old php versions
118
+
119
  = 1.0.0 =
120
  * modal dialog rewritten
121
  * crop functionality refactored