diff --git a/wp-admin/includes/class-automatic-upgrader-skin.php b/wp-admin/includes/class-automatic-upgrader-skin.php index 094b727283..23fab8b424 100644 --- a/wp-admin/includes/class-automatic-upgrader-skin.php +++ b/wp-admin/includes/class-automatic-upgrader-skin.php @@ -22,11 +22,20 @@ class Automatic_Upgrader_Skin extends WP_Upgrader_Skin { protected $messages = array(); /** + * Determines whether the upgrader needs FTP/SSH details in order to connect + * to the filesystem. * - * @param bool $error - * @param string $context - * @param bool $allow_relaxed_file_ownership - * @return bool + * @since 3.7.0 + * @since 4.6.0 The `$context` parameter default changed from `false` to an empty string. + * + * @see request_filesystem_credentials() + * + * @param bool $error Optional. Whether the current request has failed to connect. + * Default false. + * @param string $context Optional. Full path to the directory that is tested + * for being writable. Default empty. + * @param bool $allow_relaxed_file_ownership Optional. Whether to allow Group/World writable. Default false. + * @return bool True on success, false on failure. */ public function request_filesystem_credentials( $error = false, $context = '', $allow_relaxed_file_ownership = false ) { if ( $context ) { diff --git a/wp-admin/includes/class-wp-upgrader-skin.php b/wp-admin/includes/class-wp-upgrader-skin.php index 518d9c1259..4c2b537d05 100644 --- a/wp-admin/includes/class-wp-upgrader-skin.php +++ b/wp-admin/includes/class-wp-upgrader-skin.php @@ -66,13 +66,22 @@ class WP_Upgrader_Skin { } /** + * Displays a form to the user to request for their FTP/SSH details in order + * to connect to the filesystem. * - * @param bool $error - * @param string $context - * @param bool $allow_relaxed_file_ownership - * @return type + * @since 2.8.0 + * @since 4.6.0 The `$context` parameter default changed from `false` to an empty string. + * + * @see request_filesystem_credentials() + * + * @param bool $error Optional. Whether the current request has failed to connect. + * Default false. + * @param string $context Optional. Full path to the directory that is tested + * for being writable. Default empty. + * @param bool $allow_relaxed_file_ownership Optional. Whether to allow Group/World writable. Default false. + * @return bool False on failure, true on success. */ - public function request_filesystem_credentials( $error = false, $context = false, $allow_relaxed_file_ownership = false ) { + public function request_filesystem_credentials( $error = false, $context = '', $allow_relaxed_file_ownership = false ) { $url = $this->options['url']; if ( ! $context ) { $context = $this->options['context']; diff --git a/wp-admin/includes/file.php b/wp-admin/includes/file.php index ad66a8d0a8..1250e36f6f 100644 --- a/wp-admin/includes/file.php +++ b/wp-admin/includes/file.php @@ -957,12 +957,12 @@ function WP_Filesystem( $args = false, $context = false, $allow_relaxed_file_own * * @param array $args Optional. Connection details. Default empty array. * @param string $context Optional. Full path to the directory that is tested - * for being writable. Default false. + * for being writable. Default empty. * @param bool $allow_relaxed_file_ownership Optional. Whether to allow Group/World writable. * Default false. * @return string The transport to use, see description for valid return values. */ -function get_filesystem_method( $args = array(), $context = false, $allow_relaxed_file_ownership = false ) { +function get_filesystem_method( $args = array(), $context = '', $allow_relaxed_file_ownership = false ) { $method = defined('FS_METHOD') ? FS_METHOD : false; // Please ensure that this is either 'direct', 'ssh2', 'ftpext' or 'ftpsockets' if ( ! $context ) { @@ -1027,15 +1027,15 @@ function get_filesystem_method( $args = array(), $context = false, $allow_relaxe * Displays a form to the user to request for their FTP/SSH details in order * to connect to the filesystem. * - * All chosen/entered details are saved, Excluding the Password. + * All chosen/entered details are saved, excluding the password. * * Hostnames may be in the form of hostname:portnumber (eg: wordpress.org:2467) * to specify an alternate FTP/SSH port. * - * Plugins may override this form by returning true|false via the - * {@see 'request_filesystem_credentials'} filter. + * Plugins may override this form by returning true|false via the {@see 'request_filesystem_credentials'} filter. * - * @since 2.5. + * @since 2.5.0 + * @since 4.6.0 The `$context` parameter default changed from `false` to an empty string. * * @global string $pagenow * @@ -1043,16 +1043,15 @@ function get_filesystem_method( $args = array(), $context = false, $allow_relaxe * @param string $type Optional. Chosen type of filesystem. Default empty. * @param bool $error Optional. Whether the current request has failed to connect. * Default false. - * @param string $context Optional. Full path to the directory that is tested - * for being writable. Default false. - * @param array $extra_fields Optional. Extra POST fields which should be checked for - * to be included in the post. Default null. - * @param bool $allow_relaxed_file_ownership Optional. Whether to allow Group/World writable. - * Default false. + * @param string $context Optional. Full path to the directory that is tested for being + * writable. Default empty. + * @param array $extra_fields Optional. Extra `POST` fields to be checked for inclusion in + * the post. Default null. + * @param bool $allow_relaxed_file_ownership Optional. Whether to allow Group/World writable. Default false. * * @return bool False on failure, true on success. */ -function request_filesystem_credentials( $form_post, $type = '', $error = false, $context = false, $extra_fields = null, $allow_relaxed_file_ownership = false ) { +function request_filesystem_credentials( $form_post, $type = '', $error = false, $context = '', $extra_fields = null, $allow_relaxed_file_ownership = false ) { global $pagenow; /** @@ -1062,6 +1061,7 @@ function request_filesystem_credentials( $form_post, $type = '', $error = false, * output of the filesystem credentials form, returning that value instead. * * @since 2.5.0 + * @since 4.6.0 The `$context` parameter default changed from `false` to an empty string. * * @param mixed $output Form output to return instead. Default empty. * @param string $form_post The URL to post the form to. @@ -1160,6 +1160,7 @@ function request_filesystem_credentials( $form_post, $type = '', $error = false, * Filters the connection types to output to the filesystem credentials form. * * @since 2.9.0 + * @since 4.6.0 The `$context` parameter default changed from `false` to an empty string. * * @param array $types Types of connections. * @param array $credentials Credentials to connect with. diff --git a/wp-includes/version.php b/wp-includes/version.php index 42dc19747f..a1722eb30d 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.6-beta4-38137'; +$wp_version = '4.6-beta4-38138'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.