wp_delete_file

The timeline below displays how wordpress function wp_delete_file has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.1

/**
 * Deletes a file.
 *
 * @since 4.2.0
 *
 * @param string $file The path to the file to delete.
 */
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);
    }
}

WordPress Version: 4.8

/**
 * Delete a file
 *
 * @since 4.2.0
 *
 * @param string $file The path to the file to delete.
 */
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);
    }
}

WordPress Version: 4.6

/**
 * Delete a file
 *
 * @since 4.2.0
 *
 * @param string $file The path to the file to delete.
 */
function wp_delete_file($file)
{
    /**
     * Filters the path of the file to delete.
     *
     * @since 2.1.0
     *
     * @param string $medium Path to the file to delete.
     */
    $delete = apply_filters('wp_delete_file', $file);
    if (!empty($delete)) {
        @unlink($delete);
    }
}

WordPress Version: 4.2

/**
 * Delete a file
 *
 * @since 4.2.0
 *
 * @param string $file The path to the file to delete.
 */
function wp_delete_file($file)
{
    /**
     * Filter the path of the file to delete.
     *
     * @since 2.1.0
     *
     * @param string $medium Path to the file to delete.
     */
    $delete = apply_filters('wp_delete_file', $file);
    if (!empty($delete)) {
        @unlink($delete);
    }
}