Filter hook 'request_filesystem_credentials'

in WP Core File wp-admin/includes/file.php at line 2396

Description

Filters the filesystem credentials. Returning anything other than an empty string will effectively short-circuit output of the filesystem credentials form, returning that value instead. A filter should return true if no filesystem credentials are required, false if they are required but have not been provided, or an array of credentials if they are required and have been provided.

Occurrences

Filename Line Number
wp-admin/includes/file.php 2396

Parameters

Type Name Description
mixed $credentials Credentials to return instead. Default empty string.
string $form_post The URL to post the form to.
string $type Chosen type of filesystem.
bool|WP_Error $error Whether the current request has failed to connect, or an error object.
string $context Full path to the directory that is tested for being writable.
array $extra_fields Extra POST fields.
bool $allow_relaxed_file_ownership Whether to allow Group/World writable.

PHP Doc

/**
	 * Filters the filesystem credentials.
	 *
	 * Returning anything other than an empty string will effectively short-circuit
	 * output of the filesystem credentials form, returning that value instead.
	 *
	 * A filter should return true if no filesystem credentials are required, false if they are required but have not been
	 * provided, or an array of credentials if they are required and have been provided.
	 *
	 * @since 2.5.0
	 * @since 4.6.0 The `$context` parameter default changed from `false` to an empty string.
	 *
	 * @param mixed         $credentials                  Credentials to return instead. Default empty string.
	 * @param string        $form_post                    The URL to post the form to.
	 * @param string        $type                         Chosen type of filesystem.
	 * @param bool|WP_Error $error                        Whether the current request has failed to connect,
	 *                                                    or an error object.
	 * @param string        $context                      Full path to the directory that is tested for
	 *                                                    being writable.
	 * @param array         $extra_fields                 Extra POST fields.
	 * @param bool          $allow_relaxed_file_ownership Whether to allow Group/World writable.
	 */