Make WordPress Core


Ignore:
Timestamp:
07/22/2016 12:09:55 PM (8 years ago)
Author:
ocean90
Message:

Filesystem API: Change the default value for the $context parameter of get_filesystem_method() and request_filesystem_credentials() to an empty string.

$context is a full path to the directory that is tested for being writable. A path shouldn't be a boolean value.
This also updates WP_Upgrader_Skin::request_filesystem_credentials() and Automatic_Upgrader_Skin::request_filesystem_credentials() and adds missing docs.

Props DrewAPicture, ocean90.
Fixes #37412.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-automatic-upgrader-skin.php

    r38023 r38138  
    2323
    2424    /**
     25     * Determines whether the upgrader needs FTP/SSH details in order to connect
     26     * to the filesystem.
    2527     *
    26      * @param bool   $error
    27      * @param string $context
    28      * @param bool   $allow_relaxed_file_ownership
    29      * @return bool
     28     * @since 3.7.0
     29     * @since 4.6.0 The `$context` parameter default changed from `false` to an empty string.
     30     *
     31     * @see request_filesystem_credentials()
     32     *
     33     * @param bool   $error                        Optional. Whether the current request has failed to connect.
     34     *                                             Default false.
     35     * @param string $context                      Optional. Full path to the directory that is tested
     36     *                                             for being writable. Default empty.
     37     * @param bool   $allow_relaxed_file_ownership Optional. Whether to allow Group/World writable. Default false.
     38     * @return bool True on success, false on failure.
    3039     */
    3140    public function request_filesystem_credentials( $error = false, $context = '', $allow_relaxed_file_ownership = false ) {
Note: See TracChangeset for help on using the changeset viewer.