Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/validate file to edit

This page redirects to an external site: https://developer.wordpress.org/reference/functions/validate_file_to_edit/

Description

Make sure that the file that was requested to edit, is allowed to be edited.Function will die if if you are not allowed to edit the file.

Usage

 <?php validate_file_to_edit$file$allowed_files ); ?> 

Parameters

$file
(string) (required) File to edit. required
Default: None
$allowed_files
(array) (optional) Array of allowed files to edit, $file must match an entry exactly.
Default:

Returns

null.

Change Log

Source File

get_file_description( $file ) is located in wp-admin/includes/file.php#L172