You can use the post_thumbnail_html
filter.
This filter is applied in the return of the get_the_post_thumbnail
function.
apply_filters( 'post_thumbnail_html', $html, $post->ID, $post_thumbnail_id, $size, $attr );
Related Posts:
- Add ‘if exists’ to filter
- How to removes all instances of thumbnails displayed in my theme?
- Override has_post_thumbnail function
- Removing URL and adding container around image in the featured image metabox
- Distinguish between page and post in function
- WordPress set featured image to first image of the post
- Set post featured image to author image
- Print url to default featured image
- How to filter wp_get_recent_posts() to only posts that have thumbnails?
- changing size image within the content
- can’t output gray scaled image I’ve created using add_image_size
- Wrapping Featured Image on Add/Edit Page in div?
- add_filter with specific thumb names
- Gutenberg: Is there a way to know if current block is inside InnerBlocks?
- How to reorder billing fields in WooCommerce Checkout template? [closed]
- How to add a custom CSS class to core blocks in Gutenberg editor?
- No filter of code on switch from html to visual editor, how?
- How to modify posts_where filter only for the search query
- Filter translations (gettext strings) on specific admin pages
- Filter hook before create order WooCommerce
- How to auto-translate custom user roles?
- Adding revision support to WooCommerce product content
- Changing text within the Block Editor
- add_filter for specific pages
- How to add attribute to output with wp_video_shortcode add_filter
- Change default settings used by gallery shortcode
- PHP5, Inheritance, Singleton – action & filter hook limitations
- Please explain me what the do_action does
- How Can I Have A URL Changed Based on the Originating URL?
- Is it possible to Hook/Filters Attachment Creation?
- how to remove filter from wordpress shortcode output
- Change email from and display name with a filter action
- How to check if “media_send_to_editor” is audio?
- Changing Order of Filters
- Please help me through this example with a filter to understand how they work
- Filter custom post types in archive
- WordPress tag cloud add more links
- How can I filter block registration based on post-type? (Block alignment settings)
- wp_insert_post_data filter not working correctly after upgrade to WordPress 5
- Yoast SEO hooks overriding themselves
- Passing variable from child theme to parent theme
- Question about how do wordpress filters/actions work
- How to center oEmbedded content
- Add Sortable Column For All Post Types
- How to take options from form fields and turn them in to links?
- When to use add_action when registering/enqueuing scripts
- How add a group by to the query used by the media library?
- add_filter(allowed_block_types) -> adding core/paragraph bugs Gutenberg editor
- How to properly modify WP Vary or any existing headers?
- How to remove medium size class in gravity form for input tag?
- Custom wp_query time filter on meta_value
- get post id within add_filter()
- Can I override the content array using the_posts filter?
- Media upload default title from file name
- Admin post list – adding an option to the date filter dropdown
- Use of comment_reply_link_args filter
- How to use do_shortcode_tag to modify the output of a shortcode?
- Shortcodes within the sidebar text/html widget: How to preserve the raw HTML output of the shortcode?
- Changing the argument of a function
- Alter existing page contents based on url
- Error using wp_mail inside custom function
- How to include add_filter() in a condition based on $post data
- Admin: how to make a custom list filter button send GET queryvars
- Filter authors on meta value
- Override email_exists function
- custom gallery filter with image caption as link title?
- Is this hook really deprecated? ( manage_{$taxonomy}_custom_column )
- arguments for comment_notification_text filter
- Add_filter rel=”prettyphoto” to WP3.4.1
- How can i filter wordpress users by custom feild?
- The gettext hook doesnt work on text with links
- Hide certain product filters from specific product categories
- WordPress Gutenberg core/heading block (wp-block-heading)
- Add an attribute to the root from functions.php with add_filter
- Would like to use hook or filters to customize email templates
- Removing menus from users other than the administrator
- Can’t understand apply_filter logic
- Why does wp_die() not work when inside a namespace?
- Apply pre_get_posts filter in a certain moment (just for a particular block of posts)
- Modify oembed code conditionally
- How to Change the WordPress Locale with the ‘locale’ Filter?
- meta box loop problem with a search filter
- Modify Default URL for /wp-includes/js/wp-emoji.js?ver=4.6.1
- List all image sizes still getting disabled sizes
- wp_editor customization
- What problems could happen if I replaced add_filter and add_action with the function calling
- posts_results filter function memory errors
- Adding to an array & passing it through do_action/apply_filters
- Is it possible to include the add_filter() function within a shortcode function
- Activate short codes for all post queries?
- Save something to global var in add_filter
- Loading a sidebar on an Ajax call
- the_excerpt() does not work with has_excerpt()?
- filter on the_content stopped working when I updated to WP 3.6.1
- Replace Paid Shipping Method With Free Shipping Method WooCommerce [duplicate]
- Clean/filter HTML inserted to post content by XML RPC
- how to localize the number of wordpress post views?
- Is it possible to make get variable out of filter in Class?
- How do you disable the verification process of user email changes?
- Modify the third (context) parameter in a filter?