wp_delete_file
Filters the path of the file to delete.
Description
Parameters (1)
- 0. $thumbfile (unknown)
- The thumbfile.
Usage
- To run the hook, copy the example below.
- $thumbfile = apply_filters( 'wp_delete_file', $thumbfile );
- if ( !empty( $thumbfile ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the wp_delete_file callback
- function filter_wp_delete_file( $thumbfile ) {
- // make filter magic happen here...
- return $thumbfile;
- };
- // add the filter
- add_filter( 'wp_delete_file', 'filter_wp_delete_file', 10, 1 );
- To remove a hook callback, use the example below.
- // remove the filter
- remove_filter( 'wp_delete_file', 'filter_wp_delete_file', 10, 1 );
Defined (4)
The filter is defined in the following location(s).
- /wp-includes/post.php
- $thumbfile = apply_filters( 'wp_delete_file', $thumbfile );
- $intermediate_file = apply_filters( 'wp_delete_file', $intermediate_file );
- $del_file = apply_filters( 'wp_delete_file', $del_file );
- /wp-includes/functions.php
- $delete = apply_filters( 'wp_delete_file', $file );