Make WordPress Core

Changeset 57027


Ignore:
Timestamp:
10/29/2023 12:14:46 AM (6 months ago)
Author:
SergeyBiryukov
Message:

Docs: Improve documentation for wp_tempnam() and download_url().

Instead of mentioning the unlink() function specifically, the DocBlock should state that the calling function must delete or move the temporary file.

Follow-up to [6779], [12151].

Props bedas.
Fixes #59761.

File:
1 edited

Legend:

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

    r56825 r57027  
    657657 * Returns a filename of a temporary unique file.
    658658 *
    659  * Please note that the calling function must unlink() this itself.
     659 * Please note that the calling function must delete or move the file.
    660660 *
    661661 * The filename is based off the passed parameter or defaults to the current unix timestamp,
     
    11401140 * Downloads a URL to a local temporary file using the WordPress HTTP API.
    11411141 *
    1142  * Please note that the calling function must unlink() the file.
     1142 * Please note that the calling function must delete or move the file.
    11431143 *
    11441144 * @since 2.5.0
     
    11541154 */
    11551155function download_url( $url, $timeout = 300, $signature_verification = false ) {
    1156     // WARNING: The file is not automatically deleted, the script must unlink() the file.
     1156    // WARNING: The file is not automatically deleted, the script must delete or move the file.
    11571157    if ( ! $url ) {
    11581158        return new WP_Error( 'http_no_url', __( 'Invalid URL Provided.' ) );
Note: See TracChangeset for help on using the changeset viewer.