Skip to content

Improve URL handling in is_external_url#4

Open
szepeviktor wants to merge 2 commits intomindkomm:mainfrom
szepeviktor:patch-1
Open

Improve URL handling in is_external_url#4
szepeviktor wants to merge 2 commits intomindkomm:mainfrom
szepeviktor:patch-1

Conversation

@szepeviktor
Copy link

@szepeviktor szepeviktor commented Jan 6, 2025

A comparison already results in a boolean value.

Second thought: component can be specified.

@szepeviktor szepeviktor changed the title Improve boolean handling in is_external_url Improve URL handling in is_external_url Jan 6, 2025
@nlemoine
Copy link
Member

nlemoine commented Jan 6, 2025

Actually, there's a core function that already achieve that (by negating it): https://developer.wordpress.org/reference/functions/wp_is_internal_link/

With the possibility to whitelist some more hosts through filter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants