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'.
235*236* @since 6.8.0237*238* @param string[]$href_exclude_paths Additional path patterns to disable speculative loading for.239* @param string$mode Mode used to apply speculative loading. Either 'prefetch'or'prerender'.240*/241$href_exclude_paths=(array)apply_filters('wp_speculation_rules_href_exclude_paths',array(),$mode);242$href_exclude_paths=array_filter($href_exclude_paths,'is_string');243244// Ensure that:245// 1. There are no duplicates.246// 2. The base paths cannot be removed.247// 3. The array has sequential keys (i.e. array_is_list()).
History
Introduced in 6.8.0. Unchanged from 6.8.8 through 7.1.0.