the_post_thumbnail_url() - WordPress 函数参考中文文档

返回介绍

the_post_thumbnail_url()

发布于 2017-09-11 字数1277 浏览 1005 评论 0

the_post_thumbnail_url( string|array $size = 'post-thumbnail' )

Display the post thumbnail URL.


描述


参数

$size

(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 描述
4.4.0 Introduced.

相关函数

Uses

  • wp-includes/post-thumbnail-template.php:
    get_the_post_thumbnail_url()
  • wp-includes/formatting.php:
    esc_url()

User Contributed Notes

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

目前还没有任何评论,快来抢沙发吧!