network-media-library
network-media-library copied to clipboard
Fix a bug on return format
Network-media-library ignores the return format on the central media site.
Thanks for the report. NML shouldn't need to make any changes to the return value of this function when operating on the central media site.
What's the exact issue that's occurring? Can you share a code example please?
If I set "Image Object" as the Return Value for an image field, var_dump( get_field( 'image' ) );
wouldn't return an array but a string of ID (e.g. string '2058' (length=4)
) on the central media site, but this returns an array (e.g. array (size=24) 'ID' => int 2058 ...
) normally on sites other than the central media site.
I can confirm this. The issue is that if a return format other than ID is used for a field fetched with get_field
on the central media site, the following conditional won't be true and the return format won't be respected.
https://github.com/humanmade/network-media-library/blob/master/network-media-library.php#L445
This was not the correct approach, so I'll close it. See #91