Written by Anonymous
//ホームアドレスが含まれているか
if ( !function_exists( 'includes_home_url' ) ):
function includes_home_url($url){
// 特定のURLを除外
$external_paths = [
'https://●●●.org/aaa/',
'https://●●●.org/bbb/'
];
foreach ($external_paths as $path) {
if (strpos($url, $path) === 0) {
return false;
}
}
//URLにホームアドレスが含まれていない場合
if (includes_string($url, home_url())) {
return true;
} else {
return false;
}
}
endif;