I need to manipulate the
<img> string returned by
I know I can add the
$attr = "stuff here".
But how do I inject the source for the full size image into the one of the smaller sizes
('thumbnail', 'medium') strings.
I get this (simplified):
<img src="url/to/thumbnail_image" />
And need to end up with this (simplified):
<img src="url/to/thumbnail_image" data-zoom-image="url/to/large/image" />
I've tried to inject the larger images source path by trying to concatenate strings ...
$large_image_url = the_post_thumbnail_url( 'full' ); get_the_post_thumbnail( $the_post_id, 'medium', $attr = 'data-zoom-image=' . $large_image_url . '' );
But it gets stripped out. Anyone fought this before?
NOTE: I intentionally left out the wrapping quotation marks, as WP doubled them ... so that part of the output is working just fine.