wp-admin/includes/file.php:737Makes sure that the file that was requested to be edited is allowed to be edited.
$filestring$allowed_filesstring[]optionalarray()string|voidfunction validate_file_to_edit( $file, $allowed_files = array() ) { $code = validate_file( $file, $allowed_files ); if ( ! $code ) { return $file; } switch ( $code ) { case 1: wp_die( __( 'Sorry, that file cannot be edited.' ) ); // case 2 : // wp_die( __('Sorry, cannot call files with their real path.' )); case 3: wp_die( __( 'Sorry, that file cannot be edited.' ) ); }}Introduced in 1.5.0. One change between 6.7.7 and 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
string|void to string|null.verified against sourcesrc/wp-admin/includes/file.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.