ip-geo-block-upload-forbidden

This filter hook will be applied when forbidden uploading is detected.

Warning: The filter hook ip-geo-block-forbidden-upload was abolished in release 3.0.4 , but is replaced to ip-geo-block-upload-forbidden.

Description

The filter hook “ip-geo-block-upload-forbidden” will be applied via apply_filters() when the request has improper capability or forbidden MIME type is detected in the uploaded files.

Parameters

Type Name Description
string ‘ip’ validated ip address
bool ‘auth’ authenticated or not
string ‘code’ country code
string ‘result’ reason of blocking (‘passed’, ‘blocked’)

Use case

The following code snippet can handle the uploaded files.

/**
 * Handle uploaded files when fobidden MIME type is detected.
 *
 * @param  array $validate  validation result
 * @return array $validate  validation result
 */
function my_upload_forbidden( $validate ) {
    // something to handle in $_FILES
    ;

    return $validate;
}
add_filter( "ip-geo-block-upload-forbidden", "my_upload_forbidden" );
NOTE: When you select "mu-plugins" (ip-geo-block-mu.php) as Validation timing , you should put your code snippet into drop-in.php in Geolocation API folder instead of functions.php. See My custom functions in “functions.php” doesn’t work. in FAQ for detail.

Since

3.0.4

See also