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
8286       * @since 5.6.0
8287       *
8288       * @param int|false            $space_used         The amount of used space, in bytes. Default false.
8289       * @param string               $directory          Full path of a directory.
8290       * @param string|string[]|null $exclude            Full path of a subdirectory to exclude from the total,
8291       *                                                 or array of paths.
8292       * @param int                  $max_execution_time Maximum time to run before giving up. In seconds.
8293       * @param array                $directory_cache    Array of cached directory paths.
8294       */
8295      $size = apply_filters( 'pre_recurse_dirsize', false, $directory, $exclude, $max_execution_time, $directory_cache );
8296
8297      if ( false === $size ) {
8298           $size = 0;
8299
8300           $handle = opendir( $directory );
8301           if ( $handle ) {
8302                while ( ( $file = readdir( $handle ) ) !== false ) {
8303                     $path = $directory . '/' . $file;
8304                     if ( '.' !== $file && '..' !== $file ) {