CodeExplorer get_allowed_urls example
public function add_state_query_params( $url ) { $parsed_original_url =
wp_parse_url( $url );
$is_allowed = false;
foreach ( $this->
get_allowed_urls() as $allowed_url ) { $parsed_allowed_url =
wp_parse_url( $allowed_url );
$is_allowed =
( $parsed_allowed_url['scheme'
] ===
$parsed_original_url['scheme'
] &&
$parsed_allowed_url['host'
] ===
$parsed_original_url['host'
] &&
str_starts_with( $parsed_original_url['path'
],
$parsed_allowed_url['path'
] ) );
if ( $is_allowed ) { break;
} }