Thanks DeBAAT.
I tried [gallery ids="20,18,19"] and found the problem still existed: after clicking on one of the images and then next/previous I would eventually get images from outside the gallery.
I couldn’t get any output from [wp-mcm alternative_shortcode=”gallery” category=”canada”] but on the assumption it would replicate the same problem I did the following in my child theme functions.php
1) add_filters to intercept the following:
add_filter(‘next_image_link’, ‘my_next_image_link’, 1, 2);
add_filter(‘previous_image_link’, ‘my_previous_image_link’, 1, 2);
2) add functions my_next_image_link (and previous) to allow a custom function my_adjacent_image_link which replaces the one in media.php
eg
function my_previous_image_link($size = ‘thumbnail’, $text = false) {
my_adjacent_image_link(true, $size, $text);
3) In this new function I check the category of adjacent images and if not the same as the original image then skip along the image array until a match is found.
Not really a problem of WP-MCM but it allows me to keep your fantastic image categorisation system.
Thanks again