WordPress at a glance
function is not described

_upgrade_422_find_genericons_files_in_folder() WP 4.2.2

Recursively find Genericons example files in a given folder.

No Hooks.

Return

Array.

Usage

_upgrade_422_find_genericons_files_in_folder( $directory );
$directory(string) (required)
Directory path. Expects trailingslashed.

Code of upgrade 422 find genericons files in folder: wp-admin/includes/update-core.php VER 5.1.1

<?php
function _upgrade_422_find_genericons_files_in_folder( $directory ) {
	$directory = trailingslashit( $directory );
	$files     = array();

	if ( file_exists( "{$directory}example.html" ) && false !== strpos( file_get_contents( "{$directory}example.html" ), '<title>Genericons</title>' ) ) {
		$files[] = "{$directory}example.html";
	}

	$dirs = glob( $directory . '*', GLOB_ONLYDIR );
	if ( $dirs ) {
		foreach ( $dirs as $dir ) {
			$files = array_merge( $files, _upgrade_422_find_genericons_files_in_folder( $dir ) );
		}
	}

	return $files;
}