recurse_dirsize ( $directory, $exclude = null, $max_execution_time = null, $directory_cache = null )

  • (string) directory Full path of a directory.
  • (string|string[]) exclude Optional. Full path of a subdirectory to exclude from the total, or array of paths. Expected without trailing slash(es). Default null.
  • (int) max_execution_time Optional. Maximum time to run before giving up. In seconds. The timeout is global and is measured from the moment WordPress started to load. Defaults to the value of `max_execution_time` PHP setting.
  • (array) directory_cache Optional. Array of cached directory paths. Defaults to the value of `dirsize_cache` transient.
  • (int|false|null) Size in bytes if a valid directory. False if not. Null if timeout.
Defined at:
Change Log:
  • 4: .
  • 5: .
  • 5: .


Gets the size of a directory recursively.Used by get_dirsize() to get a directory size when it contains other directories.

Related Functions

get_dirsize, clean_dirsize_cache, remove_image_size, wp_recursive_ksort, rest_parse_date

Top Google Results

User discussions

wpseek mobile