WPDev.one
Core Function
View Source on Trac ↗

validate_file_to_edit()

validate_file_to_edit( mixed $file, mixed $allowed_files = array() )

Makes sure that the file that was requested to be edited is allowed to be edited.

Parameters 2 required

Name / Type Description
$file
string

File the user is attempting to edit.

Required
string[]

$allowed_files Optional. Array of allowed files to edit. `$file` must match an entry exactly.

Required

Return Value

((string)
| void) Returns the file name on success, dies on failure.

Function Information

Since Version
1.5.0
Source File
wp-admin/includes/file.php
Advertisement