get_the_post_thumbnail_url

Advertisement

Summery Summery

Return the post thumbnail URL.

Syntax Syntax

get_the_post_thumbnail_url( int|WP_Post $post = null, string|array $size = 'post-thumbnail' )

Parameters Parameters

$post

(Optional) Post ID or WP_Post object. Default is global $post.

Default value: null

$size

(Optional) Registered image size to retrieve the source for or a flat array of height and width dimensions. Default 'post-thumbnail'.

Default value: 'post-thumbnail'

Return Return

(string|false) Post thumbnail URL or false if no URL is available.

Source Source

File: wp-includes/post-thumbnail-template.php

/**
 * Return the post thumbnail URL.
 *
 * @since 4.4.0
 *
 * @param int|WP_Post  $post Optional. Post ID or WP_Post object.  Default is global `$post`.

Advertisement

Changelog Changelog

Changelog
Version Description
4.4.0 Introduced.

Advertisement

Leave a Reply