Closed joshbetz closed 4 years ago
It seems that WP (mostly) follows the pre_{$someaction}
convention, should we change wp_cache_get_pre
to be pre_wp_cache_get
?
@rinatkhaziev Good question. This is the name of the filter on WP.com, so I kept it. I could go either way.
I'd vote for @rinatkhaziev's idea of sticking to the WP convention.
@nickdaugherty @rinatkhaziev What about wp_pre_get_cache
, which I think is more consistent with core?
Just quickly scoured the hooks reference (pages 42 and further), all of them follow
pre_{$function_name}
format. E.g. pre_schedule_event
, pre_update_option
, etc. so if we were to follow the same logic that would be pre_wp_cache_get
.
It's no big deal since this is how it's already defined in APC Cache Interceptor and the code is fairly low-level.
Ok, fix that filter name and set $found = true
when we short-circuit wp_cache_get()
. @nickdaugherty @rinatkhaziev can you take one more quick look when you get a chance?
@joshbetz I've added a suggestion in the other PR
This will let us short-circuit the memcached request. The initial use-case here is to intercept hot keys to store them in a local apcu cache.