Hi,
When registering the meta box, you can create a variable $disabled
, set it to false
by default and check if it is the admin area, change this variable to true
to disable editing. It would be:
add_filter( 'rwmb_meta_boxes', function( $meta_boxes ) {
$disabled = false;
if( is_admin() ) $disabled = true;
$meta_boxes[] = [
...
'fields' => [
[
'id' => 'text',
'name' => 'Text',
'type' => 'text',
'disabled' => $disabled
],
],
];
return $meta_boxes;
} );