list_files


list_files ( $folder = '', $levels = 100, $exclusions = array(), $include_hidden = false )

Parameters:
  • (string) folder Optional. Full path to folder. Default empty.
  • (int) levels Optional. Levels of folders to follow, Default 100 (PHP Loop limit).
  • (string[]) exclusions Optional. List of folders and files to skip.
  • (bool) include_hidden Optional. Whether to include details of hidden ("." prefixed) files. Default false.
Returns:
  • (string[]|false) Array of files on success, false on failure.
Defined at:
Change Log:
  • 4: .
  • 6: .

Description

Returns a listing of all files in the specified folder and all subdirectories up to 100 levels deep.The depth of the recursiveness can be controlled by the $levels param.

Related Functions

wp_list_filter, validate_file, wp_list_widgets, is_single, list_cats

Top Google Results

User discussions

wpseek mobile