Tags::field_markup()

Description #

Field markup.

Source #

File: lib/form/class-tags.php

	public function field_markup() {
		parent::field_markup();

		$options = $this->get_options();
		$value   = ! empty( $this->value() ) ? implode( ',', $this->value() ) : '';
		$type    = is_string( $options ) ? $options : 'tags';

		$this->add_html( '<input type="text" id="' . $this->id() . '" data-type="' . $type . '" data-options="' . esc_js( wp_json_encode( $this->get( 'js_options' ) ) ) . '" class="ap-tags-input" autocomplete="off" aptagfield' . $this->custom_attr() . ' name="' . esc_attr( $this->field_name ) . '" value="' . $value . '" />' );

		$this->add_html( '<script id="' . $this->id() . '-options" type="application/json">' . wp_json_encode( $options ) . '</script>' );

		/** This action is documented in lib/form/class-input.php */
		do_action_ref_array( 'ap_after_field_markup', array( &$this ) );
	}

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