You are here

function hook_linkit_local_hosts_alter in Linkit 7.3

Implements hook_linkit_local_hosts_alter().

The default behavior is that only the current host is considered "local", when deciding how to classify a URL. For example, if the user is on http://www.example.com, then all URLs to other hosts will not be considered for local URLs. This means that if your users edit content on a different host from the actual public-facing site, such as https://staging.example.com, then if they paste in URLs from the public site (www), none of those URLs will be considered local.

Implementing this hook will allow you to alter the list (indexed array) of hosts that will be considered for internal links. Include the protocol (e.g., * http or https).

1 invocation of hook_linkit_local_hosts_alter()
linkit_parse_url in ./linkit.module
Retrieve relevant information about a URL. Specifically this function is usable for internal (absolute) URL:s, but it also works for external URL:s.

File

./linkit.api.php, line 49

Code

function hook_linkit_local_hosts_alter(&$local_hosts) {
  $local_hosts[] = 'http://www.example.com';
}