Filters the paths for which speculative loading should be disabled.
Description
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.
Parameters
$href_exclude_pathsstring[]
Additional path patterns to disable speculative loading for.
$modestring
Mode used to apply speculative loading. Either 'prefetch' or 'prerender'.
148*149* @since 6.8.0150*151* @param string[]$href_exclude_paths Additional path patterns to disable speculative loading for.152* @param string$mode Mode used to apply speculative loading. Either 'prefetch'or'prerender'.153*/154$href_exclude_paths=(array)apply_filters('wp_speculation_rules_href_exclude_paths',array(),$mode);155156// Ensure that:157// 1. There are no duplicates.158// 2. The base paths cannot be removed.159// 3. The array has sequential keys (i.e. array_is_list()).160$href_exclude_paths=array_values(
History
Introduced in 6.8.0. Unchanged from 6.8.8 through 7.1.0.