By default, MyListing pulls from the Listing’s Logo when users use social sharing. This code snippet tells MyListing to use the first image in a Listing’s Gallery Images field for social sharing.
<?php
add_filter( 'mylistinglistingshareimage', function( $image, $listing ) {
if ( $gallery = $listing->get_field('gallery') ) {
return $gallery[0];
}
return $image;
}, 99, 2 );