I think there is no way to add custom attributes to wp_editor()
Therefore, you need to add a custom attribute to the text-area
field using JQuery
First add an extra class to the text-area
editor
$settings = array( ...... 'editor_class' => 'customclass_for_addattr', ...... ); wp_editor( $content, $editor_id, $settings );
After the wp_editor () function adds the jQuery code below. it adds custom attribute to text-area
using jQuery atrr
method
<script type="text/javascript"> jQuery(document).ready(function(){ jQuery(".customclass_for_addattr").attr('data-bvalidator','required'); }); </script>
source share