GravityView_Field_Survey
Source: includes/fields/class-gravityview-field-survey.php:8
Details
- Kind:
class - Namespace:
(global) - Extends:
GravityView_Field
Methods
| Method | Description |
|---|---|
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
| Name | Type | Default | Description |
|---|---|---|---|
$field | GF_Field_Likert | ||
$value | string | array | ||
$input_id | int | string | 0 | ID 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
| Name | Type | Default | Description |
|---|---|---|---|
$form_id | int | The ID of the form. | |
$field_id | int | The 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