[wp-trac] [WordPress Trac] #30577: Allow plugins to bypass wp_options when saving transients

WordPress Trac noreply at wordpress.org
Thu Mar 12 02:31:18 UTC 2015


#30577: Allow plugins to bypass wp_options when saving transients
----------------------------------------+-----------------------------
 Reporter:  mgibbs189                   |       Owner:
     Type:  enhancement                 |      Status:  new
 Priority:  normal                      |   Milestone:  Future Release
Component:  Options, Meta APIs          |     Version:  2.8
 Severity:  normal                      |  Resolution:
 Keywords:  has-patch commit 4.2-early  |     Focuses:
----------------------------------------+-----------------------------

Comment (by nacin):

 Replying to [comment:10 mbrandys]:
 > I think that bypass conditional should be placed before
 `wp_using_ext_object_cache` one to match how it it's done in
 `get_transient` as it still forces saving data in external data storage
 when someone uses object-cache.php drop-in.

 I agree with this assessment. Thank you @mgibbs189 for your "full
 disclosure" — this is really helpful to ascertain your use case, and is
 always something we'll ask for. It also explains why you wanted to do this
 *after* `wp_using_ext_object_cache()`. But it shouldn't be to be more
 generally useful. You however can use `wp_using_ext_object_cache()` in
 your callback, so your use case is fine.

 Also, I'm not sure I like the filter name. When we have a specific action
 or filter like "filter_name_$name" combined with a generic one (i.e.
 "filter_name"), they should do the same thing and function the same way.
 pre_site_transient_$transient already exists. pre_site_transient should
 not exist and then do different functionality.

 Any proposed changes here should be mirrored to set_site_transient().

 I *do* like the idea, it just needs some more work. Also, I bet there's a
 way to do this by filtering in the options API, so there's at least a
 hacky workaround.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/30577#comment:14>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list