Make WordPress Core

Ticket #54221: add_year_expiration_to_dirsize_cache_transient.patch

File add_year_expiration_to_dirsize_cache_transient.patch, 1.2 KB (added by nicomollet, 23 months ago)

Adding year expiration to dirsize_cache transient so that it can be updated with autoload=no

  • wp-includes/functions.php

    Subject: [PATCH] Add year expiration to dirsize_cache transient so that it is not autoloaded
    ---
    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/wp-includes/functions.php b/wp-includes/functions.php
    a b  
    83188318
    83198319        // Only write the transient on the top level call and not on recursive calls.
    83208320        if ( $save_cache ) {
    8321                 set_transient( 'dirsize_cache', $directory_cache );
     8321                set_transient( 'dirsize_cache', $directory_cache, YEAR_IN_SECONDS );
    83228322        }
    83238323
    83248324        return $size;
     
    83588358                strpos( $path, '\\' ) === false
    83598359        ) {
    83608360                unset( $directory_cache[ $path ] );
    8361                 set_transient( 'dirsize_cache', $directory_cache );
     8361                set_transient( 'dirsize_cache', $directory_cache, YEAR_IN_SECONDS );
    83628362                return;
    83638363        }
    83648364
     
    83778377                unset( $directory_cache[ $path ] );
    83788378        }
    83798379
    8380         set_transient( 'dirsize_cache', $directory_cache );
     8380        set_transient( 'dirsize_cache', $directory_cache, YEAR_IN_SECONDS );
    83818381}
    83828382
    83838383/**