_wp_post_thumbnail_class_filter

The timeline below displays how wordpress function _wp_post_thumbnail_class_filter has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 5.4

/**
 * Adds a 'wp-post-image' class to post thumbnails. Internal use only.
 *
 * Uses the {@see 'begin_fetch_post_thumbnail_html'} and {@see 'end_fetch_post_thumbnail_html'}
 * action hooks to dynamically add/remove itself so as to only filter post thumbnails.
 *
 * @ignore
 * @since 2.9.0
 *
 * @param string[] $attr Array of thumbnail attributes including src, class, alt, title, keyed by attribute name.
 * @return string[] Modified array of attributes including the new 'wp-post-image' class.
 */
function _wp_post_thumbnail_class_filter($attr)
{
    $attr['class'] .= ' wp-post-image';
    return $attr;
}

WordPress Version: 4.6

/**
 * Adds a 'wp-post-image' class to post thumbnails. Internal use only.
 *
 * Uses the {@see 'begin_fetch_post_thumbnail_html'} and {@see 'end_fetch_post_thumbnail_html'}
 * action hooks to dynamically add/remove itself so as to only filter post thumbnails.
 *
 * @ignore
 * @since 2.9.0
 *
 * @param array $attr Thumbnail attributes including src, class, alt, title.
 * @return array Modified array of attributes including the new 'wp-post-image' class.
 */
function _wp_post_thumbnail_class_filter($attr)
{
    $attr['class'] .= ' wp-post-image';
    return $attr;
}

WordPress Version: 4.2

/**
 * Adds a 'wp-post-image' class to post thumbnails. Internal use only.
 *
 * Uses the 'begin_fetch_post_thumbnail_html' and 'end_fetch_post_thumbnail_html' action hooks to
 * dynamically add/remove itself so as to only filter post thumbnails.
 *
 * @ignore
 * @since 2.9.0
 *
 * @param array $attr Thumbnail attributes including src, class, alt, title.
 * @return array Modified array of attributes including the new 'wp-post-image' class.
 */
function _wp_post_thumbnail_class_filter($attr)
{
    $attr['class'] .= ' wp-post-image';
    return $attr;
}

WordPress Version: 3.7

/**
 * Adds a 'wp-post-image' class to post thumbnails
 * Uses the begin_fetch_post_thumbnail_html and end_fetch_post_thumbnail_html action hooks to
 * dynamically add/remove itself so as to only filter post thumbnails
 *
 * @since 2.9.0
 * @param array $attr Attributes including src, class, alt, title
 * @return array
 */
function _wp_post_thumbnail_class_filter($attr)
{
    $attr['class'] .= ' wp-post-image';
    return $attr;
}