Skip to content

Commit

Permalink
Merge pull request #1 from drrobotnik/bug
Browse files Browse the repository at this point in the history
Fixed undefined variable notice that caused breakage in the store_image method
  • Loading branch information
markoheijnen committed Nov 26, 2013
2 parents 8a17daa + 976e7fe commit 7d2405d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions wp-image.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function __construct( $attachment_id ) {
$this->filepath = apply_filters( 'load_image_to_edit_path', $filepath, $attachment_id, 'full' );
$this->attachment_id = $attachment_id;

echo $this->filepath;
return $this->filepath;
}
}
}
Expand Down Expand Up @@ -60,7 +60,7 @@ public function add_image_size( $name, $max_w, $max_h, $crop = false, $force = f
$editor->resize( $max_w, $max_h, $crop );
$resized = $editor->save();

return $this->store_image( $resized );
return $this->store_image( $name, $resized );
}

/**
Expand All @@ -72,7 +72,7 @@ public function add_image_size( $name, $max_w, $max_h, $crop = false, $force = f
* @param array $resized The array you get back from WP_Image_Editor:save()
* @return boolean
*/
public function store_image( $resized ) {
public function store_image( $name, $resized ) {
if ( ! is_wp_error( $resized ) && $resized ) {
unset( $resized['path'] );
$this->metadata['sizes'][ $name ] = $resized;
Expand Down

0 comments on commit 7d2405d

Please sign in to comment.