Các hàm trong WordPress

delete delete_transient( string $transient ): bool

Xóa một transient khỏi cơ sở dữ liệu.

delete delete_option( string $option ): bool

Xóa một tùy chọn khỏi cơ sở dữ liệu.

Ví dụ 1: Xóa file
$file_path = "/home/public_html/wp-content/uploads/2020/04/photo_img_1-8.png"  // path of the file which need to be deleted.

wp_delete_file( $file_path ); //delete file here.
true or false