post_thumbnail_url WordPress Filter Hook

The post_thumbnail_url hook is used to retrieve the URL of a post thumbnail. This hook can be used in a number of ways, such as to get the URL of a featured image or to get the URL of an image attached to a post.

apply_filters( 'post_thumbnail_url', string|false $thumbnail_url, int|WP_Post|null $post, string|int[] $size ) #

Filters the post thumbnail URL.


Parameters

$thumbnail_url

(string|false)Post thumbnail URL or false if the post does not exist.

$post

(int|WP_Post|null)Post ID or WP_Post object. Default is global $post.

$size

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


Top ↑

Source

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

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
5.9.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.