public function getPostAttachment($size = 'full', $property = null)
    {
        $post_id = $this->get('ID');
        if (!has_post_thumbnail($post_id)) {
            return false;
        }
        
        $attachment_id = get_post_thumbnail_id($post_id);
        $image_properties = array(
            'url',
            'width',
            'height',
            'is_resized'
        );
        $image_array = array_combine(
            $image_properties,
            array_values(wp_get_attachment_image_src($attachment_id, $size))
        );
        if (in_array($property, $image_properties)) {
            return $image_array[$property];
        }
        return $image_array;
    }
public function getPostAttachment($size = 'full', $property = null)
    {
        $post_id = $this->get('ID');
        if (!has_post_thumbnail($post_id)) {
            return false;
        }
        
        $attachment_id = get_post_thumbnail_id($post_id);
        $image_properties = array(
            'url',
            'width',
            'height',
            'is_resized'
        );
        $image_array = array_combine(
            $image_properties,
            array_values(wp_get_attachment_image_src($attachment_id, $size))
        );
        if (in_array($property, $image_properties)) {
            return $image_array[$property];
        }
        return $image_array;
    }
public function getPostAttachment ( $ size = 'full' , $ property = null ) { $ post_id = $ this -> get ( 'ID' ) ; if ( ! has_post_thumbnail ( $ post_id ) ) { return false ; } $ attachment_id = get_post_thumbnail_id ( $ post_id ) ; $ image_properties = array ( 'url' , 'width' , 'height' , 'is_resized' ) ; $ image_array = array_combine ( $ image_properties , array_values ( wp_get_attachment_image_src ( $ attachment_id , $ size ) ) ) ; if ( in_array ( $ property , $ image_properties ) ) { return $ image_array [ $ property ] ; } return $ image_array ; }
Get the image attachment array for post's featured image
@param string $size
@param string $property
@return array or string
Get the image attachment array for post s featured image