Outil de recherche WordPress pour les développeurs et auteurs de thèmes



_wp_post_thumbnail_class_filter ›

Depuis2.9.0
Dépréciéen/a
_wp_post_thumbnail_class_filter ( $attr )
Paramètres:
  • (array) $attr Thumbnail attributes including src, class, alt, title.
    Requis: Oui
Retourne:
  • (array) Modified array of attributes including the new 'wp-post-image' class.
Défini(e) dans:
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;
}