Choices_Field::single_to_json( mixed $current_value )

Transforms single field data into an array to be passed to JavaScript applications.

Description

See also

Parameters

$current_value

(mixed) (Required) Current value of the field.

Return

(array) Field data to be JSON-encoded.

Source

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

	protected function single_to_json( $current_value ) {
		$data = parent::single_to_json( $current_value );

		$data['element_id'] = $this->element_id;
		$data['field']      = $this->field;
		$data['sort']       = $this->index;

		return $data;
	}

Changelog

Changelog
Version Description
1.0.0 Introduced.