request_filesystem_credentials WordPress Filter Hook

The request_filesystem_credentials hook is used to request credentials from the user in order to access the filesystem. This hook is typically used when a plugin or theme needs to access the filesystem in order to perform an operation.

apply_filters( 'request_filesystem_credentials', mixed $credentials, string $form_post, string $type, bool|WP_Error $error, string $context, array $extra_fields, bool $allow_relaxed_file_ownership ) #

Filters the filesystem credentials.


Description

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.


Top ↑

Parameters

$credentials

(mixed)Credentials to return instead. Default empty string.

$form_post

(string)The URL to post the form to.

$type

(string)Chosen type of filesystem.

$error

(bool|WP_Error)Whether the current request has failed to connect, or an error object.

$context

(string)Full path to the directory that is tested for being writable.

$extra_fields

(array)Extra POST fields.

$allow_relaxed_file_ownership

(bool)Whether to allow Group/World writable.


Top ↑

Source

File: wp-admin/includes/file.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
4.6.0The $context parameter default changed from false to an empty string.
2.5.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.