Skip to content

Attribute 'disabled' should not be prohibited for some filed types #1306

@hokoo

Description

@hokoo

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-*

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions