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

	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