A WordPress-centric search engine for devs and theme authors



_upgrade_422_find_genericons_files_in_folder ›

Since4.2.2
Deprecatedn/a
_upgrade_422_find_genericons_files_in_folder ( $directory )
Parameters:
  • (string) $directory Directory path. Expects trailingslashed.
    Required: Yes
Returns:
  • (array)
Defined at:
Codex:

Recursively find Genericons example files in a given folder.



Source

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;
}