wp_is_internal_link() – Determines whether or not the specified URL is of a host included in the internal hosts list.

You appear to be a bot. Output may be restricted

Description

Determines whether or not the specified URL is of a host included in the internal hosts list.

Usage

$bool = wp_is_internal_link( $link );

Parameters

$link
( string ) required – The URL to test.

Returns

bool Returns true for internal URLs and false for all other URLs.

Source

File name: wordpress/wp-includes/link-template.php


Lines:

1 to 10 of 10
function wp_is_internal_link( $link ) {
  $link = strtolower( $link );
  if ( in_array( wp_parse_url( $link, PHP_URL_SCHEME ), wp_allowed_protocols(), true ) ) {
    return in_array( wp_parse_url( $link, PHP_URL_HOST ), wp_internal_hosts(), true );
  }
  return false;
}
 

 View on GitHub View on Trac