false, 'sanitize_callback' => 'raptive_intelligence_sanitize_enabled', 'type' => 'boolean', ) ); } function raptive_intelligence_sanitize_enabled( $enabled ): bool { return true === $enabled || '1' === $enabled; } function raptive_intelligence_is_enabled(): bool { return (bool) get_option( RAPTIVE_INTELLIGENCE_ENABLED_OPTION, false ); } function raptive_intelligence_add_settings_page() { add_options_page( __( 'Raptive Intelligence', 'raptive-intelligence' ), __( 'Raptive Intelligence', 'raptive-intelligence' ), 'manage_options', 'raptive-intelligence', 'raptive_intelligence_render_settings_page' ); } function raptive_intelligence_render_settings_page() { if ( ! current_user_can( 'manage_options' ) ) { return; } $enabled = raptive_intelligence_is_enabled(); ?>