the function wp_filter_object_list
can only filter one value.
for your filter try that :
$post_tags = array_filter($post_tags, function ($e) {
return in_array($e->slug, ["dog", "cat"]);
});
the function wp_filter_object_list
can only filter one value.
for your filter try that :
$post_tags = array_filter($post_tags, function ($e) {
return in_array($e->slug, ["dog", "cat"]);
});