wp_delete_file( string $file )
Deletes a file.
Parameters
-
$file
string Required -
The path to the file to delete.
Source
File: wp-includes/functions.php
.
View all references
function wp_delete_file( $file ) {
/**
* Filters the path of the file to delete.
*
* @since 2.1.0
*
* @param string $file Path to the file to delete.
*/
$delete = apply_filters( 'wp_delete_file', $file );
if ( ! empty( $delete ) ) {
@unlink( $delete );
}
}
Hooks
-
apply_filters( 'wp_delete_file',
string $file ) -
Filters the path of the file to delete.
Changelog
Version | Description |
---|---|
4.2.0 | Introduced. |
User Contributed Notes
-
Skip to note 1 content You must log in to vote on the helpfulness of this noteVote results for this note: 1You must log in to vote on the helpfulness of this note