Post Thumbnails: Pass post ID to `post_thumbnail_size` filter.

In addition to the enhancement, tests for the filter usage including the new parameter have been added.

Props NathanAtmoz.
Fixes #39030.

Built from https://develop.svn.wordpress.org/trunk@41267


git-svn-id: http://core.svn.wordpress.org/trunk@41107 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Felix Arntz 2017-08-18 18:19:44 +00:00
parent 7414759f92
commit c14e0a0527
2 changed files with 6 additions and 4 deletions

View File

@ -122,11 +122,13 @@ function get_the_post_thumbnail( $post = null, $size = 'post-thumbnail', $attr =
* Filters the post thumbnail size.
*
* @since 2.9.0
* @since 4.9.0 Added the `$post_id` parameter.
*
* @param string|array $size The post thumbnail size. Image size or array of width and height
* values (in that order). Default 'post-thumbnail'.
* @param int $post_id The post ID.
*/
$size = apply_filters( 'post_thumbnail_size', $size );
$size = apply_filters( 'post_thumbnail_size', $size, $post->ID );
if ( $post_thumbnail_id ) {

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.9-alpha-41266';
$wp_version = '4.9-alpha-41267';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.