Standardize hooks across the transient and options APIs
|Reported by:||dd32||Owned by:||westi|
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)
Change History (33)
- Component changed from Cache to Plugins
- Owner changed from ryan to westi
- Summary changed from (set|delete)_transient need some filters to Standardize hooks across the transient and options APIs
- Type changed from defect (bug) to enhancement