I get images from its post id in postmeta table
$kbe_img_meta = get_post_meta($foo_img_ID, "_wp_attachment_metadata", true);
echo "<pre>";
print_r($foo_img_meta);
echo "</pre>";
Here is my multidimensional array result:
Array
(
[width] => 800
[height] => 640
[file] => 2014/09/Wallpaper_29.jpg
[sizes] => Array
(
[thumbnail] => Array
(
[file] => Wallpaper_29-150x150.jpg
[width] => 150
[height] => 150
[mime-type] => image/jpeg
)
[medium] => Array
(
[file] => Wallpaper_29-300x240.jpg
[width] => 300
[height] => 240
[mime-type] => image/jpeg
)
[post-thumbnail] => Array
(
[file] => Wallpaper_29-624x499.jpg
[width] => 624
[height] => 499
[mime-type] => image/jpeg
)
)
[image_meta] => Array
(
[aperture] => 0
[credit] =>
[camera] =>
[caption] =>
[created_timestamp] => 0
[copyright] =>
[focal_length] => 0
[iso] => 0
[shutter_speed] => 0
[title] =>
[orientation] => 1
)
)
Array
(
[width] => 800
[height] => 480
[file] => 2014/09/Wallpaper_37.jpg
[sizes] => Array
(
[thumbnail] => Array
(
[file] => Wallpaper_37-150x150.jpg
[width] => 150
[height] => 150
[mime-type] => image/jpeg
)
[medium] => Array
(
[file] => Wallpaper_37-300x180.jpg
[width] => 300
[height] => 180
[mime-type] => image/jpeg
)
[post-thumbnail] => Array
(
[file] => Wallpaper_37-624x374.jpg
[width] => 624
[height] => 374
[mime-type] => image/jpeg
)
)
[image_meta] => Array
(
[aperture] => 0
[credit] =>
[camera] =>
[caption] =>
[created_timestamp] => 0
[copyright] =>
[focal_length] => 0
[iso] => 0
[shutter_speed] => 0
[title] =>
[orientation] => 1
)
)
Array
(
[width] => 800
[height] => 640
[file] => 2014/09/Wallpaper_33.jpg
[sizes] => Array
(
[thumbnail] => Array
(
[file] => Wallpaper_33-150x150.jpg
[width] => 150
[height] => 150
[mime-type] => image/jpeg
)
[medium] => Array
(
[file] => Wallpaper_33-300x240.jpg
[width] => 300
[height] => 240
[mime-type] => image/jpeg
)
[post-thumbnail] => Array
(
[file] => Wallpaper_33-624x499.jpg
[width] => 624
[height] => 499
[mime-type] => image/jpeg
)
)
[image_meta] => Array
(
[aperture] => 0
[credit] =>
[camera] =>
[caption] =>
[created_timestamp] => 0
[copyright] =>
[focal_length] => 0
[iso] => 0
[shutter_speed] => 0
[title] =>
[orientation] => 1
)
)
Now I only want [file]
value from [thumbnail]
, [medium]
and [post-thumbnail]
, so i delete images from folder.
Note: I only want [file] value.