It’s kind of surprising that I can’t set the disabled attribute on a checkbox.
$settings_page_fields[] = Field::make( 'set', self::$optionPrefix . 'taxonomies', __( 'Taxonomies', 'plugin' ) )
->set_options( $taxonomy_options )
->set_default_value( $taxonomy_defaults );
if ( $taxonomies_locked ) {
$settings_page_fields[ array_key_last( $settings_page_fields ) ]->set_attribute( 'disabled', 'disabled' );
}
Carbon Fields library encountered errors that may prevent your custom fields or theme options to work properly. Here's a quick summary of the issue:
Only the following attributes are allowed: data-*