[WordPress]delete_all_transient

public function delete_all_transient()
{
    global $wpdb;
    $sql = "DELETE FROM `{$wpdb->options}` WHERE `option_name` LIKE ('_transient_%');";
    $result = $wpdb->get_results($sql);
    $sql = "DELETE FROM `{$wpdb->options}` WHERE `option_name` LIKE ('_site_transient_%');";
    $result = $wpdb->get_results($sql);
}