Skip to content

🚀 Feature Request: Make controls "readonly" or "disabled" #1571

@ramiy

Description

@ramiy

Description

Currently, plugin developers can't set controls as readonly or disabled. For example I can't display a Text Field as a read-only field, instead I need to hack the code or display HTML using the Raw-HTML control.

We can add two new argument to define a field as 'readonly' and 'disabled' fields.

Usage

$this->add_control(
  'widget_title',
  [
     'label'       => __( 'Title', 'text-domain' ),
     'type'        => Controls_Manager::TEXT,
     'readonly'    => true,
     'disabled'    => true,
  ]
);

Arguments

Argument Required Type Default Description
readonly no bool false Display the input field as read-only
disabled no bool false Display the input field as disabled

Preview

elementor

Metadata

Metadata

Assignees

No one assigned

    Labels

    mod/r*[Temp.] For internal use only.request/enhancementIndicates an Enhancement Request for an existing feature.type/developer-apiIndicates when a topic is related to the Developer API and Documentation.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions