select categories by ids/display terms only selected

It looks like this code is expecting slugs, which in the shortcode would look like this:

[portfolio columns="3" title="My Title" portfolio="cat20,cat22,cat35"]

(or whatever the actual category slugs are) instead of ids.

If slugs in the shortcode are ok, it looks like this might work as written. If you wanted IDs, you’d need to add ‘ids’=> ” in shortcode_atts, then rewrite the filter and query logic to use id instead of slug.