Core Function
View Source on Trac ↗ validate_file()
validate_file( mixed $file, mixed $allowed_files = array() ) Validates a file name and path against an allowed set of rules.
Parameters 1 required
| Name / Type | Description |
|---|---|
| $file string | File path. Required |
| $allowed_files string[] | Optional. Array of allowed files. Default empty array. |
Return Value
(int)
0 means nothing is wrong, greater than 0 means something was wrong.
Function Information
Since Version
1.2.0
Source File
wp-includes/functions.php
Advertisement