Here is what I came up with that works to add to the Tailwind and Pinterest buttons both the image and description. I am sure there is a cleaner way from within the plugin. I used code from some of your other functions to create the filter.
//Social Image Filter
function sss_pnw_pinterest_attributes( ) {
$pinterest_id = get_post_meta( get_the_ID(), ‘_scriptlesssocialsharing_pinterest’, true );
return array(
‘data-pin-media’ => pnw_pinterest_url($pinterest_id),
‘style’ => ‘display:none;’,
‘alt’ => $alt_text ? $alt_text : the_title_attribute( ‘echo=0’ ),
‘data-pin-description’ => pnw_pinterest_description($pinterest_id),
‘class’ => ‘scriptless__pinterest-image’,
);
}
function sss_pnw_pinterest_description ($id) {
$pinterest_alt = get_post_meta( get_the_ID(), ‘_scriptlesssocialsharing_description’, true );
if ( $pinterest_alt ) {
return $pinterest_alt;
}
$pinterest_alt = get_post_meta( $id, ‘_wp_attachment_image_alt’, true );
return $pinterest_alt ? $pinterest_alt : $this->attributes[‘title’];
}
function sss_pnw_pinterest_url($id ) {
$source = wp_get_attachment_image_src( $id , ‘large’, false );
return apply_filters( ‘scriptlesssocialsharing_image_url’, isset( $source[0] ) ? $source[0] : ” );
}
add_filter( ‘scriptlesssocialsharing_pinterest_image_attributes’, ‘sss_pnw_pinterest_attributes’);`