id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc,focuses 45273,get_postmeta: Inconsistent behavior of the 'single'-argument,josk79,,"The phpdoc of the ''get_postmeta''-function in meta.php mentions that the ''single''-argument has no effect if ''meta_key'' is not specified. This is not true when the ''get_{$meta_type}_metadata''-filter is used. If this filter returns an array and ''single'' is true only the first item of the array is returned. This not the expected behavior when ''meta_key'' is empty. In my opinion this part: {{{#!php $check = apply_filters( ""get_{$meta_type}_metadata"", null, $object_id, $meta_key, $single ); if ( null !== $check ) { if ( $single && is_array( $check ) ) { return $check[0]; } else { return $check; } } }}} should be replace by: {{{#!php $check = apply_filters( ""get_{$meta_type}_metadata"", null, $object_id, $meta_key, $single ); if ( null !== $check ) { if ( $meta_key && $single && is_array( $check ) ) { return $check[0]; } else { return $check; } } }}} (Notice how I added {{{$meta_key && }}}) NOTE: This is a breaking change in the rare occasion that ''get_{$meta_type}_metadata''-filter is used in combination with an empty ''meta_key'' and ''single'' == true. If a fix is not desired; phpdoc must be changed to document this inconsistent behavior. ",defect (bug),new,normal,Awaiting Review,"Options, Meta APIs",,normal,,2nd-opinion,,