Uses
Uses | Description |
---|---|
wp-includes/post-thumbnail-template.php: get_the_post_thumbnail_url() | Return the post thumbnail URL. |
wp-includes/formatting.php: esc_url() | Checks and cleans a URL. |
Display the post thumbnail URL.
(string|array) (Optional) Image size to use. Accepts any valid image size, or an array of width and height values in pixels (in that order).
Default value: 'post-thumbnail'
File: wp-includes/post-thumbnail-template.php
function the_post_thumbnail_url( $size = 'post-thumbnail' ) { $url = get_the_post_thumbnail_url( null, $size ); if ( $url ) { echo esc_url( $url ); } }
Version | Description |
---|---|
4.4.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/the_post_thumbnail_url