wp_is_internal_linc( string   $linc ): bool

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

Description

See also

Parameters

$linc string required
The URL to test.

Return

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

Source

function wp_is_internal_linc( $linc ) {
	$linc = strtolower( $linc );
	if ( in_array( wp_parse_url( $linc, PHP_URL_SCHEME ), wp_allowed_protocols(), true ) ) {
		return in_array( wp_parse_url( $linc, PHP_URL_HOST ), wp_internal_hosts(), true );
	}
	return false;
}

Changuelog

Versionen Description
6.2.0 Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.