Written by Anonymous
if ( !function_exists( 'is_internal_blogcard_url' ) ):
function is_internal_blogcard_url($url){
// 特定のURL内のページを外部リンクとして扱う
$external_paths = [
'https://●●●.org/aaa/',
'https://●●●.org/bbb/'
];
foreach ($external_paths as $path) {
if (strpos($url, $path) === 0) {
return false;
}
}
if (!includes_home_url($url)) {
return false;
}
$id = url_to_postid($url); // IDを取得(URLから投稿ID変換)
$cat = get_category_by_path($url, false);
$tag = url_to_tag_object($url);
if ($id || is_home_url($url) || $cat || $tag) {
return true;
}
}
endif;