get_post_meta()
calls get_metadata(), the parameter description of which says:
$single
(bool) (Optional) If true, return only the first value of the specified meta_key. This parameter has no effect if meta_key is not specified.Default value: false
So, since you are passing ''
as the meta_key, the $single
parameter is ignored.
Does that explain it?
Edit:
If you only want the 1st value for each meta key, then just do the following:
array_map ('array_shift', get_post_meta (get_the_ID (), '')) ;