'Text Block', 'description'=>'Row description', 'icon_class'=>'fa fa-text-width', 'container'=>false, 'has_content'=>true, 'defaults'=>array('content'=>'this is a text block'), ); parent::__construct($id_base,$name,$options); } function init(){ $this->enqueue_js('el-text',dirname(__FILE__).'/../../view/js/elements/ve-text.js'); $this->ready('if (typeof ve_front !== "undefined"){ve_front.text.start();}'); $this->support('CssEditor'); } function element($instance,$content=''){ $instance=shortcode_atts(array('class'=>''),$instance); $this->addClass($instance['class']); $content = wpautop($content); echo do_shortcode($content); //$this->ready('alert("text block ready")'); } function form($instance,$content=''){ $instance=shortcode_atts(array('class'=>''),$instance); wp_editor($content,$this->get_field_id('content'),array( 'textarea_name'=>$this->get_field_name('content'), 'editor_class'=>'ve-html-editor', 'textarea_rows'=>5, )); ?>