WordPress开发者和主题制作者的搜索引擎



_upgrade_422_find_genericons_files_in_folder ›

Since4.2.2
已弃用n/a
_upgrade_422_find_genericons_files_in_folder ( $directory )
参数:
  • (string) $directory Directory path. Expects trailingslashed.
    Required: Yes
返回:
  • (array)
定义在:
文档:

Recursively find Genericons example files in a given folder.



源码

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