WordPress recently depreciated wp_get_sites() in favor of get_sites() in version 4.6. I've seen a few updates where people are pushing out changes to their code by simply switching it from wp_get_sites() to get_sites(). However, I noticed this one today:
$sites = wp_get_sites();
foreach ( $sites as $site ) {
...
to
$sites = ( function_exists( 'get_sites' ) ) ? get_sites() : wp_get_sites();
foreach ( $sites as $site ) {
$site = (array) $site;
...
What does this change do and why would it be useful over removing wp_ from the old function to use the new one? How does it work?
Where can I learn more about using the shortened version where it checks for the function and has a fallback all in one line? Is there a name for this?