fs_ftp_connection_types

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

Description

apply_filters( 'fs_ftp_connection_types', (array) $types, (array) $credentials, (string) $type, (object) $error, (string) $context ); 

Parameters (5)

0. $types (array)
Types of connections.
1. $credentials (array)
Credentials to connect with.
2. $type (string)
Chosen filesystem method.
3. $error (object)
Error object.
4. $context (string)
Full path to the directory that is tested for being writable.

Usage

To run the hook, copy the example below.
  1. $types = apply_filters( 'fs_ftp_connection_types', $types, $credentials, $type, $error, $context ); 
  2.  
  3. if ( !empty( $types ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the fs_ftp_connection_types callback 
  2. function filter_fs_ftp_connection_types( $types, $credentials, $type, $error, $context ) { 
  3. // make filter magic happen here... 
  4. return $types
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'fs_ftp_connection_types', 'filter_fs_ftp_connection_types', 10, 5 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'fs_ftp_connection_types', 'filter_fs_ftp_connection_types', 10, 5 ); 

Defined (1)

The filter is defined in the following location(s).

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