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

  • (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.
  • (string[]|false) Array of files on success, false on failure.
Defined at:
Change Log:
  • 4: .
  • 6: .


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, list_cats, is_single

Top Google Results

User discussions

wpseek mobile