Action hook 'wp_load_speculation_rules'

in WP Core File wp-includes/speculative-loading.php at line 229

View Source

wp_load_speculation_rules

Action Hook
Description
Fires when speculation rules data is loaded, allowing to amend the rules.

Hook Information

File Location wp-includes/speculative-loading.php View on GitHub
Hook Type Action
Line Number 229

Hook Parameters

Type Name Description
WP_Speculation_Rules $speculation_rules Object representing the speculation rules to use.

Usage Examples

Basic Usage
<?php
// Hook into wp_load_speculation_rules
add_action('wp_load_speculation_rules', 'my_custom_function', 10, 1);

function my_custom_function($speculation_rules) {
    // Your custom code here
}

Source Code Context

wp-includes/speculative-loading.php:229 - How this hook is used in WordPress core
<?php
 224  	 *
 225  	 * @since 6.8.0
 226  	 *
 227  	 * @param WP_Speculation_Rules $speculation_rules Object representing the speculation rules to use.
 228  	 */
 229  	do_action( 'wp_load_speculation_rules', $speculation_rules );
 230  
 231  	return $speculation_rules;
 232  }
 233  
 234  /**

PHP Documentation

<?php
/**
	 * Fires when speculation rules data is loaded, allowing to amend the rules.
	 *
	 * @since 6.8.0
	 *
	 * @param WP_Speculation_Rules $speculation_rules Object representing the speculation rules to use.
	 */
Quick Info
  • Hook Type: Action
  • Parameters: 1
  • File: wp-includes/speculative-loading.php
Related Hooks

Related hooks will be displayed here in future updates.