Filter hook 'filesystem_method'

in WP Core File wp-admin/includes/file.php at line 2332

View Source

filesystem_method

Filter Hook
Description
Filters the filesystem method to use.

Hook Information

File Location wp-admin/includes/file.php View on GitHub
Hook Type Filter
Line Number 2332

Hook Parameters

Type Name Description
string $method Filesystem method to return.
array $args An array of connection details for the method.
string $context Full path to the directory that is tested for being writable.
bool $allow_relaxed_file_ownership Whether to allow Group/World writable.

Usage Examples

Basic Usage
<?php
// Hook into filesystem_method
add_filter('filesystem_method', 'my_custom_filter', 10, 4);

function my_custom_filter($method, $args, $context, $allow_relaxed_file_ownership) {
    // Your custom filtering logic here
    return $method;
}

Source Code Context

wp-admin/includes/file.php:2332 - How this hook is used in WordPress core
<?php
2327  	 * @param string $method                       Filesystem method to return.
2328  	 * @param array  $args                         An array of connection details for the method.
2329  	 * @param string $context                      Full path to the directory that is tested for being writable.
2330  	 * @param bool   $allow_relaxed_file_ownership Whether to allow Group/World writable.
2331  	 */
2332  	return apply_filters( 'filesystem_method', $method, $args, $context, $allow_relaxed_file_ownership );
2333  }
2334  
2335  /**
2336   * Displays a form to the user to request for their FTP/SSH details in order
2337   * to connect to the filesystem.

PHP Documentation

<?php
/**
	 * Filters the filesystem method to use.
	 *
	 * @since 2.6.0
	 *
	 * @param string $method                       Filesystem method to return.
	 * @param array  $args                         An array of connection details for the method.
	 * @param string $context                      Full path to the directory that is tested for being writable.
	 * @param bool   $allow_relaxed_file_ownership Whether to allow Group/World writable.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 4
  • File: wp-admin/includes/file.php
Related Hooks

Related hooks will be displayed here in future updates.