validate_file_to_edit
validate_file_to_edit ( $file, $allowed_files = array() )
Parameters:- (string) file File the user is attempting to edit.
- (string[]) allowed_files Optional. Array of allowed files to edit. `$file` must match an entry exactly.
Returns:- (string|void) Returns the file name on success, dies on failure.
Defined at: - Introduced in WordPress: 1.5.0
- Deprecated in WordPress: —
Description
Makes sure that the file that was requested to be edited is allowed to be edited.Function will die if you are not allowed to edit the file.