inline_shortcodes = Mfn_Builder_Fields::get_inline_shortcode(); } } /** * Render */ public function render( $meta = false, $vb = false, $js = false ) { $cm = ''; // theme options: CSS, JS $editor = ''; // builder: basic (bold, i, etc), full (media, shortcodes) | HTML $class = ''; $placeholder = ''; $preview = ''; // codemirror if( ! empty( $this->field['cm'] ) ){ $cm = $this->field['cm']; } // editor if( ! empty( $this->field['editor'] ) ){ $editor = $this->field['editor']; } if( $cm || $editor ){ $class = 'html-editor'; } // user settings if ( 'false' == get_user_option( 'syntax_highlighting' ) ){ $class .= ' disabled'; } // placeholder if( ! empty( $this->field['placeholder'] ) ){ $placeholder = $this->field['placeholder']; } if( ! empty( $this->field['std'] ) ){ $placeholder = $this->field['std']; } // preview if ( ! empty( $this->field['preview'] ) ){ $preview = 'preview-'. $this->field['preview']; } // rank math field type if ( ! empty( $this->field['rm'] ) ){ $preview .= ' rm-'. $this->field['rm']; } // output ----- if( $vb && empty( $this->field['editor'] ) && empty( $this->field['cm'] )){ if( $js ){ echo ''; }else{ echo ''; } if( !empty($this->field['dynamic_data']) ) { echo Mfn_Options_field::dynamic_data_options($this->field['dynamic_data']); } }else{ echo '
'; echo '
'; if( $editor ){ echo '
'; if( 'full' == $editor ){ // visual builder if( !$js ){ echo 'Add media'; }else{ echo '
'; echo 'Media'; } echo ''; } echo '
'; echo 'Format'; echo ''; echo '
'; // visual builder if( !$js ){ echo ''; }else{ if( 'full' == $editor ){ echo '
'; } } echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; Mfn_Builder_Admin::field( array( 'id' => 'color', 'type' => 'color', 'title' => '', 'old_picker' => true, 'placeholder' => '#fff', 'alpha' => true ) , '', $meta, 'old' ); echo '
'; echo '
'; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; if( 'full' == $editor ){ echo '
'; echo ''; echo ''; } echo ''; echo ''; echo ''; if( 'full' == $editor ){ echo ''; echo ''; } echo '
'; } echo '
'; if( 'full' == $editor ){ echo '
'; echo ''; echo ''; echo '
'; } if( $cm ){ $cm = 'data-cm="'. $this->field['cm'] .'"'; } if( $editor ){ $editor = 'data-editor="'. $this->field['editor'] .'"'; } if( $js ){ echo ''; }else{ echo ''; } // echo ''; echo'
'; echo '
'; echo '
'; } // visual builder if( ! $vb ){ echo $this->get_description(); }else{ $this->vbenqueue(); } } /** * Enqueue */ public function enqueue() { wp_enqueue_script( 'mfn-opts-field-textarea', MFN_OPTIONS_URI .'fields/textarea/field_textarea.js', array( 'jquery' ), MFN_THEME_VERSION, true ); } public function vbenqueue() { wp_enqueue_script( 'mfn-opts-field-textarea-vb', MFN_OPTIONS_URI .'fields/textarea/field_textarea_vb.js', array( 'jquery' ), time(), true ); } }