Skip to content

Commit 8112438

Browse files
authored
Merge pull request #66 from Automattic/add/wp_cache_get_pre-filter
Add wp_cache_get_pre filter
2 parents 9793b46 + ec0cfd9 commit 8112438

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

object-cache.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ function wp_cache_flush() {
5555
function wp_cache_get( $key, $group = '', $force = false, &$found = null ) {
5656
global $wp_object_cache;
5757

58+
$value = apply_filters( 'pre_wp_cache_get', false, $key, $group, $force );
59+
if ( false !== $value ) {
60+
$found = true;
61+
return $value;
62+
}
63+
5864
return $wp_object_cache->get( $key, $group, $force, $found );
5965
}
6066

0 commit comments

Comments
 (0)