Completed
Pull Request — master (#651)
by Zack
04:36
created
includes/admin/class-gravityview-admin-no-conflict.php 2 patches
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 	 */
19 19
 	public function __construct() {
20 20
 
21
-		if( ! is_admin() ) { return; }
21
+		if ( ! is_admin() ) { return; }
22 22
 		
23 23
 		$this->add_hooks();
24 24
 	}
@@ -32,13 +32,13 @@  discard block
 block discarded – undo
32 32
 	 */
33 33
 	private function add_hooks() {
34 34
 		//Hooks for no-conflict functionality
35
-		add_action( 'wp_print_scripts', array( $this, 'no_conflict_scripts' ), 1000);
36
-		add_action( 'admin_print_footer_scripts', array( $this, 'no_conflict_scripts' ), 9);
35
+		add_action( 'wp_print_scripts', array( $this, 'no_conflict_scripts' ), 1000 );
36
+		add_action( 'admin_print_footer_scripts', array( $this, 'no_conflict_scripts' ), 9 );
37 37
 
38
-		add_action( 'wp_print_styles', array( $this, 'no_conflict_styles' ), 1000);
39
-		add_action( 'admin_print_styles', array( $this, 'no_conflict_styles' ), 11);
40
-		add_action( 'admin_print_footer_scripts', array( $this, 'no_conflict_styles' ), 1);
41
-		add_action( 'admin_footer', array( $this, 'no_conflict_styles' ), 1);
38
+		add_action( 'wp_print_styles', array( $this, 'no_conflict_styles' ), 1000 );
39
+		add_action( 'admin_print_styles', array( $this, 'no_conflict_styles' ), 11 );
40
+		add_action( 'admin_print_footer_scripts', array( $this, 'no_conflict_styles' ), 1 );
41
+		add_action( 'admin_footer', array( $this, 'no_conflict_styles' ), 1 );
42 42
 	}
43 43
 
44 44
 	/**
@@ -51,13 +51,13 @@  discard block
 block discarded – undo
51 51
 	function no_conflict_scripts() {
52 52
 		global $wp_scripts;
53 53
 
54
-		if( ! gravityview_is_admin_page() ) {
54
+		if ( ! gravityview_is_admin_page() ) {
55 55
 			return;
56 56
 		}
57 57
 
58
-		$no_conflict_mode = GravityView_Settings::getSetting('no-conflict-mode');
58
+		$no_conflict_mode = GravityView_Settings::getSetting( 'no-conflict-mode' );
59 59
 
60
-		if( empty( $no_conflict_mode ) ) {
60
+		if ( empty( $no_conflict_mode ) ) {
61 61
 			return;
62 62
 		}
63 63
 
@@ -110,24 +110,24 @@  discard block
 block discarded – undo
110 110
 	function no_conflict_styles() {
111 111
 		global $wp_styles;
112 112
 
113
-		if( ! gravityview_is_admin_page() ) {
113
+		if ( ! gravityview_is_admin_page() ) {
114 114
 			return;
115 115
 		}
116 116
 
117 117
 		// Dequeue other jQuery styles even if no-conflict is off.
118 118
 		// Terrible-looking tabs help no one.
119
-		if( !empty( $wp_styles->registered ) )  {
120
-			foreach ($wp_styles->registered as $key => $style) {
121
-				if( preg_match( '/^(?:wp\-)?jquery/ism', $key ) ) {
119
+		if ( ! empty( $wp_styles->registered ) ) {
120
+			foreach ( $wp_styles->registered as $key => $style ) {
121
+				if ( preg_match( '/^(?:wp\-)?jquery/ism', $key ) ) {
122 122
 					wp_dequeue_style( $key );
123 123
 				}
124 124
 			}
125 125
 		}
126 126
 
127
-		$no_conflict_mode = GravityView_Settings::getSetting('no-conflict-mode');
127
+		$no_conflict_mode = GravityView_Settings::getSetting( 'no-conflict-mode' );
128 128
 
129 129
 		// If no conflict is off, jQuery will suffice.
130
-		if( empty( $no_conflict_mode ) ) {
130
+		if ( empty( $no_conflict_mode ) ) {
131 131
 			return;
132 132
 		}
133 133
 
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 		/**
155 155
 		 * @action `gravityview_remove_conflicts_after` Runs after no-conflict styles are removed. You can re-add styles here.
156 156
 		 */
157
-		do_action('gravityview_remove_conflicts_after');
157
+		do_action( 'gravityview_remove_conflicts_after' );
158 158
 	}
