/**
*** return_image_thumbnails
*** - return a list of thumbnails based on filesystem report.
*** @param (string) $image - Original image location.
*** @return (array) $results
*** @author Oleg Butuzov
**/
if (!function_exists(\'return_image_thumbnails\')){
function return_image_thumbnails($image){
$extension = array_pop(explode(\'.\', basename($image)));
if (!file_exists($image) || !(@getimagesize($image)))
return array();
return glob(dirname($image).\'/\'.basename($image, \'.\'.$extension).\'-[0-9]*x[0-9]*.\'.$extension);
}
}
usage example
return_image_thumbnails(get_attached_file( $image_id ));