Skip to content

Commit

Permalink
Fixes reversing issue
Browse files Browse the repository at this point in the history
  • Loading branch information
omarkasem committed Sep 30, 2024
1 parent 039fbfa commit f861363
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions templates/fields/field-survey-html.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,12 @@
}

$choices = $field->field->choices;

// If the choices are reversed, reverse them back.
if( !empty($choices) && $choices[0]['text'] === 'Excellent' ){
$choices = array_reverse( $choices );
}

$choice_values = wp_list_pluck( $choices, 'value', $gravityview->value );
$starred_index = array_search( $gravityview->value, $choice_values );
$star_a11y_label = $starred_index !== false
Expand Down

0 comments on commit f861363

Please sign in to comment.