wpseek.com
A WordPress-centric search engine for devs and theme authors



wp_print_speculation_rules › WordPress Function

Since6.8.0
Deprecatedn/a
wp_print_speculation_rules ( No parameters )
Access:
  • private
Defined at:
Codex:

Prints the speculation rules.

For browsers that do not support speculation rules yet, the script[type="speculationrules"] tag will be ignored.


Source

function wp_print_speculation_rules(): void {
	$speculation_rules = wp_get_speculation_rules();
	if ( null === $speculation_rules ) {
		return;
	}

	wp_print_inline_script_tag(
		(string) wp_json_encode(
			$speculation_rules
		),
		array( 'type' => 'speculationrules' )
	);
}