159 159
 
160 160
 	/**
@@ -178,9 +178,9 @@  discard block
 block discarded – undo
178 178
 
179 179
 		//reset queue
180 180
 		$queue = array();
181
-		foreach( $wp_objects->queue as $object ) {
182
-			if( in_array( $object, $required_objects ) || preg_match('/gravityview|gf_|gravityforms/ism', $object ) ) {
183
-				$queue[] = $object;
181
+		foreach ( $wp_objects->queue as $object ) {
182
+			if ( in_array( $object, $required_objects ) || preg_match( '/gravityview|gf_|gravityforms/ism', $object ) ) {
183
+				$queue[ ] = $object;
184 184
 			}
185 185
 		}
186 186
 		$wp_objects->queue = $queue;
@@ -189,8 +189,8 @@  discard block
 block discarded – undo
189 189
 
190 190
 		//unregistering scripts
191 191
 		$registered = array();
192
-		foreach( $wp_objects->registered as $handle => $script_registration ){
193
-			if( in_array( $handle, $required_objects ) ){
192
+		foreach ( $wp_objects->registered as $handle => $script_registration ) {
193
+			if ( in_array( $handle, $required_objects ) ) {
194 194
 				$registered[ $handle ] = $script_registration;
195 195
 			}
196 196
 		}
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 	 * @param array $registered [description]
206 206
 	 * @param array $scripts    [description]
207 207
 	 */
