_wp_post_thumbnail_class_filter
Adds a 'wp-post-image' class to post thumbnails.
Description
(array) _wp_post_thumbnail_class_filter( (array) $attr );
Internal use only.
Uses the and action hooks to dynamically add/remove itself so as to only filter post thumbnails.
Returns (array)
Modified array of attributes including the new 'wp-post-image' class.
Parameters (1)
- 0. $attr (array)
- Thumbnail attributes including src, class, alt, title.
Usage
if ( !function_exists( '_wp_post_thumbnail_class_filter' ) ) { require_once ABSPATH . WPINC . '/media.php'; } // Thumbnail attributes including src, class, alt, title. $attr = array(); // NOTICE! Understand what this does before running. $result = _wp_post_thumbnail_class_filter($attr);
Defined (1)
The function is defined in the following location(s).
- /wp-includes/media.php
- function _wp_post_thumbnail_class_filter( $attr ) {
- $attr['class'] .= ' wp-post-image';
- return $attr;
- }