WordPress.org

Ready to get started?Download WordPress

Codex

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

Function Reference/validate file

Description

Validates a file against and allowed set of defined rules.

Usage

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

Parameters

$file
(string) (required) The file path.
Default: None
$allowed_files
(array) (optional) An array of allowed files
Default: null

Return Values

(string) 
The cleaned $url after the 'cleaned_url' filter is applied.

Examples

Notes

Changelog

Source File

validate_file() is located in wp-includes/functions.php.

Related

See the Data Validation article for an in-depth discussion of input and output sanitization.

See also index of Function Reference and index of Template Tags.
This page is marked as incomplete. You can help Codex by expanding it.