Docs: Update the docs for the error parameter that gets passed around during filesystem credential collection.

See #48303


git-svn-id: https://develop.svn.wordpress.org/trunk@46597 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
John Blackbourn 2019-10-26 23:14:59 +00:00
parent 4f281f1650
commit 3559504161
3 changed files with 34 additions and 35 deletions

View File

@ -30,11 +30,11 @@ class Automatic_Upgrader_Skin extends WP_Upgrader_Skin {
*
* @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.
* @param bool|WP_Error $error Optional. Whether the current request has failed to connect,
* or an error object. 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 ) {

View File

@ -76,11 +76,11 @@ class WP_Upgrader_Skin {
*
* @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.
* @param bool|WP_Error $error Optional. Whether the current request has failed to connect,
* or an error object. 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 = '', $allow_relaxed_file_ownership = false ) {

View File

@ -1931,15 +1931,15 @@ function get_filesystem_method( $args = array(), $context = '', $allow_relaxed_f
*
* @global string $pagenow
*
* @param string $form_post The URL to post the form to.
* @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 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.
* @param string $form_post The URL to post the form to.
* @param string $type Optional. Chosen type of filesystem. Default empty.
* @param bool|WP_Error $error Optional. Whether the current request has failed to connect,
* or an error object. 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 True on success, false on failure.
*/
@ -1955,16 +1955,16 @@ function request_filesystem_credentials( $form_post, $type = '', $error = false,
* @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.
* @param string $type Chosen type of filesystem.
* @param bool $error Whether the current request has failed to connect.
* Default false.
* @param string $context Full path to the directory that is tested for
* being writable.
* @param bool $allow_relaxed_file_ownership Whether to allow Group/World writable.
* Default false.
* @param array $extra_fields Extra POST fields.
* @param mixed $output Form output to return instead. Default empty.
* @param string $form_post The URL to post the form to.
* @param string $type Chosen type of filesystem.
* @param bool|WP_Error $error Optional. Whether the current request has failed to connect,
* or an error object. Default false.
* @param string $context Full path to the directory that is tested for
* being writable.
* @param bool $allow_relaxed_file_ownership Whether to allow Group/World writable.
* Default false.
* @param array $extra_fields Extra POST fields.
*/
$req_cred = apply_filters( 'request_filesystem_credentials', '', $form_post, $type, $error, $context, $extra_fields, $allow_relaxed_file_ownership );
if ( '' !== $req_cred ) {
@ -2083,12 +2083,11 @@ function request_filesystem_credentials( $form_post, $type = '', $error = false,
* @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.
* @param string $type Chosen filesystem method.
* @param object $error Error object.
* @param string $context Full path to the directory that is tested
* for being writable.
* @param string[] $types Types of connections.
* @param array $credentials Credentials to connect with.
* @param string $type Chosen filesystem method.
* @param WP_Error|bool $error Error object or status.
* @param string $context Full path to the directory that is tested for being writable.
*/
$types = apply_filters( 'fs_ftp_connection_types', $types, $credentials, $type, $error, $context );