Hi Spinaker,
I don’t have any experience with using MetaSlider, but it looks like they surface their image tag attributes with the metaslider_{type}_image_attributes
filter. You can generate the srcset
value attribute by using TNSrcSet::get_image_srcset( $attachment_id, $size );
. Example usage may be something like the following:
add_filter( 'metaslider_flex_slider_image_attributes', 'spinaker_metaslider_srcset_attribute', 10, 3 );
function spinaker_metaslider_srcset_attribute( $attributes, $slide, $slider_id ) {
// $attachment_id and $size will need to be replaced by your own data
$attributes['srcset'] = TNSrcSet::get_image_srcset( $attachment_id, $size );
return $attributes;
}