diff --git a/README.txt b/README.txt index 43cb1c7..290f753 100644 --- a/README.txt +++ b/README.txt @@ -3,7 +3,7 @@ Contributors: randyjensen,randyhoyt Tags: openphoto,media Requires at least: 3.2 Tested up to: 3.3 -Stable tag: 0.9.4 +Stable tag: 0.9.4.1 Insert photos from your OpenPhoto installation into your WordPress content through the media manager. @@ -26,6 +26,9 @@ Find the project on [GitHub](https://github.com/openphoto/openphoto-wordpress "O == Changelog == += 0.9.4.1 = +* Change values for File Name and File Type + = 0.9.4 = * Including openphoto-php as a Git submodule * Use title from OpenPhoto instead of filename diff --git a/openphoto-wordpress.php b/openphoto-wordpress.php index be33dc0..194d667 100644 --- a/openphoto-wordpress.php +++ b/openphoto-wordpress.php @@ -211,13 +211,9 @@ class WP_OpenPhoto { $src["original"] = $photo->pathOriginal; if (strpos($src["original"],"http")===false) $src["original"] = 'http://'.$photo->host.$photo->pathOriginal; // in older versions of the API, pathOriginal did not have the full address - - - - if ("" == $photo->title) { - $info = pathinfo(basename($src["original"])); - $photo->title = basename($src["original"],'.'.$info['extension']); - } + $info = pathinfo(basename($src["original"])); + $photo->extension = $info['extension']; + if ("" == $photo->title) {$photo->title = basename($src["original"],'.'.$photo->extension);} echo '
File name: '.$src["original"].'
'; - echo 'File type: .'.$src["original"].'
'; + echo 'File name: '.$photo->title.'
'; + echo 'File type: '.$photo->extension.'
'; echo 'Upload date: '.date('F d Y', (int) $photo->dateUploaded).'
'; echo 'Dimensions: '.$photo->width.' × '.$photo->height.'
'; echo '