Make WordPress Core


Ignore:
Timestamp:
07/22/2016 12:09:55 PM (9 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-wp-upgrader-skin.php

    r38134 r38138  
    6767
    6868    /**
    69      *
    70      * @param bool   $error
    71      * @param string $context
    72      * @param bool   $allow_relaxed_file_ownership
    73      * @return type
    74      */
    75     public function request_filesystem_credentials( $error = false, $context = false, $allow_relaxed_file_ownership = false ) {
     69     * Displays a form to the user to request for their FTP/SSH details in order
     70     * to connect to the filesystem.
     71     *
     72     * @since 2.8.0
     73     * @since 4.6.0 The `$context` parameter default changed from `false` to an empty string.
     74     *
     75     * @see request_filesystem_credentials()
     76     *
     77     * @param bool   $error                        Optional. Whether the current request has failed to connect.
     78     *                                             Default false.
     79     * @param string $context                      Optional. Full path to the directory that is tested
     80     *                                             for being writable. Default empty.
     81     * @param bool   $allow_relaxed_file_ownership Optional. Whether to allow Group/World writable. Default false.
     82     * @return bool False on failure, true on success.
     83     */
     84    public function request_filesystem_credentials( $error = false, $context = '', $allow_relaxed_file_ownership = false ) {
    7685        $url = $this->options['url'];
    7786        if ( ! $context ) {
Note: See TracChangeset for help on using the changeset viewer.