Element_Responses::get_meta_fields()

Returns the available meta fields for the submodule.

Description

Return

(array) Associative array of <code>$field_slug => $field_args</code> pairs.

Source

File: src/modules/evaluators/element-responses.php

	public function get_meta_fields() {
		$meta_fields = $this->_get_meta_fields();

		unset( $meta_fields['enabled'] );

		$meta_fields['display_mode'] = array(
			'type'    => 'select',
			'label'   => __( 'Display Mode', 'torro-forms' ),
			'choices' => array(
				'bar'   => __( 'Bar Chart', 'torro-forms' ),
				'pie'   => __( 'Pie Chart', 'torro-forms' ),
				'donut' => __( 'Donut Chart', 'torro-forms' ),
			),
			'default' => 'bar',
		);

		$meta_fields['data_point_labels'] = array(
			'type'         => 'select',
			'label'        => _x( 'Data Point Labels', 'evaluator', 'torro-forms' ),
			'description'  => __( 'Specify whether a label should be shown with each data point and which content it should display.', 'torro-forms' ),
			'choices'      => array(
				'none'       => _x( 'None', 'data point labels', 'torro-forms' ),
				'value'      => _x( 'Values', 'data point labels', 'torro-forms' ),
				'percentage' => _x( 'Percentages', 'data point labels', 'torro-forms' ),
			),
			'default'      => 'none',
			'dependencies' => array(
				array(
					'prop'     => 'display',
					'callback' => 'get_data_by_map',
					'fields'   => array( 'display_mode' ),
					'args'     => array(
						'map' => array(
							'bar'   => true,
							'pie'   => false,
							'donut' => false,
						),
					),
				),
			),
		);

		return $meta_fields;
	}

Changelog

Changelog
Version Description
1.0.0 Introduced.