mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-28 07:07:38 +02:00
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:
parent
7414759f92
commit
c14e0a0527
@ -122,11 +122,13 @@ function get_the_post_thumbnail( $post = null, $size = 'post-thumbnail', $attr =
|
|||||||
* Filters the post thumbnail size.
|
* Filters the post thumbnail size.
|
||||||
*
|
*
|
||||||
* @since 2.9.0
|
* @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
|
* @param string|array $size The post thumbnail size. Image size or array of width and height
|
||||||
* values (in that order). Default 'post-thumbnail'.
|
* 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 ) {
|
if ( $post_thumbnail_id ) {
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @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.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user