apply_filters( 'post_thumbnail_url', string|false $thumbnail_url, int|WP_Post|null $post, string|int[] $size )
- Since
- 5.9.0
Filters the post thumbnail URL.
Compatibility
- WordPress
- since 5.9.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Parameters
$thumbnail_urlstring|false- Post thumbnail URL or false if the post does not exist.
$postint|WP_Post|null- Post ID or WP_Post object. Default is global
$post. $sizestring|int[]- Registered image size to retrieve the source for or a flat array of height and width dimensions. Default 'post-thumbnail'.
Where this hook fires · 1
wp-includes/post-thumbnail-template.php:269get_the_post_thumbnail_url()
Source code
* * @param string|false $thumbnail_url Post thumbnail URL or false if the post does not exist. * @param int|WP_Post|null $post Post ID or WP_Post object. Default is global `$post`. * @param string|int[] $size Registered image size to retrieve the source for or a flat array * of height and width dimensions. Default 'post-thumbnail'. */ return apply_filters( 'post_thumbnail_url', $thumbnail_url, $post, $size );} /** * Displays the post thumbnail URL. * * @since 4.4.0Changelog
Introduced in 5.9.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 6.7.7 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
- Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.