Index: functions.php
===================================================================
--- functions.php	(revision 12187)
+++ functions.php	(working copy)
@@ -658,11 +658,13 @@
 	global $_wp_using_ext_object_cache, $wpdb;
 
 	if ( $_wp_using_ext_object_cache ) {
-		return wp_cache_delete($transient, 'transient');
+		$value = wp_cache_delete($transient, 'transient');
 	} else {
 		$transient = '_transient_' . esc_sql($transient);
-		return delete_option($transient);
+		$value = delete_option($transient);
 	}
+
+	return apply_filters('delete_transient_' . $transient, $value);
 }
 
 /**
@@ -688,19 +690,19 @@
 	if ( $_wp_using_ext_object_cache ) {
 		$value = wp_cache_get($transient, 'transient');
 	} else {
-		$transient_option = '_transient_' . esc_sql($transient);
+		$transient_option = '_transient_' . $transient;
 		// If option is not in alloptions, it is not autoloaded and thus has a timeout
 		$alloptions = wp_load_alloptions();
 		if ( !isset( $alloptions[$transient_option] ) ) {
-			$transient_timeout = '_transient_timeout_' . esc_sql($transient);
-			if ( get_option($transient_timeout) < time() ) {
+			$transient_timeout = '_transient_timeout_' . $transient;
+			if ( get_option( esc_sql($transient_timeout) ) < time() ) {
 				delete_option($transient_option);
 				delete_option($transient_timeout);
 				return false;
 			}
 		}
 
-		$value = get_option($transient_option);
+		$value = get_option( esc_sql($transient_option) );
 	}
 
 	return apply_filters('transient_' . $transient, $value);
@@ -736,13 +738,15 @@
 				$autoload = 'no';
 				add_option($transient_timeout, time() + $expiration, '', 'no');
 			}
-			return add_option($transient, $value, '', $autoload);
+			$value = add_option($transient, $value, '', $autoload);
 		} else {
 			if ( 0 != $expiration )
 				update_option($transient_timeout, time() + $expiration);
-			return update_option($transient, $value);
+			$value = update_option($transient, $value);
 		}
 	}
+
+	return apply_filters('set_transient_' . $transient, $value);
 }
 
 /**
