Automatic_Upgrader_Skin::request_filesystem_credentials() WordPress Method

The Automatic_Upgrader_Skin::request_filesystem_credentials() method is used to request the credentials needed to access the filesystem. This is used when the filesystem needs to be accessed for various reasons, such as installing or upgrading WordPress.

Automatic_Upgrader_Skin::request_filesystem_credentials( bool|WP_Error $error = false, string $context = '', bool $allow_relaxed_file_ownership = false ) #

Determines whether the upgrader needs FTP/SSH details in order to connect to the filesystem.


Description

Top ↑

See also


Top ↑

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


Top ↑

Return

(bool) True on success, false on failure.


Top ↑

Source

File: wp-admin/includes/class-automatic-upgrader-skin.php

	public function request_filesystem_credentials( $error = false, $context = '', $allow_relaxed_file_ownership = false ) {
		if ( $context ) {
			$this->options['context'] = $context;
		}
		/*
		 * TODO: Fix up request_filesystem_credentials(), or split it, to allow us to request a no-output version.
		 * This will output a credentials form in event of failure. We don't want that, so just hide with a buffer.
		 */
		ob_start();
		$result = parent::request_filesystem_credentials( $error, $context, $allow_relaxed_file_ownership );
		ob_end_clean();
		return $result;
	}


Top ↑

Changelog

Changelog
VersionDescription
4.6.0The $context parameter default changed from false to an empty string.
3.7.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.