Skip to main content

GravityView_Field_Survey

Source: includes/fields/class-gravityview-field-survey.php:8

Details

  • Kind: class
  • Namespace: (global)
  • Extends: GravityView_Field

Methods

MethodDescription
get_choice_score()Returns the score for a choice at $value
get_field_choices()Gets field choices directly from the database (To avoid issues where choices are reversed by the survey plugin).
output_frontend_css()Output CSS for star ratings.

Method Reference

get_choice_score()

public static function get_choice_score( $field, $value, $input_id=0 )

Returns the score for a choice at $value

A sister method to \RGFormsModel::get_choice_text()

Parameters

NameTypeDefaultDescription
$fieldGF_Field_Likert
$valuestring | array
$input_idint | string0ID of the field or input (for example, 7.3 or 7)

Returns

  • mixed | string

Since: 2.11

Source: includes/fields/class-gravityview-field-survey.php:41

get_field_choices()

public static function get_field_choices( $form_id, $field_id )

Gets field choices directly from the database (To avoid issues where choices are reversed by the survey plugin).

Parameters

NameTypeDefaultDescription
$form_idintThe ID of the form.
$field_idintThe ID of the field.

Returns

  • array — The choices for the field.

Since: 2.30.0

Source: includes/fields/class-gravityview-field-survey.php:72

output_frontend_css()

static function output_frontend_css()

Output CSS for star ratings.

Returns

  • void

Since: 2.16

Source: includes/fields/class-gravityview-field-survey.php:189