WP_Theme_JSON_Resolver::recursively_iterate_json()
Returns an array of all nested JSON files within a given directory.
Метод класса: WP_Theme_JSON_Resolver{}
Хуков нет.
Возвращает
Массив
. The merged array.
Использование
$result = WP_Theme_JSON_Resolver::recursively_iterate_json( $dir );
- $dir(строка) (обязательный)
- The directory to recursively iterate and list files of.
Список изменений
С версии 6.2.0 | Введена. |
Код WP_Theme_JSON_Resolver::recursively_iterate_json() WP Theme JSON Resolver::recursively iterate json WP 6.6.1
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; }