wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes



wp_is_internal_link › WordPress Function

Depuis6.2.0
Dépréciéen/a
wp_is_internal_link ( $link )
Paramètres:
  • (string) $link The URL to test.
    Requis: Oui
Voir:
Retourne:
  • (bool) Returns true for internal URLs and false for all other URLs.
Défini(e) dans:
Codex:

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



Source

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;
}