Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



wp_make_theme_file_tree ›

Seit4.9.0
Veraltetn/v
wp_make_theme_file_tree ( $allowed_files )
Zugriff:
  • private
Parameter:
  • (array) $allowed_files List of theme file paths.
    Erforderlich: Ja
Gibt zurück:
  • (array) Tree structure for listing theme files.
Definiert in:
Codex:

Makes a tree structure for the Theme Editor's file list.



Quellcode

function wp_make_theme_file_tree( $allowed_files ) {
	$tree_list = array();
	foreach ( $allowed_files as $file_name => $absolute_filename ) {
		$list = explode( '/', $file_name );
		$last_dir = &$tree_list;
		foreach ( $list as $dir ) {
			$last_dir =& $last_dir[ $dir ];
		}
		$last_dir = $file_name;
	}
	return $tree_list;
}