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

  • (string) $folder Optional. Full path to folder. Default empty.
  • (int) $levels Optional. Levels of folders to follow, Default 100 (PHP Loop limit).
  • (array) $exclusions Optional. List of folders and files to skip.
  • (bool|array) False on failure, Else array of files
Defined at:
Change Log:
  • 4: .


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_meta

Top Google Results

User discussions

wpseek mobile