Make WordPress Core


Ignore:
Timestamp:
11/17/2020 03:36:02 PM (5 years ago)
Author:
SergeyBiryukov
Message:

Docs: Adjust comments for recurse_dirsize() and related tests per the documentation standards.

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

See #19879.

File:
1 edited

Legend:

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

    r49616 r49628  
    76087608 * Get the size of a directory recursively.
    76097609 *
    7610  * Used by get_dirsize() to get a directory's size when it contains
    7611  * other directories.
     7610 * Used by get_dirsize() to get a directory size when it contains other directories.
    76127611 *
    76137612 * @since MU (3.0.0)
    7614  * @since 4.3.0 $exclude parameter added.
    7615  * @since 5.2.0 $max_execution_time parameter added.
    7616  * @since 5.6.0 $directory_cache parameter added.
     7613 * @since 4.3.0 The `$exclude` parameter was added.
     7614 * @since 5.2.0 The `$max_execution_time` parameter was added.
     7615 * @since 5.6.0 The `$directory_cache` parameter was added.
    76177616 *
    76187617 * @param string       $directory          Full path of a directory.
     
    76697668
    76707669    /**
    7671     * Filters the amount of storage space used by one directory and all it's children, in megabytes.
    7672     * Return the actual used space to shortcircuit the recursive PHP file size calculation and use something else
    7673     * like a CDN API or native operating system tools for better performance
    7674     *
    7675     * @since 5.6.0
    7676     *
    7677     * @param int|false $space_used The amount of used space, in bytes. Default 0.
    7678     */
     7670     * Filters the amount of storage space used by one directory and all its children, in megabytes.
     7671     *
     7672     * Return the actual used space to short-circuit the recursive PHP file size calculation
     7673     * and use something else, like a CDN API or native operating system tools for better performance.
     7674     *
     7675     * @since 5.6.0
     7676     *
     7677     * @param int|false $space_used The amount of used space, in bytes. Default 0.
     7678     */
    76797679    $size = apply_filters( 'calculate_current_dirsize', $size, $directory, $exclude, $max_execution_time, $directory_cache );
    76807680
     
    77067706    $directory_cache[ $cache_path ] = $size;
    77077707
    7708     // Only write the transient on the top level call and not on recursive calls
     7708    // Only write the transient on the top level call and not on recursive calls.
    77097709    if ( $save_cache ) {
    77107710        set_transient( 'dirsize_cache', $directory_cache );
     
    77157715
    77167716/**
    7717  * Invalidates entries within the dirsize_cache
    7718  *
    7719  * Remove the current directory and all parent directories
    7720  * from the dirsize_cache transient.
     7717 * Cleans directory size cache used by recurse_dirsize().
     7718 *
     7719 * Removes the current directory and all parent directories from the `dirsize_cache` transient.
    77217720 *
    77227721 * @since 5.6.0
Note: See TracChangeset for help on using the changeset viewer.