Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



_wp_post_thumbnail_class_filter ›

Seit2.9.0
Veraltetn/v
_wp_post_thumbnail_class_filter ( $attr )
Parameter:
  • (array) $attr Thumbnail attributes including src, class, alt, title.
    Erforderlich: Ja
Gibt zurück:
  • (array) Modified array of attributes including the new 'wp-post-image' class.
Definiert in:
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.



Quellcode

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