WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/17/2020 03:42:57 PM (6 months ago)
Author:
SergeyBiryukov
Message:

Multisite: Rename the calculate_current_dirsize filter to pre_recurse_dirsize.

Set the default value to false. This brings some consistency with the pre_get_space_used filter.

Follow-up to [49212], [49616], [49628].

See #19879.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/functions.php

    r49628 r49629  
    76257625 */
    76267626function recurse_dirsize( $directory, $exclude = null, $max_execution_time = null, &$directory_cache = null ) {
    7627     $size = 0;
    7628 
    76297627    $directory  = untrailingslashit( $directory );
    76307628    $cache_path = untrailingslashit( str_replace( ABSPATH, '', $directory ) );
     
    76757673     * @since 5.6.0
    76767674     *
    7677      * @param int|false $space_used The amount of used space, in bytes. Default 0.
     7675     * @param int|false $space_used The amount of used space, in bytes. Default false.
    76787676     */
    7679     $size = apply_filters( 'calculate_current_dirsize', $size, $directory, $exclude, $max_execution_time, $directory_cache );
    7680 
    7681     if ( 0 === $size ) {
     7677    $size = apply_filters( 'pre_recurse_dirsize', false, $directory, $exclude, $max_execution_time, $directory_cache );
     7678
     7679    if ( false === $size ) {
     7680        $size = 0;
     7681
    76827682        $handle = opendir( $directory );
    76837683        if ( $handle ) {
     
    77047704        }
    77057705    }
     7706
    77067707    $directory_cache[ $cache_path ] = $size;
    77077708
Note: See TracChangeset for help on using the changeset viewer.