Completed
Pull Request — develop (#1620)
by Zack
17:03
created
includes/fields/class-gravityview-field-survey.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -47,9 +47,9 @@  discard block
 block discarded – undo
47 47
 
48 48
 		foreach ( $field->choices as $choice ) {
49 49
 			if ( is_array( $value ) && RGFormsModel::choice_value_match( $field, $choice, $value[ $input_id ] ) ) {
50
-				return $choice['score'];
50
+				return $choice[ 'score' ];
51 51
 			} else if ( ! is_array( $value ) && RGFormsModel::choice_value_match( $field, $choice, $value ) ) {
52
-				return $choice['score'];
52
+				return $choice[ 'score' ];
53 53
 			}
54 54
 		}
55 55
 
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 
59 59
 	public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) {
60 60
 
61
-		unset( $field_options['search_filter'] );
61
+		unset( $field_options[ 'search_filter' ] );
62 62
 
63 63
 		if ( 'edit' === $context ) {
64 64
 			return $field_options;
@@ -80,18 +80,18 @@  discard block
 block discarded – undo
80 80
 				'text' => __( 'Text value of the selected choice', 'gravityview' ) . ( $show_suffix ? '' : $multiple_rows_suffix ),
81 81
 			);
82 82
 
83
-			if( $field->field->gsurveyLikertEnableScoring ) {
84
-				$likert_display_options['score'] = __( 'Score value of the selected choice', 'gravityview' ) . ( $show_suffix ? '' : $multiple_rows_suffix );
83
+			if ( $field->field->gsurveyLikertEnableScoring ) {
84
+				$likert_display_options[ 'score' ] = __( 'Score value of the selected choice', 'gravityview' ) . ( $show_suffix ? '' : $multiple_rows_suffix );
85 85
 			}
86 86
 
87 87
 			// Maintain for back-compatibility
88
-			$add_options['score'] = array(
88
+			$add_options[ 'score' ] = array(
89 89
 				'type' => 'hidden',
90 90
 				'value' => '',
91 91
 				'group' => 'display',
92 92
 			);
93 93
 
94
-			$add_options['choice_display'] = array(
94
+			$add_options[ 'choice_display' ] = array(
95 95
 				'type' => 'radio',
96 96
 				'label' => __( 'What should be displayed:', 'gravityview' ),
97 97
 				'options' => $likert_display_options,
@@ -103,8 +103,8 @@  discard block
 block discarded – undo
103 103
 			);
104 104
 		}
105 105
 
106
-		if( 'checkbox' === $field->field->inputType && $input_id ) {
107
-			$field_options['choice_display'] = array(
106
+		if ( 'checkbox' === $field->field->inputType && $input_id ) {
107
+			$field_options[ 'choice_display' ] = array(
108 108
 				'type'    => 'radio',
109 109
 				'class'   => 'vertical',
110 110
 				'label'   => __( 'What should be displayed:', 'gravityview' ),
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 		}
121 121
 
122 122
 		if ( 'rating' === $field->field->inputType ) {
123
-			$field_options['choice_display'] = array(
123
+			$field_options[ 'choice_display' ] = array(
124 124
 				'type'    => 'radio',
125 125
 				'class'   => 'vertical',
126 126
 				'label'   => __( 'What should be displayed:', 'gravityview' ),
Please login to merge, or discard this patch.