AnsPress_Form::editor_field( array $field = array() )

Description #

Create wp_editor field

Parameters #

  • $field
    array (Optional) Default value: array()

Changelog #

VersionDescription
2.0.1Introduced.

Source #

File: includes/class/form.php

519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
private function editor_field($field = array()) {
    if ( isset( $field['label'] ) ) {
        $this->label();
    }
 
    if ( $field['settings']['tinymce'] !== false ) {
        $field['settings']['tinymce'] = array(
            'content_css' => ap_get_theme_url( 'css/editor.css' ),
            'wp_autoresize_on' => true,
        );
    }
 
    /**
     * FILTER: ap_pre_editor_settings
     * Can be used to mody wp_editor settings
     * @var array
     * @since 2.0.1
     */
 
    $settings = apply_filters( 'ap_pre_editor_settings', $field['settings'] );
 
    $this->output .= '<div class="ap-form-fields-in">';
    // Turn on the output buffer
    ob_start();
    echo '<div class="ap-editor">';
    wp_editor( $field['value'], $field['name'], $settings );
    echo '</div>';
    $this->output .= ob_get_clean();
    $this->error_messages();
    if ( ! $this->field['show_desc_tip'] ) {
        $this->desc();
    }
    $this->output .= '</div>';
}

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment