I’ve done a bit of searching on Google with various search terms and haven’t managed to find any mention of this being possible.
What I’d like to be able to do is pass multiple field IDs to get_field to prevent having to AND/OR them all in sequence.
Let’s say we only want to show div for social icons if any social networks are configured, and only want to show each icon if that specific network is configured. First we’d check if any of them exist…
if( get_field('twitter', 'option') || get_field('facebook', 'option') || etc )
…and if true we start the div and then check each one individually (which is fine, we can just create an array of networks and foreach it).
The issue comes when there’s a lot of configurable social networks; the line above then becomes a huge statement of ORs. It would be useful if it were possible to provide multiple IDs. For example:
if( get_field(['twitter','facebook',etc], 'option') )
or pre PHP5.5:
if( get_field(array('twitter','facebook',etc), 'option') )
I understand that it wouldn’t be possible for the_field() though as that skips the step where we decide which value to output if multiple are returned.