For those familiar with Spectra blocks, for its image gallery block, I’m looking to display the alt text instead of caption which isn’t an option in the block’s caption setting. I haven’t edited a plugin before so I’m just trying to find my way through the gallery block php file. I believe the following function might be where I need to apply the edit but I’m not sure where or what the call is for alt text. Thanks in advance!
private function render_media_caption( $mediaArray, $atts ) {
$limitedCaption = ( isset( $mediaArray[‘caption’] ) && $mediaArray[‘caption’] ) ? (
$mediaArray[‘caption’]
) : (
$mediaArray[‘url’] ? (
$atts[‘imageDefaultCaption’]
) : (
__( ‘Unable to load image’, ‘ultimate-addons-for-gutenberg’ )
)
);
?>
<div class=”spectra-image-gallery__media-thumbnail-caption spectra-image-gallery__media-thumbnail-caption–<?php echo esc_attr( $atts[‘captionDisplayType’] ); ?>”>
<?php echo wp_kses_post( $limitedCaption ); ?>
</div>
<?php
}
