WordPress开发者和主题制作者的搜索引擎



_wp_post_thumbnail_class_filter ›

Since2.9.0
已弃用n/a
_wp_post_thumbnail_class_filter ( $attr )
参数:
  • (array) $attr Thumbnail attributes including src, class, alt, title.
    Required: Yes
返回:
  • (array) Modified array of attributes including the new 'wp-post-image' class.
定义在:
文档:

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.



源码

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