Skip to content

Commit

Permalink
bring up to date with latest changes in WP Emerge
Browse files Browse the repository at this point in the history
  • Loading branch information
atanas-dev committed May 9, 2018
1 parent 2af6b18 commit a1e4694
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/Image/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace WPEmergeTheme\Image;

use WPEmerge\Helpers\Mixed;
use WPEmerge\Helpers\MixedType;

class Image {
/**
Expand Down Expand Up @@ -69,15 +69,15 @@ public function thumbnail( $attachment_id, $width, $height, $crop = true ) {

$upload_dir = wp_upload_dir();
$attachment = wp_get_attachment_metadata( $attachment_id );
$source = Mixed::normalizePath( get_attached_file( $attachment_id ) );
$source = MixedType::normalizePath( get_attached_file( $attachment_id ) );

if ( ! $attachment || ! file_exists( $source ) ) {
return '';
}

$attachment_subdirectory = preg_replace( '/\/?[^\/]+\z/', '', $attachment['file'] );
$filename = $this->getResizedFilename( $source, $width, $height, $crop );
$destination = Mixed::normalizePath( Mixed::normalizePath( $upload_dir['basedir'] ) . DIRECTORY_SEPARATOR . $attachment_subdirectory ) . DIRECTORY_SEPARATOR . $filename;
$destination = MixedType::normalizePath( MixedType::normalizePath( $upload_dir['basedir'] ) . DIRECTORY_SEPARATOR . $attachment_subdirectory ) . DIRECTORY_SEPARATOR . $filename;

$stored = $this->store( $source, $destination, $width, $height, $crop );

Expand Down
2 changes: 1 addition & 1 deletion src/Theme/Theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use WPEmerge;
use WPEmerge\Facades\Framework;
use WPEmerge\Helpers\Mixed;
use WPEmerge\Helpers\MixedType;
use WPEmergeTheme\Assets\AssetsServiceProvider;
use WPEmergeTheme\Avatar\AvatarServiceProvider;
use WPEmergeTheme\Image\ImageServiceProvider;
Expand Down

0 comments on commit a1e4694

Please sign in to comment.