This works fine if I’m only returning data for a single meta key…but
fails if I want to return all of the meta data, but return them all as
strings (single).
This doesn’t make a lot of sense. A function in PHP can only return a single value so there is no way to return all meta as strings (plural). It has to come out as an array, or an object. And that is what the function does– you get a single value as a string or you get an array. If you don’t specify a key then the code has no way to know which key you want so you get them all, by defaurl not single. When you are not retrieving single values, WordPress does not collapse the nested array. If that is what you want, take it up with the Core developers on Trac. In the meantime, collapse the array yourself:
$meta = get_post_meta(350);
var_dump($meta);
foreach ($meta as $k => $v) {
$meta[$k] = array_shift($v);
}
Or:
foreach ($meta as &$v) {
$v = array_shift($v);
}
That may not bet he answer you hoped for, but I am pretty sure it is accurate. There might be a filter, but I doubt the effort would be worth it.