[wp-trac] [WordPress Trac] #10788: (set|delete)_transient need some filters

WordPress Trac wp-trac at lists.automattic.com
Tue Sep 15 10:33:34 UTC 2009


#10788: (set|delete)_transient need some filters
--------------------------+-------------------------------------------------
 Reporter:  dd32          |       Owner:                           
     Type:  defect (bug)  |      Status:  new                      
 Priority:  normal        |   Milestone:  2.9                      
Component:  General       |     Version:                           
 Severity:  normal        |    Keywords:  needs-patch  dev-feedback
--------------------------+-------------------------------------------------
 Currently get_transient has 2 filters:
  * $pre = apply_filters( 'pre_transient_' . $transient, false );
  * return apply_filters('transient_' . $transient, $value);

 I'd like to suggest that set and delete transient have some filters too,
 update_transient_<safe_name> possibly, and the same for delete..

 ..Also, I noticed that the pre_transient_<transient> use of false means
 that the filter cant be used to return (bool)false through the filter,
 Perhaps that should be reworked to use Null instead perhaps?

 And yet another questioning of the code, What is the point of
 $safe_transient in set_transient? It appears as its supposed to be the
 name that the transient uses.. but.. not entirely sure.

 As it is, It looks to me that the update_option code block may not
 actually be triggered as expected (as may not $transient ==
 $safe_transient)

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/10788>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list