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

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
Arguments
readonlyboolfalsedisabledboolfalsePreview