Choices_Field::render_single_input( mixed $current_value )

Renders a single input for the field.

Description

See also

Parameters

$current_value

(mixed) (Required) Current field value.

Source

File: src/db-objects/elements/element-types/choices-field.php

	protected function render_single_input( $current_value ) {
		$input_attrs = array(
			'type'  => $this->type,
			'value' => $current_value,
		);

		if ( null !== $this->index ) {
			$this->sort = $this->index;
		}

		?>
		<span class="torro-element-choice-move" aria-hidden="true">
			<?php torro()->assets()->render_icon( 'torro-icon-move' ); ?>
		</span>
		<input<?php echo $this->get_input_attrs( $input_attrs ); ?>>
		<input type="hidden" name="<?php echo esc_attr( str_replace( '[value]', '[element_id]', $input_attrs['name'] ) ); ?>" value="<?php echo esc_attr( $this->element_id ); ?>">
		<input type="hidden" name="<?php echo esc_attr( str_replace( '[value]', '[field]', $input_attrs['name'] ) ); ?>" value="<?php echo esc_attr( $this->field ); ?>">
		<input type="hidden" name="<?php echo esc_attr( str_replace( '[value]', '[sort]', $input_attrs['name'] ) ); ?>" value="<?php echo esc_attr( $this->sort ); ?>">
		<?php
		$this->render_repeatable_remove_button();
	}

Changelog

Changelog
Version Description
1.0.0 Introduced.