WP_Upgrader_Skin::request_filesystem_credentials() WordPress Method
The WP_Upgrader_Skin::request_filesystem_credentials() method is used to request the credentials needed to access the filesystem. This is used when the plugin or theme needs to modify files on the filesystem.
WP_Upgrader_Skin::request_filesystem_credentials( bool|WP_Error $error = false, string $context = '', bool $allow_relaxed_file_ownership = false ) #
Displays a form to the user to request for their FTP/SSH details in order to connect to the filesystem.
Description
See also
Parameters
- $error
(bool|WP_Error)(Optional) Whether the current request has failed to connect, or an error object.
Default value: false
- $context
(string)(Optional) Full path to the directory that is tested for being writable.
Default value: ''
- $allow_relaxed_file_ownership
(bool)(Optional) Whether to allow Group/World writable.
Default value: false
Return
(bool) True on success, false on failure.
Source
File: wp-admin/includes/class-wp-upgrader-skin.php
public function request_filesystem_credentials( $error = false, $context = '', $allow_relaxed_file_ownership = false ) { $url = $this->options['url']; if ( ! $context ) { $context = $this->options['context']; } if ( ! empty( $this->options['nonce'] ) ) { $url = wp_nonce_url( $url, $this->options['nonce'] ); } $extra_fields = array(); return request_filesystem_credentials( $url, '', $error, $context, $extra_fields, $allow_relaxed_file_ownership ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
4.6.0 | The $context parameter default changed from false to an empty string. |
2.8.0 | Introduced. |