A WordPress-centric search engine for devs and theme authors



_wp_post_thumbnail_class_filter ›

Since2.9.0
Deprecatedn/a
_wp_post_thumbnail_class_filter ( $attr )
Parameters:
  • (array) $attr Thumbnail attributes including src, class, alt, title.
    Required: Yes
Returns:
  • (array) Modified array of attributes including the new 'wp-post-image' class.
Defined at:
Codex:

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.



Source

function _wp_post_thumbnail_class_filter( $attr ) {
	$attr['class'] .= ' wp-post-image';
	return $attr;
}