fs_ftp_connection_types хук-фильтрWP 2.9.0

Filters the connection types to output to the filesystem credentials form.

Использование

add_filter( 'fs_ftp_connection_types', 'wp_kama_fs_ftp_connection_types_filter', 10, 5 );

/**
 * Function for `fs_ftp_connection_types` filter-hook.
 * 
 * @param string[]      $types       Types of connections.
 * @param array         $credentials Credentials to connect with.
 * @param string        $type        Chosen filesystem method.
 * @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.
 *
 * @return string[]
 */
function wp_kama_fs_ftp_connection_types_filter( $types, $credentials, $type, $error, $context ){

	// filter...
	return $types;
}
$types(string[])
Types of connections.
$credentials(массив)
Credentials to connect with.
$type(строка)
Chosen filesystem method.
$error(true|false|WP_Error)
Whether the current request has failed to connect, or an error object.
$context(строка)
Full path to the directory that is tested for being writable.

Список изменений

С версии 2.9.0 Введена.
С версии 4.6.0 The $context parameter default changed from false to an empty string.

Где вызывается хук

request_filesystem_credentials()
fs_ftp_connection_types
wp-admin/includes/file.php 2337
$types = apply_filters( 'fs_ftp_connection_types', $types, $credentials, $type, $error, $context );

Где используется хук в WordPress

Использование не найдено.