Filter hook 'pre_cache_alloptions'

in WP Core File wp-includes/option.php at line 648

View Source

pre_cache_alloptions

Filter Hook
Description
Filters all options before caching them.

Hook Information

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

Hook Parameters

Type Name Description
array $alloptions Array with all options.

Usage Examples

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

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

Source Code Context

wp-includes/option.php:648 - How this hook is used in WordPress core
<?php
 643  			 *
 644  			 * @since 4.9.0
 645  			 *
 646  			 * @param array $alloptions Array with all options.
 647  			 */
 648  			$alloptions = apply_filters( 'pre_cache_alloptions', $alloptions );
 649  
 650  			wp_cache_add( 'alloptions', $alloptions, 'options' );
 651  		}
 652  	}
 653  

PHP Documentation

<?php
/**
			 * Filters all options before caching them.
			 *
			 * @since 4.9.0
			 *
			 * @param array $alloptions Array with all options.
			 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-includes/option.php
Related Hooks

Related hooks will be displayed here in future updates.