I think the best way to do this would be to add a filter to when the content is pulled into the post/page:
<?php add_filter( 'the_content', 'add_bw_thumbnails' ) ?>
Or to when an image is inserted into the editor:
add_filter( 'post_thumbnail_html', 'add_bw_thumbnails', 10 );
add_filter( 'image_send_to_editor', 'add_bw_thumbnails', 10 );
You then just have to write the function to do the replacement. Do you want to do this for all pages, or only those in a gallery, and are you sure 150×150 is the right thumbnail size?
Related Posts:
- Programmatically get images by URL and save in uploads folder
- Download an image from a webpage to the default uploads folder
- How to change image type for specific size?
- is it possible to replace the use of gd_lib with imagick or ImageMagick?
- How to find attachment by it’s name?
- Change WordPress image URLs via filter
- get_the_post_thumbnail_url with an unregistered size
- Any easy way to automatically set the first inline image in a post as the thumbnail?
- Insert an image into a post by API
- Programatically creating image attachments from local URLs and setting featured image
- How can I add the “Use as featured image” to a custom metabox?
- set_post_thumbnail_size not cropping featured images, but reducing proportionally
- How to grab first image attached to post and display in RSS feed?
- Double thumbnails?
- No srcset for hard-cropped thumbnails
- Is it possible to prevent users from uploading small images?
- Can’t Display Featured Image in RSS Feed
- Displaying a featured image (only img url) as the img src?
- Featured Images on Front Page
- Setup A Default Featured Image
- When displaying the featured image, is has_post_thumbnail() necessary?
- Find posts without featured image? [duplicate]
- How do I add a featured image to a single post page?
- Add a featured image in my theme?
- Disable wordpress image sizes generation
- Get original image from thumbnail URL
- Images are randomly deleted from server
- Frontend Post – Allow Only Image File Upload
- Images not working using Featured post
- Add instructions to featured image
- WordPress reduces the full size image and uses it as the original
- How do I get more image editing options in the admin?
- Special purpose photos with each post
- Woocommerce featured image of page – not product
- Set Post Image Using Shortcode
- Print specific image size in galley loop
- WordPress crops images differently on retina screens?
- Can’t seem to attach uploaded image to post and set it as thumbnail
- Big Image on Featured Post, Normal on Single Post
- offload media to external services [closed]
- Store Snapshot created via wordpress to use with lightbox
- How to stop thumbnail generation from some images and different size thumbnail generate
- How to stop wordpress always displaying full-res images
- How can I add a “data-pin-nopin” the featured image html?
- Custom Loop, Match Category with Page: How to display post featured image?
- Generate images to be associated for tag and category?
- How do I get my main image to stretch the full length of the screen?
- Filter for post_thumbnail: link to small src and add data-attribute [duplicate]
- Bulk-add featured images in posts with no featured image
- Should I not compress my jpeg files before uploading to avoid double compression?
- Is it possible to preserve original images in order to change image size later?
- Generating a certain sized thumbnail on the fly?
- add_image_size function not working
- Why doesn’t WordPress use the smaller sized image?
- How to set featured image from external url programmatically
- Hide Featured Image box – isn’t working?
- Is it possible to enable the ‘Link To’ field under ‘Attachment Display Settings’ for a Featured Image?
- Remove Additional image sizes created by theme
- Use default image as var
- Set two default featured images
- Set Featured Image not opening – Stuck at loading
- Placing a featured image into header
- How to add thumbnails to posts and pages automatically in a uniformed fixed elegant way?
- resize and crop thumbnail photos
- How do I display the featured image from an image gallery using a reference in code? (example within)
- Using different size thumbnails on different parts of my site… with functions.php?
- attach several images to post + gallery
- How to only show div of caption if caption exists on featured image
- WordPress Multisite: Images moved to /sites/1?
- How to echo images Urls from a wordpress post, that are relally in the post
- WordPress Responsive Image ( srcset ) not work properly
- How to Display Image Caption but Not Alt Text
- attachment_fields_to_save first parameter is null
- Get post thumbnail in specific size
- Image alt attribute
- I cannot upload images to post or the media library in wordpress
- Images missing from Blog post page
- Why image Thumbnail url is not displaying with custom size?
- How to set a post featured image from an already made custom field
- Why does wp_get_attachment_image_src return the wrong size, when the correct size exists?
- stop wordpress from resizing feature gif images
- second featured post not displaying on page [closed]
- set_post_thumbnail_size only working for width
- Delete post if featured image is smaller than Y pixels by Y pixels
- Newly uploaded images are not updating in featured image
- Troubles with code for upload a image
- Declare global variable that can be used on other function
- How do I get resized thumbnails?
- Making a thumbnail if there exist a link with. jpg or .png extension in WordPress
- Why is WordPress loading a different sized post thumbnail?
- Create post thumbnails from images stored outside of uploads directory
- Title image is missing ( but is not the WP 3.5 issue )
- Images will not attach to posts after site migration
- Using the on-board image editor for featured images: edits are not being used
- Tried everything but Facebook share button won’t load the post thumbnail
- has_post_thumbnail() Returns False on Scheduled Posts
- WP is showing wrong image dimensions
- Why some images are not allowed to be edited only for thumbnails?
- How to import external media items into wordpress media library (without using storage)
- How can I use an image from an external source without uploading it to the media library