208
-	private function add_script_dependencies($registered, $scripts) {
208
+	private function add_script_dependencies( $registered, $scripts ) {
209 209
 
210 210
 		//gets all dependent scripts linked to the $scripts array passed
211 211
 		do {
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 				$deps = isset( $registered[ $script ] ) && is_array( $registered[ $script ]->deps ) ? $registered[ $script ]->deps : array();
215 215
 				foreach ( $deps as $dep ) {
216 216
 					if ( ! in_array( $dep, $scripts ) && ! in_array( $dep, $dependents ) ) {
217
-						$dependents[] = $dep;
217
+						$dependents[ ] = $dep;
218 218
 					}
219 219
 				}
220 220
 			}
Please login to merge, or discard this patch.
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 
117 117
 		// Dequeue other jQuery styles even if no-conflict is off.
118 118
 		// Terrible-looking tabs help no one.
119
-		if( !empty( $wp_styles->registered ) )  {
119
+		if( !empty( $wp_styles->registered ) ) {
120 120
 			foreach ($wp_styles->registered as $key => $style) {
121 121
 				if( preg_match( '/^(?:wp\-)?jquery/ism', $key ) ) {
122 122
 					wp_dequeue_style( $key );
@@ -189,8 +189,8 @@  discard block
 block discarded – undo
189 189
 
190 190
 		//unregistering scripts
191 191
 		$registered = array();
192
-		foreach( $wp_objects->registered as $handle => $script_registration ){
193
-			if( in_array( $handle, $required_objects ) ){
192
+		foreach( $wp_objects->registered as $handle => $script_registration ) {
193
+			if( in_array( $handle, $required_objects ) ) {
194 194
 				$registered[ $handle ] = $script_registration;
195 195
 			}
196 196
 		}
Please login to merge, or discard this patch.
includes/admin/field-types/type_radio.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,12 +19,12 @@
 block discarded – undo
19 19
 	}
20 20
 
21 21
 	function render_input( $override_input = null ) {
22
-		if( isset( $override_input ) ) {
22
+		if ( isset( $override_input ) ) {
23 23
 			echo $override_input;
24 24
 			return;
25 25
 		}
26 26
 
27
-		foreach( $this->field['options'] as $value => $label ) : ?>
27
+		foreach ( $this->field[ 'options' ] as $value => $label ) : ?>
28 28
 		<label class="<?php echo $this->get_label_class(); ?>">
29 29
 			<input name="<?php echo esc_attr( $this->name ); ?>" id="<?php echo $this->get_field_id(); ?>-<?php echo esc_attr( $value ); ?>" type="radio" value="<?php echo esc_attr( $value ); ?>" <?php checked( $value, $this->value, true ); ?> />&nbsp;<?php echo esc_html( $label ); ?>
30 30
 		</label>
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-radio.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 
10 10
 	var $name = 'radio';
11 11
 
12
-	var $search_operators = array( 'is', 'in', 'not in', 'isnot', 'contains');
12
+	var $search_operators = array( 'is', 'in', 'not in', 'isnot', 'contains' );
13 13
 
14 14
 	var $_gf_field_class_name = 'GF_Field_Radio';
15 15
 
@@ -38,8 +38,8 @@  discard block
 block discarded – undo
38 38
 		// Set the $_field_id var
39 39
 		$field_options = parent::field_options( $field_options, $template_id, $field_id, $context, $input_type );
40 40
 		
41
-		if( $this->is_choice_value_enabled() ) {
42
-			$field_options['choice_display'] = array(
41
+		if ( $this->is_choice_value_enabled() ) {
42
+			$field_options[ 'choice_display' ] = array(
43 43
 				'type'    => 'radio',
44 44
 				'value'   => 'value',
45 45
 				'label'   => __( 'What should be displayed:', 'gravityview' ),
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-checkbox.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 
10 10
 	var $name = 'checkbox';
11 11
 
12
-	var $search_operators = array( 'is', 'in', 'not in', 'isnot', 'contains');
12
+	var $search_operators = array( 'is', 'in', 'not in', 'isnot', 'contains' );
13 13
 
14 14
 	var $_gf_field_class_name = 'GF_Field_Checkbox';
15 15
 
@@ -39,10 +39,10 @@  discard block
 block discarded – undo
39 39
 		$field_options = parent::field_options( $field_options, $template_id, $field_id, $context, $input_type );
40 40
 
41 41
 		// It's not the parent field; it's an input
42
-		if( floor( $field_id ) !== floatval( $field_id ) ) {
42
+		if ( floor( $field_id ) !== floatval( $field_id ) ) {
43 43
 
44
-			if( $this->is_choice_value_enabled() ) {
45
-				$field_options['choice_display'] = array(
44
+			if ( $this->is_choice_value_enabled() ) {
45
+				$field_options[ 'choice_display' ] = array(
46 46
 					'type'    => 'radio',
47 47
 					'value'   => 'value',
48 48
 					'class'   => 'vertical',
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-select.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,8 +38,8 @@
 block discarded – undo
38 38
 		// Set the $_field_id var
39 39
 		$field_options = parent::field_options( $field_options, $template_id, $field_id, $context, $input_type );
40 40
 
41
-		if( $this->is_choice_value_enabled() ) {
42
-			$field_options['choice_display'] = array(
41
+		if ( $this->is_choice_value_enabled() ) {
42
+			$field_options[ 'choice_display' ] = array(
43 43
 				'type'    => 'radio',
44 44
 				'value'   => 'value',
45 45
 				'label'   => __( 'What should be displayed:', 'gravityview' ),
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 
110 110
 		add_filter( 'gravityview/sortable/field_blacklist', array( $this, '_filter_sortable_fields' ), 1 );
111 111
 
112
-		if( $this->_custom_merge_tag ) {
112
+		if ( $this->_custom_merge_tag ) {
113 113
 			add_filter( 'gform_custom_merge_tags', array( $this, '_filter_gform_custom_merge_tags' ), 10, 4 );
114 114
 			add_filter( 'gform_replace_merge_tags', array( $this, '_filter_gform_replace_merge_tags' ), 10, 7 );
115 115
 		}
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 	 *
132 132
 	 * @return string Original text if {_custom_merge_tag} isn't found. Otherwise, replaced text.
133 133
 	 */
134
-	public function _filter_gform_replace_merge_tags( $text, $form = array(), $entry = array(), $url_encode = false, $esc_html = false  ) {
134
+	public function _filter_gform_replace_merge_tags( $text, $form = array(), $entry = array(), $url_encode = false, $esc_html = false ) {
135 135
 
136 136
 		/**
137 137
 		 * This prevents the gform_replace_merge_tags filter from being called twice, as defined in:
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 		 * @see GFCommon::replace_variables_prepopulate()
140 140
 		 * @todo Remove eventually: Gravity Forms fixed this issue in 1.9.14
141 141
 		 */
142
-		if( false === $form ) {
142
+		if ( false === $form ) {
143 143
 			return $text;
144 144
 		}
145 145
 
@@ -172,19 +172,19 @@  discard block
 block discarded – undo
172 172
 	 */
173 173
 	public function replace_merge_tag( $matches = array(), $text = '', $form = array(), $entry = array(), $url_encode = false, $esc_html = false ) {
174 174
 
175
-		foreach( $matches as $match ) {
175
+		foreach ( $matches as $match ) {
176 176
 
177
-			$full_tag = $match[0];
177
+			$full_tag = $match[ 0 ];
178 178
 
179 179
 			// Strip the Merge Tags
180
-			$tag = str_replace( array( '{', '}'), '', $full_tag );
180
+			$tag = str_replace( array( '{', '}' ), '', $full_tag );
181 181
 
182 182
 			// Replace the value from the entry, if exists
183
-			if( isset( $entry[ $tag ] ) ) {
183
+			if ( isset( $entry[ $tag ] ) ) {
184 184
 
185 185
 				$value = $entry[ $tag ];
186 186
 
187
-				if( is_callable( array( $this, 'get_content') ) ) {
187
+				if ( is_callable( array( $this, 'get_content' ) ) ) {
188 188
 					$value = $this->get_content( $value );
189 189
 				}
190 190
 
@@ -257,8 +257,8 @@  discard block
 block discarded – undo
257 257
 	 */
258 258
 	public function _filter_sortable_fields( $not_sortable ) {
259 259
 
260
-		if( ! $this->is_sortable ) {
261
-			$not_sortable[] = $this->name;
260
+		if ( ! $this->is_sortable ) {
261
+			$not_sortable[ ] = $this->name;
262 262
 		}
263 263
 
264 264
 		return $not_sortable;
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
 			'date_display' => array(
288 288
 				'type' => 'text',
289 289
 				'label' => __( 'Override Date Format', 'gravityview' ),
290
-				'desc' => sprintf( __( 'Define how the date is displayed (using %sthe PHP date format%s)', 'gravityview'), '<a href="https://codex.wordpress.org/Formatting_Date_and_Time">', '</a>' ),
290
+				'desc' => sprintf( __( 'Define how the date is displayed (using %sthe PHP date format%s)', 'gravityview' ), '<a href="https://codex.wordpress.org/Formatting_Date_and_Time">', '</a>' ),
291 291
 				/**
292 292
 				 * @filter `gravityview_date_format` Override the date format with a [PHP date format](https://codex.wordpress.org/Formatting_Date_and_Time)
293 293
 				 * @param[in,out] null|string $date_format Date Format (default: null)
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
 
313 313
 		$options = $this->field_support_options();
314 314
 
315
-		if( isset( $options[ $key ] ) ) {
315
+		if ( isset( $options[ $key ] ) ) {
316 316
 			$field_options[ $key ] = $options[ $key ];
317 317
 		}
318 318
 
@@ -376,11 +376,11 @@  discard block
 block discarded – undo
376 376
 		$connected_form = rgpost( 'form_id' );
377 377
 
378 378
 		// Otherwise, get the Form ID from the Post page
379
-		if( empty( $connected_form ) ) {
379
+		if ( empty( $connected_form ) ) {
380 380
 			$connected_form = gravityview_get_form_id( get_the_ID() );
381 381
 		}
382 382
 
383
-		if( empty( $connected_form ) ) {
383
+		if ( empty( $connected_form ) ) {
384 384
 			do_action( 'gravityview_log_error', sprintf( '%s: Form not found for form ID "%s"', __METHOD__, $connected_form ) );
385 385
 			return false;
386 386
 		}
Please login to merge, or discard this patch.
plugin-and-theme-hooks/class-gravityview-plugin-hooks-gravityformsquiz.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -48,25 +48,25 @@
 block discarded – undo
48 48
 		
49 49
 		$quiz_fields = GFAPI::get_fields_by_type( $form, 'quiz' );
50 50
 		
51
-		if( ! empty( $quiz_fields ) ) {
51
+		if ( ! empty( $quiz_fields ) ) {
52 52
 			
53
-			$fields['gquiz_score']   = array(
53
+			$fields[ 'gquiz_score' ] = array(
54 54
 				'label' => __( 'Quiz Score Total', 'gravityview' ),
55 55
 				'type'  => 'quiz_score',
56 56
 				'desc'  => __( 'Displays the number of correct Quiz answers the user submitted.', 'gravityview' ),
57 57
 			);
58
-			$fields['gquiz_percent'] = array(
58
+			$fields[ 'gquiz_percent' ] = array(
59 59
 				'label' => __( 'Quiz Percentage Grade', 'gravityview' ),
60 60
 				'type'  => 'quiz_percent',
61 61
 				'desc'  => __( 'Displays the percentage of correct Quiz answers the user submitted.', 'gravityview' ),
62 62
 			);
63
-			$fields['gquiz_grade']   = array(
63
+			$fields[ 'gquiz_grade' ] = array(
64 64
 				/* translators: This is a field type used by the Gravity Forms Quiz Addon. "A" is 100-90, "B" is 89-80, "C" is 79-70, etc.  */
65 65
 				'label' => __( 'Quiz Letter Grade', 'gravityview' ),
66 66
 				'type'  => 'quiz_grade',
67 67
 				'desc'  => __( 'Displays the Grade the user achieved based on Letter Grading configured in the Quiz Settings.', 'gravityview' ),
68 68
 			);
69
-			$fields['gquiz_is_pass'] = array(
69
+			$fields[ 'gquiz_is_pass' ] = array(
70 70
 				'label' => __( 'Quiz Pass/Fail', 'gravityview' ),
71 71
 				'type'  => 'quiz_is_pass',
72 72
 				'desc'  => __( 'Displays either Passed or Failed based on the Pass/Fail settings configured in the Quiz Settings.', 'gravityview' ),
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-list.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 		// Add the list columns
63 63
 		foreach ( $list_fields as $list_field ) {
64 64
 
65
-			if( empty( $list_field->enableColumns ) ) {
65
+			if ( empty( $list_field->enableColumns ) ) {
66 66
 				continue;
67 67
 			}
68 68
 
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 			}
84 84
 
85 85
 			// If there are columns, add them under the parent field
86
-			if( ! empty( $list_columns ) ) {
86
+			if ( ! empty( $list_columns ) ) {
87 87
 				$index = array_search( $list_field->id, array_keys( $fields ) );
88 88
 				array_splice( $fields, ( $index + 1 ), 0, $list_columns );
89 89
 			}
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 
113 113
 		$list_rows = maybe_unserialize( $field_value );
114 114
 
115
-		if( ! is_array( $list_rows ) ) {
115
+		if ( ! is_array( $list_rows ) ) {
116 116
 			do_action( 'gravityview_log_error', __METHOD__ . ' - $field_value did not unserialize', $field_value );
117 117
 			return null;
118 118
 		}
@@ -125,15 +125,15 @@  discard block
 block discarded – undo
125 125
 			foreach ( $list_row as $column_key => $column_value ) {
126 126
 
127 127
 				// If the label of the column matches $column_id, or the numeric key value matches, add the value
128
-				if( (string)$column_key === (string)$column_id || ( is_numeric( $column_id ) && (int)$column_id === $current_column ) ) {
129
-					$column_values[] = $column_value;
128
+				if ( (string)$column_key === (string)$column_id || ( is_numeric( $column_id ) && (int)$column_id === $current_column ) ) {
129
+					$column_values[ ] = $column_value;
130 130
 				}
131 131
 				$current_column++;
132 132
 			}
133 133
 		}
134 134
 
135 135
 		// Return the array of values
136
-		if( 'raw' === $format ) {
136
+		if ( 'raw' === $format ) {
137 137
 			return $column_values;
138 138
 		}
139 139
 		// Return the Gravity Forms Field output
@@ -156,22 +156,22 @@  discard block
 block discarded – undo
156 156
 	 */
157 157
 	public function _filter_field_label( $label, $field, $form, $entry ) {
158 158
 
159
-		$field_object = RGFormsModel::get_field( $form, $field['id'] );
159
+		$field_object = RGFormsModel::get_field( $form, $field[ 'id' ] );
160 160
 
161 161
 		// Not a list field
162
-		if( ! $field_object || 'list' !== $field_object->type ) {
162
+		if ( ! $field_object || 'list' !== $field_object->type ) {
163 163
 			return $label;
164 164
 		}
165 165
 
166 166
 		// Custom label is defined, so use it
167
-		if( ! empty( $field['custom_label'] ) ) {
167
+		if ( ! empty( $field[ 'custom_label' ] ) ) {
168 168
 			return $label;
169 169
 		}
170 170
 
171
-		$column_id = gravityview_get_input_id_from_id( $field['id'] );
171
+		$column_id = gravityview_get_input_id_from_id( $field[ 'id' ] );
172 172
 
173 173
 		// Parent field, not column field
174
-		if( false === $column_id ) {
174
+		if ( false === $column_id ) {
175 175
 			return $label;
176 176
 		}
177 177
 
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 	public static function get_column_label( GF_Field_List $field, $column_id, $backup_label = '' ) {
193 193
 
194 194
 		// Doesn't have columns enabled
195
-		if( ! isset( $field->choices ) || ! $field->enableColumns ) {
195
+		if ( ! isset( $field->choices ) || ! $field->enableColumns ) {
196 196
 			return $backup_label;
197 197
 		}
198 198
 
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-password.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -49,17 +49,17 @@  discard block
 block discarded – undo
49 49
 	 *
50 50
 	 * @return string If a custom field label isn't set, return the field label for the password field
51 51
 	 */
52
-	function field_label( $label = '', $field = array(), $form = array(), $entry = array() ){
52
+	function field_label( $label = '', $field = array(), $form = array(), $entry = array() ) {
53 53
 
54 54
 		// If using a custom label, no need to fetch the parent label
55
-		if( ! is_numeric( $field['id'] ) || ! empty( $field['custom_label'] ) ) {
55
+		if ( ! is_numeric( $field[ 'id' ] ) || ! empty( $field[ 'custom_label' ] ) ) {
56 56
 			return $label;
57 57
 		}
58 58
 
59
-		$field_object = GFFormsModel::get_field( $form, $field['id'] );
59
+		$field_object = GFFormsModel::get_field( $form, $field[ 'id' ] );
60 60
 
61
-		if( $field_object && 'password' === $field_object->type ) {
62
-			$label = $field['label'];
61
+		if ( $field_object && 'password' === $field_object->type ) {
62
+			$label = $field[ 'label' ];
63 63
 		}
64 64
 
65 65
 		return $label;
@@ -79,16 +79,16 @@  discard block
 block discarded – undo
79 79
 	function add_form_fields( $fields = array(), $form = array(), $include_parent_field = true ) {
80 80
 
81 81
 		foreach ( $fields as $key => $field ) {
82
-			if( 'password' === $field['type'] ) {
82
+			if ( 'password' === $field[ 'type' ] ) {
83 83
 
84 84
 				// The Enter Password input
85
-				if( floor( $key ) === floatval( $key ) ) {
86
-					$field['label'] = $field['parent']->label;
87
-					$field['adminOnly'] = $field['parent']->adminOnly;
88
-					$field['adminLabel'] = $field['parent']->adminLabel;
85
+				if ( floor( $key ) === floatval( $key ) ) {
86
+					$field[ 'label' ] = $field[ 'parent' ]->label;
87
+					$field[ 'adminOnly' ] = $field[ 'parent' ]->adminOnly;
88
+					$field[ 'adminLabel' ] = $field[ 'parent' ]->adminLabel;
89 89
 
90 90
 					// Don't show as a child input
91
-					unset( $field['parent'] );
91
+					unset( $field[ 'parent' ] );
92 92
 
93 93
 					$fields[ $key ] = $field;
94 94
 				} else {
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
 	 *
50 50
 	 * @return string If a custom field label isn't set, return the field label for the password field
51 51
 	 */
52
-	function field_label( $label = '', $field = array(), $form = array(), $entry = array() ){
52
+	function field_label( $label = '', $field = array(), $form = array(), $entry = array() ) {
53 53
 
54 54
 		// If using a custom label, no need to fetch the parent label
55 55
 		if( ! is_numeric( $field['id'] ) || ! empty( $field['custom_label'] ) ) {
Please login to merge, or discard this patch.