ThemeImage.php
public function getImage($attachment_id, $size = "post-thumbnail", $placeholder = true)
    {
        $sizes = $this->getConfig("image-sizes");

        if (isset($sizes[$size]) && $placeholder) {
            $image = "//placehold.it/" . $sizes[$size]["width"] . "x" . $sizes[$size]["height"];
        } else {
            $image = false;
        }

        $imgData = wp_get_attachment_image_src($attachment_id, $size);
        if ($imgData && is_array($imgData) && isset($imgData[0]) && $imgData[0]):
            $image = $imgData[0];
        endif;

        return $image;
    }
public function getImage($attachment_id, $size = "post-thumbnail", $placeholder = true)
    {
        $sizes = $this->getConfig("image-sizes");

        if (isset($sizes[$size]) && $placeholder) {
            $image = "//placehold.it/" . $sizes[$size]["width"] . "x" . $sizes[$size]["height"];
        } else {
            $image = false;
        }

        $imgData = wp_get_attachment_image_src($attachment_id, $size);
        if ($imgData && is_array($imgData) && isset($imgData[0]) && $imgData[0]):
            $image = $imgData[0];
        endif;

        return $image;
    }
public function getImage ( $ attachment_id , $ size = "post-thumbnail" , $ placeholder = true ) { $ sizes = $ this -> getConfig ( "image-sizes" ) ; if ( isset ( $ sizes [ $ size ] ) && $ placeholder ) { $ image = "//placehold.it/" . $ sizes [ $ size ] [ "width" ] . "x" . $ sizes [ $ size ] [ "height" ] ; } else { $ image = false ; } $ imgData = wp_get_attachment_image_src ( $ attachment_id , $ size ) ; if ( $ imgData && is_array ( $ imgData ) && isset ( $ imgData [ 0 ] ) && $ imgData [ 0 ] ) : $ image = $ imgData [ 0 ] ; endif ; return $ image ; }
Get image url by ID and size

@param $attachment_id
@param string $size
@param bool $placeholder
@return bool|mixed
Get image url by ID and size