No, not strictly. You can check the source and see that there is no hook that would let you alter the URL.
You should also notice this interesting bit of code:
512 if ( $image = image_downsize($attachment_id, $size) )
513 return $image;
Follow the trail to here and you get this:
141 // plugins can use this to provide resize services
142 if ( $out = apply_filters( 'image_downsize', false, $id, $size ) )
143 return $out;
If you hook into image_downsize…
add_filter(
'image_downsize',
function ($f,$id,$size) {
// your own downsize function
},
10,3
);
wp_get_attachment_image_src(4);
… you should be able to return any URL you want, but it means you will need to duplicate more or less the whole of image_downsize() with changes of course.
Related Posts:
- Change Image URL to a CDN
- Host images only on CDN
- Jetpack’s photon causes local site to try and serve images from WordPress CDN [closed]
- How to configure sub-domain for images on Debian Apache VPS?
- Change media URL (images)
- Make Jetpack CDN to filter/ignore images based on SRC [closed]
- Automatically replace original uploaded image with large image size
- How to scale up featured post thumbnail?
- Custom image size / thumbnail – Crop to aspect ratio even when source image is smaller than set dimensions
- wp_get_attachment_image_src and server path
- get_post_gallery_images returns thumbs . I want full size
- How to resize images in wordpress without adding any compression or changing the color profile of the images, possible?
- Why is wp_get_attachment_image not including “full” size in srcset?
- Get img alt tag from a Image that has been uploaded through the Customizer
- Get Attachment ID from URL [duplicate]
- How to set twenty fourteen header image at 100% width?
- Can’t Display Featured Image in RSS Feed
- Filter to modify post_title after image upload?
- Generate image size, based on the image-orientation
- Import Images from one self-hosted WordPress install to another
- How to Optimize images after uploading all images to WordPress Site?
- How to get relative URL of medium sized featured image?
- How do i reference the theme path in pages for images?
- How to Add extra option to Image Block Settings?
- Using srcsets to load different images based on browser widths
- Multiple entries for one object with different cover images
- How to exclude an image size from the WordPress srcset
- Automatically replace original uploaded image with large image size
- Problem with loading images from child theme CSS file with relevant path
- Plupload resize for worpdress
- File format of post image attachment
- How to display a different image size for mobile
- Photography Based Design – Multiple Images Per Post
- SEO images in Nextgen Galleries
- Remove Size images without use
- Woocommerce featured image of page – not product
- Can’t seem to attach uploaded image to post and set it as thumbnail
- Add an attribute to attachments
- Include caption underneath post images
- Domain Change with New Image Sizes
- Why no images on a fresh WordPress installation?
- How to prevent WordPress scaling large images down
- How to stop thumbnail generation from some images and different size thumbnail generate
- wordpress (woocommerce) add image to media library programmatically python
- wp_customize_image_control deprecated add_tab alternative
- How to translate get_intermediate_image_sizes?
- How to add image in rss?
- Does wp_get_attachment_image_src also work with non-image files?
- Console Browser says it cannot find a requested image that does not exist on my Website [closed]
- Display attached images as background-image css
- How to set a Background image in WordPress?
- Remove Additional image sizes created by theme
- Images don’t load erratically
- Weird encoded error when using wp_generate_attachment_metadata()
- Show Image Size as Dragging it Larger or Smaller
- Logo on the tab
- I want to rel=nofollow wordpress images
- How to get image name, mime type, width, height, file size from post custom field?
- How to automatically populate a gallery with images attached to posts of one category?
- How to edit caption for images and exclude it from excerption query?
- Can’t seem to see images on my machine but can on the server
- Add a span tag around image
- fitting the thumbnail image into a div
- Editing already up-loaded images
- Regenerate BIG threshold scaled images
- Change Image in Mobile Search Results
- WordPress Link To Image Missing Dropdown
- Is there a way to create referable automatic numbering in image captions?
- WooCommerce Variation Swatches and Photos – get attribute thumbnail
- Issues Adding a jQuery Image Slider
- set_post_thumbnail_size only working for width
- Getting the closest named image size from an array of dimensions
- link image file path embedded HTML
- Newly uploaded images are not updating in featured image
- How to attach post ID to image links in WordPress tinymce editor
- How to stop a post from publishing if the file upload is not a image/gif
- Troubles with code for upload a image
- get_post_meta returning broken path in image src
- Duplicate images in wordpress
- Custom WordPress Theme – No Slider(s) Images
- Images not showing after moving site
- Search and replace image urls in posts
- Thickbox not displaying just the image, instead showing full page in lightbox
- Post Images Size Change in WordPress
- Show uploaded images in full size
- Garbled HTML pulled for page description “caption id=attachment…”
- trouble with featured image
- How do I set the sizes of my thumbnails when inserting a [gallery]?
- Have a rotating image covering body only on front page?
- Img src path from wp-admin
- get_post_custom: get image URL instead of image ID
- Featured Image not changing
- has_post_thumbnail() Returns False on Scheduled Posts
- Automatically adding blog images to a portfolio/gallery
- Can’t manage to display an uploaded picture (uploaded from a custom button) in the front end
- Script not working in WordPress [duplicate]
- if user role is x – show image – wordpress
- Understanding images handeling
- Best practice for WordPress media image use
- Customize all image captions