• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
WordPress core a2z

WordPress core a2z

WordPress core only

  • Home
  • Plugins
  • Blocks
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / _wp_post_thumbnail_class_filter() – Adds a ‘wp-post-image’ class to post thumbnails. Internal use only.

You appear to be a bot. Output may be restricted

Description

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.

Usage

$string[] = _wp_post_thumbnail_class_filter( $attr );

Parameters

$attr
( string[] ) required – Array of thumbnail attributes including src, class, alt, title, keyed by attribute name.

Returns

string[] Modified array of attributes including the new 'wp-post-image' class.

Source

File name: wordpress/wp-includes/media.php
Lines:

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

 View on GitHub View on Trac

Published: 25th November 2019 | Last updated: 25th November 2019

Primary Sidebar

Information

Function name: _wp_post_thumbnail_class_filter
Plugin ref: WordPress
Version: 5.6
Sourcefile: wp-includes/media.php
File ref: wp-includes/media.php
API type: private
Deprecated?: No
API Letters: _,C,P,T,W

Footer

WP-a2z
WordPress core a2z
WordPress core only
WordPress 5.6
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  core.wp-a2z.org
© Copyright WP-a2z 2014-2021. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites