_wp_post_thumbnail_class_filter() WP 2.9.0
Adds a 'wp-post-image' class to post thumbnails. Internal use only.
Uses the 'begin_fetch_post_thumbnail_html' and 'end_fetch_post_thumbnail_html' action hooks to dynamically add/remove itself so as to only filter post thumbnails.
Эта функция считается внутренней для использования самим ядром. Не рекомендуется использовать эту функцию в своем коде.
Хуков нет.
Возвращает
Строку[]. Modified array of attributes including the new 'wp-post-image' class.
Использование
_wp_post_thumbnail_class_filter( $attr );
- $attr(строка[]) (обязательный)
- Array of thumbnail attributes including src, class, alt, title, keyed by attribute name.
Список изменений
С версии 2.9.0 | Введена. |
Код _wp_post_thumbnail_class_filter() wp post thumbnail class filter WP 5.6.2
function _wp_post_thumbnail_class_filter( $attr ) {
$attr['class'] .= ' wp-post-image';
return $attr;
}