filesystem_method
Filters the filesystem method to use.
Description
apply_filters( 'filesystem_method', (string) $method, (array) $args, (string) $context, (bool) $allow_relaxed_file_ownership );
Parameters (4)
- 0. $method (string)
- Filesystem method to return.
- 1. $args (array)
- An array of connection details for the method.
- 2. $context (string)
- Full path to the directory that is tested for being writable.
- 3. $allow_relaxed_file_ownership (bool)
- Whether to allow Group/World writable.
Usage
- To run the hook, copy the example below.
- $method = apply_filters( 'filesystem_method', $method, $args, $context, $allow_relaxed_file_ownership );
- if ( !empty( $method ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the filesystem_method callback
- function filter_filesystem_method( $method, $args, $context, $allow_relaxed_file_ownership ) {
- // make filter magic happen here...
- return $method;
- };
- // add the filter
- add_filter( 'filesystem_method', 'filter_filesystem_method', 10, 4 );
- To remove a hook callback, use the example below.
- // remove the filter
- remove_filter( 'filesystem_method', 'filter_filesystem_method', 10, 4 );
Defined (1)
The filter is defined in the following location(s).
- /wp-admin/includes/file.php
- return apply_filters( 'filesystem_method', $method, $args, $context, $allow_relaxed_file_ownership );