wp_delete_file_from_directory
wp_delete_file_from_directory ( $file, $directory )
Parameters:- (string) file Absolute path to the file to delete.
- (string) directory Absolute path to a directory.
Returns:- (bool) True on success, false on failure.
Defined at: - Introduced in WordPress: 4.9.7
- Deprecated in WordPress: —
Description
Deletes a file if its path is within the given directory.