wpseek.com
A WordPress-centric search engine for devs and theme authors
clean_dirsize_cache › WordPress Function
Since5.6.0
Deprecatedn/a
› clean_dirsize_cache ( $path )
Parameters: |
|
Defined at: |
|
Codex: |
Cleans directory size cache used by recurse_dirsize().
Removes the current directory and all parent directories from thedirsize_cache
transient.Related Functions: clean_user_cache, clean_post_cache, clean_term_cache, clean_page_cache, wp_clean_update_cache
Source
function clean_dirsize_cache( $path ) { $directory_cache = get_transient( 'dirsize_cache' ); if ( empty( $directory_cache ) ) { return; } $path = untrailingslashit( $path ); unset( $directory_cache[ $path ] ); while ( DIRECTORY_SEPARATOR !== $path && '.' !== $path && '..' !== $path ) { $path = dirname( $path ); unset( $directory_cache[ $path ] ); } set_transient( 'dirsize_cache', $directory_cache ); }