if(is_admin()){
//特定のテンプレート選択時にビジュアルエディタを無効に
add_action("admin_head-post.php", function () {
if (get_page_template_slug(get_the_ID()) === 'template-name.php') {
add_filter('user_can_richedit', '__return_false');
};
});
//おまけ、投稿画面に注釈表示
add_action("edit_form_top", function () {
if (get_page_template_slug(get_the_ID()) === 'templates/template-name.php') {
echo '<h3>※テンプレート選択中なのでビジュアルエディタは選択できません</h3>';
};
});
}