WP HOOKS
filtrod 6.8.0

wp_speculation_rules_href_exclude_paths

Args 2Plik wp-includes/speculative-loading.phpDokumentacja WP ↗

Opis — z kodu źródłowego

Filters the paths for which speculative loading should be disabled.

All paths should start in a forward slash, relative to the root document. The * can be used as a wildcard. If the WordPress site is in a subdirectory, the exclude paths will automatically be prefixed as necessary. Note that WordPress always excludes certain path patterns such as /wp-login.php and /wp-admin/*, and those cannot be modified using the filter.

Parametry

ParametrTypOpis
$href_exclude_pathsstring[]Additional path patterns to disable speculative loading for.
$modestringMode used to apply speculative loading. Either 'prefetch' or 'prerender'.

Wywołanie

Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'wp_speculation_rules_href_exclude_paths', 'twoja_funkcja', 10, 2 );

function twoja_funkcja($param_1, $param_2) {
	// Twój kod
}

Popularne w tej kategorii