_wp_post_thumbnail_context_filter()
Overrides the context used in wp_get_attachment_image(). 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.
Internal function — this function is designed to be used by the kernel itself. It is not recommended to use this function in your code.
No Hooks.
Returns
String
. Modified context set to 'the_post_thumbnail'.
Usage
_wp_post_thumbnail_context_filter( $context );
- $context(string) (required)
- The context for rendering an attachment image.
Changelog
Since 6.3.0 | Introduced. |
_wp_post_thumbnail_context_filter() wp post thumbnail context filter code WP 6.8.1
function _wp_post_thumbnail_context_filter( $context ) { return 'the_post_thumbnail'; }