fs_ftp_connection_types
Filters the connection types to output to the filesystem credentials form.
Usage
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(array)
- Credentials to connect with.
- $type(string)
- Chosen filesystem method.
- $error(true|false|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.
Changelog
Since 2.9.0 | Introduced. |
Since 4.6.0 | The $context parameter default changed from false to an empty string. |
Where the hook is called
fs_ftp_connection_types
wp-admin/includes/file.php 2456
$types = apply_filters( 'fs_ftp_connection_types', $types, $credentials, $type, $error, $context );