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

WordPress Trac wp-trac at lists.automattic.com
Sat Nov 28 08:42:04 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:  has-patch dev-feedback
--------------------------+-------------------------------------------------
Changes (by nacin):

  * keywords:  needs-patch  dev-feedback => has-patch dev-feedback


Comment:

 Replying to [ticket:10788 dd32]:
 > I'd like to suggest that set and delete transient have some filters too,
 update_transient_<safe_name> possibly, and the same for delete..
 Patch attached to add set_transient_$transient and
 delete_transient_$transient filters. Both use the not-safe name like
 pre_transient_$transient and transient_$transient.

 > ..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?
 Agreed, but needs dev feedback. Converting to null now could break plugins
 that currently use false.

 > 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.
 I'm not entirely sure either, but most _option and _transient functions
 require that the name is not already SQL-escaped. (get_option appears to
 be the only exception.)

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


More information about the wp-trac mailing list