Filter hook 'filesystem_method_file'

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

View Source

filesystem_method_file

Filter Hook
Description
Filters the path for a specific filesystem method class file.

Hook Information

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

Hook Parameters

Type Name Description
string $path Path to the specific filesystem method class file.
string $method The filesystem method to use.

Usage Examples

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

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

Source Code Context

wp-admin/includes/file.php:2193 - How this hook is used in WordPress core
<?php
2188  		 * @see get_filesystem_method()
2189  		 *
2190  		 * @param string $path   Path to the specific filesystem method class file.
2191  		 * @param string $method The filesystem method to use.
2192  		 */
2193  		$abstraction_file = apply_filters( 'filesystem_method_file', ABSPATH . 'wp-admin/includes/class-wp-filesystem-' . $method . '.php', $method );
2194  
2195  		if ( ! file_exists( $abstraction_file ) ) {
2196  			return;
2197  		}
2198  

PHP Documentation

<?php
/**
		 * Filters the path for a specific filesystem method class file.
		 *
		 * @since 2.6.0
		 *
		 * @see get_filesystem_method()
		 *
		 * @param string $path   Path to the specific filesystem method class file.
		 * @param string $method The filesystem method to use.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-admin/includes/file.php
Related Hooks

Related hooks will be displayed here in future updates.