Filter hook 'enable_loading_object_cache_dropin'

in WP Core File wp-includes/load.php at line 846

View Source

enable_loading_object_cache_dropin

Filter Hook
Description
Filters whether to enable loading of the object-cache.php drop-in. This filter runs before it can be used by plugins. It is designed for non-web runtimes. If false is returned, object-cache.php will never be loaded.

Hook Information

File Location wp-includes/load.php View on GitHub
Hook Type Filter
Line Number 846

Hook Parameters

Type Name Description
bool $enable_object_cache Whether to enable loading object-cache.php (if present). Default true.

Usage Examples

Basic Usage
<?php
// Hook into enable_loading_object_cache_dropin
add_filter('enable_loading_object_cache_dropin', 'my_custom_filter', 10, 1);

function my_custom_filter($enable_object_cache) {
    // Your custom filtering logic here
    return $enable_object_cache;
}

Source Code Context

wp-includes/load.php:846 - How this hook is used in WordPress core
<?php
 841  	 * @since 5.8.0
 842  	 *
 843  	 * @param bool $enable_object_cache Whether to enable loading object-cache.php (if present).
 844  	 *                                  Default true.
 845  	 */
 846  	if ( $first_init && apply_filters( 'enable_loading_object_cache_dropin', true ) ) {
 847  		if ( ! function_exists( 'wp_cache_init' ) ) {
 848  			/*
 849  			 * This is the normal situation. First-run of this function. No
 850  			 * caching backend has been loaded.
 851  			 *

PHP Documentation

<?php
/**
	 * Filters whether to enable loading of the object-cache.php drop-in.
	 *
	 * This filter runs before it can be used by plugins. It is designed for non-web
	 * runtimes. If false is returned, object-cache.php will never be loaded.
	 *
	 * @since 5.8.0
	 *
	 * @param bool $enable_object_cache Whether to enable loading object-cache.php (if present).
	 *                                  Default true.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-includes/load.php
Related Hooks

Related hooks will be displayed here in future updates.