diff --git a/mr-image-resize.php b/mr-image-resize.php index 4fe5933..dd3a62f 100644 --- a/mr-image-resize.php +++ b/mr-image-resize.php @@ -116,7 +116,9 @@ function mr_image_resize($url, $width=null, $height=null, $crop=true, $align='c' $metadata = wp_get_attachment_metadata($get_attachment[0]->ID); if (isset($metadata['image_meta'])) { $md = $saved['width'] . 'x' . $saved['height']; - if ($crop) $md .= ($align) ? "_${align}" : "_c"; + if ($crop) { + $md .= ($align) ? '_' . $align : '_c'; + } $metadata['image_meta']['resized_images'][] = $md; wp_update_attachment_metadata($get_attachment[0]->ID, $metadata); } @@ -203,15 +205,15 @@ function mr_common_info($url, $width, $height, $crop, $align, $retina) { $name = wp_basename($file_path, ".$ext"); // Suffix applied to filename - $suffix = "${dest_width}x${dest_height}"; + $suffix = $dest_width . 'x' . $dest_height; // Set align info on file if ($crop) { - $suffix .= ($align) ? "_${align}" : "_c"; + $suffix .= ($align) ? '_' . $align : '_c'; } // Get the destination file name - $dest_file_name = "${dir}/${name}-${suffix}.${ext}"; + $dest_file_name = $dir . '/' . $name . '-' . $suffix . '.' . $ext; // Return info return array( @@ -258,4 +260,4 @@ function mr_delete_resized_images($post_id) { } -} \ No newline at end of file +}