Make WordPress Core


Ignore:
Timestamp:
08/18/2017 06:18:51 PM (7 years ago)
Author:
flixos90
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/post-thumbnail-template.php

    r37915 r41267  
    123123     *
    124124     * @since 2.9.0
    125      *
    126      * @param string|array $size The post thumbnail size. Image size or array of width and height
    127      *                           values (in that order). Default 'post-thumbnail'.
     125     * @since 4.9.0 Added the `$post_id` parameter.
     126     *
     127     * @param string|array $size    The post thumbnail size. Image size or array of width and height
     128     *                              values (in that order). Default 'post-thumbnail'.
     129     * @param int          $post_id The post ID.
    128130     */
    129     $size = apply_filters( 'post_thumbnail_size', $size );
     131    $size = apply_filters( 'post_thumbnail_size', $size, $post->ID );
    130132
    131133    if ( $post_thumbnail_id ) {
Note: See TracChangeset for help on using the changeset viewer.