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

<code style="color: #000000"> <span style="color: #0000BB"><?php validate_file_to_edit</span><span style="color: #007700">( </span><span style="color: #0000BB">$file</span><span style="color: #007700">, </span><span style="color: #0000BB">$allowed_files </span><span style="color: #007700">); </span><span style="color: #0000BB">?></span> </code>

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