Selamlar

Bir panelim var. Bu panelde de bir switcher var. Aktif olduğu zaman ilgili fonksiyonu çalıştırmak istiyorum. Aktif olmadığı zaman fonksiyon çalışmayacak. Nasıl yapabilirim?

Fonksiyonum:

function disable_gutenberg_editor(
return false;
}
add_filter("use_block_editor_for_post_type", "disable_gutenberg_editor");
Ben şöyle bir şey yaptım ama Undefined variable: activeClassicEditorCheck hatası verdi.

$activeClassicEditorCheck = $fon_panel['activeClassicEditor'];
function disable_gutenberg_editor(){
if( $activeClassicEditorCheck == 1): 
return false; 
endif; 
} 
add_filter("use_block_editor_for_post_type", "disable_gutenberg_editor");