Gocodebox_Banner_Notifier::notification_test_site_url_match( bool $value, string $string )
Site URL test.
Contents
Parameters Parameters
- $value
-
(bool) (Required) The current test value.
- $string
-
(string) (Required) String or array of strings to look for in the site URL
Source Source
File: libraries/banner-notifications/src/notifications.php
function notification_test_site_url_match( $value, $string ) {
if ( ! empty( $string ) ) {
$strings_to_check = (array) $string;
foreach ( $strings_to_check as $check ) {
if ( strpos( get_bloginfo( 'url' ), $check ) !== false ) {
return true;
}
}
}
return false;
}
Expand full source code Collapse full source code View on GitHub