add_filter(
'sp_wpcp_image_attachments',
function( $attachments, $shortcode_id ) {
// your shortocde id
if ( '1252' === $shortcode_id ) {
$gallery = get_field('gallery');
if ( is_array( $gallery ) ) {
$attachments = $gallery;
}
}
return $attachments;
},
10,
2
);
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter