/**
* Returns an array of all nested JSON files within a given directory.
*
* @since 6.2.0
*
* @param string $dir The directory to recursively iterate and list files of.
* @return array The merged array.
*/
private static function recursively_iterate_json( $dir ) { $nested_files =
new RecursiveIteratorIterator( new RecursiveDirectoryIterator( $dir ) );
$nested_json_files =
iterator_to_array( new RegexIterator( $nested_files, '/^.+\.json$/i', RecursiveRegexIterator::GET_MATCH
) );
return $nested_json_files;
} /**
* Returns the style variations defined by the theme.
*
* @since 6.0.0
* @since 6.2.0 Returns parent theme variations if theme is a child.
*
* @return array
*/