Uses
Uses | Description |
---|---|
wp-includes/functions.php: wp_delete_file | Filters the path of the file to delete. |
wp-includes/plugin.php: apply_filters() | Calls the callback functions that have been added to a filter hook. |
Delete a file
(string) (Required) The path to the file to delete.
File: wp-includes/functions.php
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 ); } }
Version | Description |
---|---|
4.2.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_delete_file