Redis Object Cache icon
Performance & Caching

Redis Object Cache hooks reference

  • By Till Krüss
  • v3.0.1 New
  • Updated

Redis Object Cache 3.0.1 has 10 actions and 10 filters, read directly from its source code on Nov 17, 2026. The list updates automatically when a new version is released.

How to use these hooks

Actions let you run your own code at a specific moment. Filters let you change a value before the plugin uses it. Put your code in a child theme's functions.php or a code-snippets plugin, never in the plugin's own files, because updates overwrite them.

functions.phpyour child theme
// Run your own code when Redis Object Cache fires an action
add_action( 'redis_object_cache_update_dropin', function( $result ) {
	// Your code runs here.
}, 10, 1 );

// Change a value Redis Object Cache is about to use
add_filter( 'redis_cache_expiration', function( $expire, $key, $group, $orig_exp ) {
	// Change $expire here.
	return $expire;
}, 10, 4 );

Parts of a name in {braces} are filled in at runtime (for example a post type or field ID). Choose Example on any hook for a ready-to-edit snippet.

All hooks

  • includes/object-cache.php line 1330 · used in 4 places
    /**
     * Filters the cache expiration time
     */
    apply_filters( 'redis_cache_expiration', $expire, $key, $group, $orig_exp );
  • includes/class-plugin.php line 1000 · used in 3 places
    /**
     * Fires on cache update-dropin event
     */
    do_action( 'redis_object_cache_update_dropin', $result );
  • includes/object-cache.php line 1556 · used in 2 places
    /**
     * Fires on every cache key deletion
     */
    do_action( 'redis_object_cache_delete', $key, $group, $execute_time );
  • includes/class-plugin.php line 969 · used in 2 places
    /**
     * Fires on cache disable event
     */
    do_action( 'redis_object_cache_disable', $result );
  • includes/class-plugin.php line 939 · used in 2 places
    /**
     * Fires on cache enable event
     */
    do_action( 'redis_object_cache_enable', $result );
  • includes/object-cache.php line 2150 · used in 2 places
    /**
     * Filters the return value
     */
    apply_filters( 'redis_object_cache_get_value', $value, $key, $group, $force, $found );
  • includes/object-cache.php line 2372 · used in 2 places
    /**
     * Fires on every cache set
     */
    do_action( 'redis_object_cache_set', $key, $value, $group, $expiration, $execute_time );
  • includes/object-cache.php line 2912
    /**
     * Filters list of groups to be added to {@see self::$ignored_groups}
     */
    apply_filters( 'redis_cache_add_non_persistent_groups', (array) $groups );
  • includes/class-plugin.php line 1639
    /**
     * Filters the capability used to determine if a user can manage Redis.
     */
    apply_filters( 'redis_cache_manager_capability', $capability );
  • includes/class-plugin.php line 511
    /**
     * Filters the drop-in validation state
     */
    apply_filters( 'redis_cache_validate_dropin', $dropin['PluginURI'] === $plugin['PluginURI'], $dropin['PluginURI'], $plugin['PluginURI'] );
  • includes/object-cache.php line 3103
    /**
     * Fires when an object cache related error occurs.
     */
    do_action( 'redis_object_cache_error', $exception, $exception->getMessage() );
  • includes/object-cache.php line 1850
    /**
     * Fires on every cache flush
     */
    do_action( 'redis_object_cache_flush', $results, 0, $selective, $salt, $execute_time );
  • includes/object-cache.php line 1919
    /**
     * Fires on every group cache flush
     */
    do_action( 'redis_object_cache_flush_group', $results, $salt, $execute_time );
  • includes/object-cache.php line 2135
    /**
     * Fires on every cache get request
     */
    do_action( 'redis_object_cache_get', $key, $value, $group, $force, $found, $execute_time );
  • includes/object-cache.php line 2275
    /**
     * Fires on every cache get multiple request
     */
    do_action( 'redis_object_cache_get_multiple', $keys, $cache, $group, $force, $execute_time );
  • includes/ui/class-tab.php line 256
    /**
     * Filters the current tab's css classes
     */
    apply_filters( 'roc_tab_classes', $classes, $this );
  • roc_tab_id

    filter
    includes/ui/class-tab.php line 231
    /**
     * Filters the tab's id
     */
    apply_filters( 'roc_tab_id', $tab_id, $this );
  • includes/ui/class-tab.php line 213
    /**
     * Filters the current tab's nav element css classes
     */
    apply_filters( 'roc_tab_nav_classes', $classes, $this );
  • includes/ui/class-tab.php line 185
    /**
     * Filters the tab's nav id
     */
    apply_filters( 'roc_tab_nav_id', $nav_id, $this );
  • includes/class-plugin.php line 1413
    apply_filters( 'file_mod_allowed', $allowed, 'object_cache_dropin' );

Generated from Redis Object Cache's GPL-licensed source code. Hooks inside bundled third-party libraries are not listed.

Can't find the right hook?

We can build the customisation for you. Describe what you need: