Core Function
View Source on Trac ↗ wp_delete_file_from_directory()
wp_delete_file_from_directory( mixed $file, mixed $directory ) Deletes a file if its path is within the given directory.
Parameters 2 required
| Name / Type | Description |
|---|---|
| $file string | Absolute path to the file to delete. Required |
| $directory string | Absolute path to a directory. Required |
Return Value
(bool)
True on success, false on failure.
Function Information
Since Version
4.9.7
Source File
wp-includes/functions.php
Advertisement