invp_get_the_photo_url( string $size = 'medium', int|null $post_ID = null )

invp_get_the_photo_url


Parameters

$size

(string) (Optional) A thumbnail size name.

Default value: 'medium'

$post_ID

(int|null) (Optional) The post ID of a vehicle. Must be passed when using this method outside the loop.

Default value: null


Return

(string) A URL that points to a photo


Source

File: includes/template-tags.php

 * @return string A URL that points to a photo
 */
function invp_get_the_photo_url( $size = 'medium', $post_ID = null ) {
	if ( empty( $size ) ) {
		$size = 'medium';
	}

	if ( empty( $post_ID ) ) {
		$post_ID = get_the_ID();
	}

	$thumbnail_id = get_post_thumbnail_id( $post_ID, $size );
	if ( ! is_wp_error( $thumbnail_id ) && ! empty( $thumbnail_id ) ) {
		return wp_get_attachment_url( $thumbnail_id );
	}