Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: pre_recurse_dirsize

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
8272       * @since 5.6.0
8273       *
8274       * @param int|false            $space_used         The amount of used space, in bytes. Default false.
8275       * @param string               $directory          Full path of a directory.
8276       * @param string|string[]|null $exclude            Full path of a subdirectory to exclude from the total,
8277       *                                                 or array of paths.
8278       * @param int                  $max_execution_time Maximum time to run before giving up. In seconds.
8279       * @param array                $directory_cache    Array of cached directory paths.
8280       */
8281      $size = apply_filters( 'pre_recurse_dirsize', false, $directory, $exclude, $max_execution_time, $directory_cache );
8282
8283      if ( false === $size ) {
8284           $size = 0;
8285
8286           $handle = opendir( $directory );
8287           if ( $handle ) {
8288                while ( ( $file = readdir( $handle ) ) !== false ) {
8289                     $path = $directory . '/' . $file;
8290                     if ( '.' !== $file && '..' !== $file ) {