функция
since 4.2.0
wp_delete_file()
Проверено на WordPress 6.9, обновлено Источник: WordPress Developer Resources.
Сигнатура
wp_delete_file( string $file ): bool
Описание
Удаляет файл.
Параметры
$file
string
обязательный
Путь к удаляемому файлу.
Возвращаемое значение
bool
Исходный код
wp-includes/functions.php:7760
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 ) ) {
return @unlink( $delete );
}
return false;
}
История изменений
| Версия | Описание |
|---|---|
| 6.7.0 | A return value was added. |
| 4.2.0 | Introduced. |

