Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function alter_image_src($attr)
- {
- $attr['srcset'] = str_replace('https://www.example.com/wp-content/uploads/', 'https://sub.example.com/', $attr['srcset']);
- return $attr;
- }
- add_filter('wp_get_attachment_image_attributes', 'alter_image_src');
- <p>
- <img class=" size-medium wp-image-467 alignleft" src="https://sub.example.com/2015/08/Zoom.From_.Sky_small-2.png" alt="Zoom.From.Sky_small" width="300" height="160" srcset="https://www.example.com/wp-content/uploads/2015/08/Zoom.From_.Sky_small-2.png 310w, https://www.example.com/wp-content/uploads/2015/08/Zoom.From_.Sky_small-2-100x53.png 100w" sizes="(max-width: 300px) 100vw, 300px">
- </p>
Add Comment
Please, Sign In to add comment