wp_internal_hosts
Filters the array of URL hosts which are considered internal.
Usage
add_filter( 'wp_internal_hosts', 'wp_kama_internal_hosts_filter' ); /** * Function for `wp_internal_hosts` filter-hook. * * @param string[] $internal_hosts An array of internal URL hostnames. * * @return string[] */ function wp_kama_internal_hosts_filter( $internal_hosts ){ // filter... return $internal_hosts; }
- $internal_hosts(string[])
- An array of internal URL hostnames.
Changelog
Since 6.2.0 | Introduced. |
Where the hook is called
wp_internal_hosts
wp-includes/link-template.php 4796-4801
$internal_hosts = apply_filters( 'wp_internal_hosts', array( wp_parse_url( home_url(), PHP_URL_HOST ), ) );