This is usually used with elgg_get_entities() and friends,
elgg_get_annotations(), and elgg_get_metadata().
If you pass a valid PHP callback, all results will be run through that
callback. You can still foreach() through the result set after. Valid
PHP callbacks can be a string, an array, or a closure.
{@link http://php.net/manual/en/language.pseudo-types.php}
The callback function must accept 3 arguments: an entity, the getter
used, and the options used.
Results from the callback are stored in callbackResult. If the callback
returns only booleans, callbackResults will be the combined result of
all calls.
If the callback returns anything else, callbackresult will be an indexed
array of whatever the callback returns. If returning error handling
information, you should include enough information to determine which
result you're referring to.
Don't combine returning bools and returning something else.
Note that returning false will not stop the foreach.