Completed
Push — develop ( 1d02d7...3ab570 )
by Zack
10:35
created
includes/class-admin-views.php 1 patch
Spacing   +172 added lines, -172 removed lines patch added patch discarded remove patch
@@ -28,30 +28,30 @@  discard block
 block discarded – undo
28 28
 		add_filter( 'gravityview_blacklist_field_types', array( $this, 'default_field_blacklist' ), 10, 2 );
29 29
 
30 30
 		// Tooltips
31
-		add_filter( 'gform_tooltips', array( $this, 'tooltips') );
31
+		add_filter( 'gform_tooltips', array( $this, 'tooltips' ) );
32 32
 
33 33
 		// adding styles and scripts
34
-		add_action( 'admin_enqueue_scripts', array( 'GravityView_Admin_Views', 'add_scripts_and_styles'), 999 );
35
-		add_filter( 'gform_noconflict_styles', array( $this, 'register_no_conflict') );
36
-		add_filter( 'gform_noconflict_scripts', array( $this, 'register_no_conflict') );
37
-		add_filter( 'gravityview_noconflict_styles', array( $this, 'register_no_conflict') );
38
-		add_filter( 'gravityview_noconflict_scripts', array( $this, 'register_no_conflict') );
39
-
40
-		add_action( 'gravityview_render_directory_active_areas', array( $this, 'render_directory_active_areas'), 10, 4 );
41
-		add_action( 'gravityview_render_widgets_active_areas', array( $this, 'render_widgets_active_areas'), 10, 3 );
42
-		add_action( 'gravityview_render_available_fields', array( $this, 'render_available_fields'), 10, 2 );
43
-		add_action( 'gravityview_render_available_widgets', array( $this, 'render_available_widgets') );
44
-		add_action( 'gravityview_render_active_areas', array( $this, 'render_active_areas'), 10, 5 );
34
+		add_action( 'admin_enqueue_scripts', array( 'GravityView_Admin_Views', 'add_scripts_and_styles' ), 999 );
35
+		add_filter( 'gform_noconflict_styles', array( $this, 'register_no_conflict' ) );
36
+		add_filter( 'gform_noconflict_scripts', array( $this, 'register_no_conflict' ) );
37
+		add_filter( 'gravityview_noconflict_styles', array( $this, 'register_no_conflict' ) );
38
+		add_filter( 'gravityview_noconflict_scripts', array( $this, 'register_no_conflict' ) );
39
+
40
+		add_action( 'gravityview_render_directory_active_areas', array( $this, 'render_directory_active_areas' ), 10, 4 );
41
+		add_action( 'gravityview_render_widgets_active_areas', array( $this, 'render_widgets_active_areas' ), 10, 3 );
42
+		add_action( 'gravityview_render_available_fields', array( $this, 'render_available_fields' ), 10, 2 );
43
+		add_action( 'gravityview_render_available_widgets', array( $this, 'render_available_widgets' ) );
44
+		add_action( 'gravityview_render_active_areas', array( $this, 'render_active_areas' ), 10, 5 );
45 45
 
46 46
 		// @todo check if this hook is needed..
47 47
 		//add_action( 'gravityview_render_field_options', array( $this, 'render_field_options'), 10, 9 );
48 48
 
49 49
 		// Add Connected Form column
50
-		add_filter('manage_gravityview_posts_columns' , array( $this, 'add_post_type_columns' ) );
50
+		add_filter( 'manage_gravityview_posts_columns', array( $this, 'add_post_type_columns' ) );
51 51
 
52 52
 		add_filter( 'gform_toolbar_menu', array( 'GravityView_Admin_Views', 'gform_toolbar_menu' ), 10, 2 );
53 53
 
54
-		add_action( 'manage_gravityview_posts_custom_column', array( $this, 'add_custom_column_content'), 10, 2 );
54
+		add_action( 'manage_gravityview_posts_custom_column', array( $this, 'add_custom_column_content' ), 10, 2 );
55 55
 
56 56
 		add_action( 'restrict_manage_posts', array( $this, 'add_view_dropdown' ) );
57 57
 
@@ -66,11 +66,11 @@  discard block
 block discarded – undo
66 66
 	public function filter_pre_get_posts_by_gravityview_form_id( &$query ) {
67 67
 		global $pagenow;
68 68
 
69
-		if ( !is_admin() ) {
69
+		if ( ! is_admin() ) {
70 70
 			return;
71 71
 		}
72 72
 
73
-		if( 'edit.php' !== $pagenow || ! rgget( 'gravityview_form_id' ) || ! isset( $query->query_vars[ 'post_type' ] ) ) {
73
+		if ( 'edit.php' !== $pagenow || ! rgget( 'gravityview_form_id' ) || ! isset( $query->query_vars[ 'post_type' ] ) ) {
74 74
 			return;
75 75
 		}
76 76
 
@@ -87,18 +87,18 @@  discard block
 block discarded – undo
87 87
 	function add_view_dropdown() {
88 88
 		$current_screen = get_current_screen();
89 89
 
90
-		if( 'gravityview' !== $current_screen->post_type ) {
90
+		if ( 'gravityview' !== $current_screen->post_type ) {
91 91
 			return;
92 92
 		}
93 93
 
94 94
 		$forms = gravityview_get_forms();
95 95
 		$current_form = rgget( 'gravityview_form_id' );
96 96
 		// If there are no forms to select, show no forms.
97
-		if( !empty( $forms ) ) { ?>
97
+		if ( ! empty( $forms ) ) { ?>
98 98
 			<select name="gravityview_form_id" id="gravityview_form_id">
99 99
 				<option value="" <?php selected( '', $current_form, true ); ?>><?php esc_html_e( 'All forms', 'gravityview' ); ?></option>
100
-				<?php foreach( $forms as $form ) { ?>
101
-					<option value="<?php echo $form['id']; ?>" <?php selected( $form['id'], $current_form, true ); ?>><?php echo esc_html( $form['title'] ); ?></option>
100
+				<?php foreach ( $forms as $form ) { ?>
101
+					<option value="<?php echo $form[ 'id' ]; ?>" <?php selected( $form[ 'id' ], $current_form, true ); ?>><?php echo esc_html( $form[ 'title' ] ); ?></option>
102 102
 				<?php } ?>
103 103
 			</select>
104 104
 		<?php }
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 	 */
112 112
 	public static function render_setting_row( $key = '', $current_settings = array(), $override_input = null, $name = 'template_settings[%s]', $id = 'gravityview_se_%s' ) {
113 113
 		_deprecated_function( 'GravityView_Admin_Views::render_setting_row', '1.1.7', 'GravityView_Render_Settings::render_setting_row' );
114
-		GravityView_Render_Settings::render_setting_row( $key, $current_settings, $override_input, $name , $id );
114
+		GravityView_Render_Settings::render_setting_row( $key, $current_settings, $override_input, $name, $id );
115 115
 	}
116 116
 
117 117
 	/**
@@ -134,9 +134,9 @@  discard block
 block discarded – undo
134 134
 
135 135
 		$connected_views = gravityview_get_connected_views( $id );
136 136
 
137
-		if( empty( $connected_views ) ) {
137
+		if ( empty( $connected_views ) ) {
138 138
 
139
-		    $menu_items['gravityview'] = array(
139
+		    $menu_items[ 'gravityview' ] = array(
140 140
 				'label'          => esc_attr__( 'Create a View', 'gravityview' ),
141 141
 				'icon'           => '<i class="fa fa-lg gv-icon-astronaut-head gv-icon"></i>',
142 142
 				'title'          => esc_attr__( 'Create a View using this form as a data source', 'gravityview' ),
@@ -152,22 +152,22 @@  discard block
 block discarded – undo
152 152
 		$sub_menu_items = array();
153 153
 		foreach ( (array)$connected_views as $view ) {
154 154
 
155
-			if( ! GVCommon::has_cap( 'edit_gravityview', $view->ID ) ) {
155
+			if ( ! GVCommon::has_cap( 'edit_gravityview', $view->ID ) ) {
156 156
 				continue;
157 157
 			}
158 158
 
159
-			$label = empty( $view->post_title ) ? sprintf( __('No Title (View #%d)', 'gravityview' ), $view->ID ) : $view->post_title;
159
+			$label = empty( $view->post_title ) ? sprintf( __( 'No Title (View #%d)', 'gravityview' ), $view->ID ) : $view->post_title;
160 160
 
161
-			$sub_menu_items[] = array(
161
+			$sub_menu_items[ ] = array(
162 162
 				'label' => esc_attr( $label ),
163
-				'url' => admin_url( 'post.php?action=edit&post='.$view->ID ),
163
+				'url' => admin_url( 'post.php?action=edit&post=' . $view->ID ),
164 164
 			);
165 165
 		}
166 166
 
167 167
 		// If there were no items added, then let's create the parent menu
168
-		if( $sub_menu_items ) {
168
+		if ( $sub_menu_items ) {
169 169
 
170
-		    $sub_menu_items[] = array(
170
+		    $sub_menu_items[ ] = array(
171 171
 			    'label' => esc_attr__( 'Create a View', 'gravityview' ),
172 172
                 'link_class' => 'gv-create-view',
173 173
 			    'title' => esc_attr__( 'Create a View using this form as a data source', 'gravityview' ),
@@ -176,14 +176,14 @@  discard block
 block discarded – undo
176 176
             );
177 177
 
178 178
 			// Make sure Gravity Forms uses the submenu; if there's only one item, it uses a link instead of a dropdown
179
-			$sub_menu_items[] = array(
179
+			$sub_menu_items[ ] = array(
180 180
 				'url' => '#',
181 181
 				'label' => '',
182 182
 				'menu_class' => 'hidden',
183 183
 				'capabilities' => '',
184 184
 			);
185 185
 
186
-			$menu_items['gravityview'] = array(
186
+			$menu_items[ 'gravityview' ] = array(
187 187
 				'label'          => __( 'Connected Views', 'gravityview' ),
188 188
 				'icon'           => '<i class="fa fa-lg gv-icon-astronaut-head gv-icon"></i>',
189 189
 				'title'          => __( 'GravityView Views using this form as a data source', 'gravityview' ),
@@ -212,8 +212,8 @@  discard block
 block discarded – undo
212 212
 		$add = array( 'captcha', 'page' );
213 213
 
214 214
 		// Don't allowing editing the following values:
215
-		if( $context === 'edit' ) {
216
-			$add[] = 'post_id';
215
+		if ( $context === 'edit' ) {
216
+			$add[ ] = 'post_id';
217 217
 		}
218 218
 
219 219
 		$return = array_merge( $array, $add );
@@ -236,32 +236,32 @@  discard block
 block discarded – undo
236 236
 		foreach ( $default_args as $key => $arg ) {
237 237
 
238 238
 			// If an arg has `tooltip` defined, but it's false, don't display a tooltip
239
-			if( isset( $arg['tooltip'] ) && empty( $arg['tooltip'] ) ) { continue; }
239
+			if ( isset( $arg[ 'tooltip' ] ) && empty( $arg[ 'tooltip' ] ) ) { continue; }
240 240
 
241 241
 			// By default, use `tooltip` if defined.
242
-			$tooltip = empty( $arg['tooltip'] ) ? NULL : $arg['tooltip'];
242
+			$tooltip = empty( $arg[ 'tooltip' ] ) ? NULL : $arg[ 'tooltip' ];
243 243
 
244 244
 			// Otherwise, use the description as a tooltip.
245
-			if( empty( $tooltip ) && !empty( $arg['desc'] ) ) {
246
-				$tooltip = $arg['desc'];
245
+			if ( empty( $tooltip ) && ! empty( $arg[ 'desc' ] ) ) {
246
+				$tooltip = $arg[ 'desc' ];
247 247
 			}
248 248
 
249 249
 			// If there's no tooltip set, continue
250
-			if( empty( $tooltip ) ) {
250
+			if ( empty( $tooltip ) ) {
251 251
 				continue;
252 252
 			}
253 253
 
254 254
 			// Add the tooltip
255
-			$gv_tooltips[ 'gv_'.$key ] = array(
256
-				'title'	=> $arg['label'],
255
+			$gv_tooltips[ 'gv_' . $key ] = array(
256
+				'title'	=> $arg[ 'label' ],
257 257
 				'value'	=> $tooltip,
258 258
 			);
259 259
 
260 260
 		}
261 261
 
262
-		$gv_tooltips['gv_css_merge_tags'] = array(
263
-			'title' => __('CSS Merge Tags', 'gravityview'),
264
-			'value' => sprintf( __( 'Developers: The CSS classes will be sanitized using the %ssanitize_title_with_dashes()%s function.', 'gravityview'), '<code>', '</code>' )
262
+		$gv_tooltips[ 'gv_css_merge_tags' ] = array(
263
+			'title' => __( 'CSS Merge Tags', 'gravityview' ),
264
+			'value' => sprintf( __( 'Developers: The CSS classes will be sanitized using the %ssanitize_title_with_dashes()%s function.', 'gravityview' ), '<code>', '</code>' )
265 265
 		);
266 266
 
267 267
 		/**
@@ -272,9 +272,9 @@  discard block
 block discarded – undo
272 272
 
273 273
 		foreach ( $gv_tooltips as $key => $tooltip ) {
274 274
 
275
-			$title = empty( $tooltip['title'] ) ? '' : '<h6>'.esc_html( $tooltip['title'] ) .'</h6>';
275
+			$title = empty( $tooltip[ 'title' ] ) ? '' : '<h6>' . esc_html( $tooltip[ 'title' ] ) . '</h6>';
276 276
 
277
-			$tooltips[ $key ] = $title . wpautop( esc_html( $tooltip['value'] ) );
277
+			$tooltips[ $key ] = $title . wpautop( esc_html( $tooltip[ 'value' ] ) );
278 278
 		}
279 279
 
280 280
 		return $tooltips;
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
 	 *
289 289
 	 * @return void
290 290
 	 */
291
-	public function add_custom_column_content( $column_name = NULL, $post_id )	{
291
+	public function add_custom_column_content( $column_name = NULL, $post_id ) {
292 292
 
293 293
 		$output = '';
294 294
 
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
 				// Generate backup if label doesn't exist: `example_name` => `Example Name`
311 311
 				$template_id_pretty = ucwords( implode( ' ', explode( '_', $template_id ) ) );
312 312
 
313
-				$output = $template ? $template['label'] : $template_id_pretty;
313
+				$output = $template ? $template[ 'label' ] : $template_id_pretty;
314 314
 
315 315
 				break;
316 316
 
@@ -351,44 +351,44 @@  discard block
 block discarded – undo
351 351
 	static public function get_connected_form_links( $form, $include_form_link = true ) {
352 352
 
353 353
 		// Either the form is empty or the form ID is 0, not yet set.
354
-		if( empty( $form ) ) {
354
+		if ( empty( $form ) ) {
355 355
 			return '';
356 356
 		}
357 357
 
358 358
 		// The $form is passed as the form ID
359
-		if( !is_array( $form ) ) {
359
+		if ( ! is_array( $form ) ) {
360 360
 			$form = gravityview_get_form( $form );
361 361
 		}
362 362
 
363
-		$form_id = $form['id'];
363
+		$form_id = $form[ 'id' ];
364 364
 		$links = array();
365 365
 
366
-		if( GVCommon::has_cap( 'gravityforms_edit_forms' ) ) {
366
+		if ( GVCommon::has_cap( 'gravityforms_edit_forms' ) ) {
367 367
 			$form_url = admin_url( sprintf( 'admin.php?page=gf_edit_forms&amp;id=%d', $form_id ) );
368
-			$form_link = '<strong class="gv-form-title">'.gravityview_get_link( $form_url, $form['title'], 'class=row-title' ).'</strong>';
369
-			$links[] = '<span>'.gravityview_get_link( $form_url, __('Edit Form', 'gravityview') ).'</span>';
368
+			$form_link = '<strong class="gv-form-title">' . gravityview_get_link( $form_url, $form[ 'title' ], 'class=row-title' ) . '</strong>';
369
+			$links[ ] = '<span>' . gravityview_get_link( $form_url, __( 'Edit Form', 'gravityview' ) ) . '</span>';
370 370
 		} else {
371
-			$form_link = '<strong class="gv-form-title">'. esc_html( $form['title'] ). '</strong>';
371
+			$form_link = '<strong class="gv-form-title">' . esc_html( $form[ 'title' ] ) . '</strong>';
372 372
 		}
373 373
 
374
-		if( GVCommon::has_cap( 'gravityforms_view_entries' ) ) {
374
+		if ( GVCommon::has_cap( 'gravityforms_view_entries' ) ) {
375 375
 			$entries_url = admin_url( sprintf( 'admin.php?page=gf_entries&amp;id=%d', $form_id ) );
376
-			$links[] = '<span>'.gravityview_get_link( $entries_url, __('Entries', 'gravityview') ).'</span>';
376
+			$links[ ] = '<span>' . gravityview_get_link( $entries_url, __( 'Entries', 'gravityview' ) ) . '</span>';
377 377
 		}
378 378
 
379
-		if( GVCommon::has_cap( array( 'gravityforms_edit_settings', 'gravityview_view_settings' ) ) ) {
379
+		if ( GVCommon::has_cap( array( 'gravityforms_edit_settings', 'gravityview_view_settings' ) ) ) {
380 380
 			$settings_url = admin_url( sprintf( 'admin.php?page=gf_edit_forms&amp;view=settings&amp;id=%d', $form_id ) );
381
-			$links[] = '<span>'.gravityview_get_link( $settings_url, __('Settings', 'gravityview'), 'title='.__('Edit settings for this form', 'gravityview') ).'</span>';
381
+			$links[ ] = '<span>' . gravityview_get_link( $settings_url, __( 'Settings', 'gravityview' ), 'title=' . __( 'Edit settings for this form', 'gravityview' ) ) . '</span>';
382 382
 		}
383 383
 
384
-		if( GVCommon::has_cap( array("gravityforms_edit_forms", "gravityforms_create_form", "gravityforms_preview_forms") ) ) {
384
+		if ( GVCommon::has_cap( array( "gravityforms_edit_forms", "gravityforms_create_form", "gravityforms_preview_forms" ) ) ) {
385 385
 			$preview_url = site_url( sprintf( '?gf_page=preview&amp;id=%d', $form_id ) );
386
-			$links[] = '<span>'.gravityview_get_link( $preview_url, __('Preview Form', 'gravityview'), 'title='.__('Preview this form', 'gravityview') ).'</span>';
386
+			$links[ ] = '<span>' . gravityview_get_link( $preview_url, __( 'Preview Form', 'gravityview' ), 'title=' . __( 'Preview this form', 'gravityview' ) ) . '</span>';
387 387
 		}
388 388
 
389 389
 		$output = '';
390 390
 
391
-		if( !empty( $include_form_link ) ) {
391
+		if ( ! empty( $include_form_link ) ) {
392 392
 			$output .= $form_link;
393 393
 		}
394 394
 
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
 		 */
401 401
 		$links = apply_filters( 'gravityview_connected_form_links', $links, $form );
402 402
 
403
-		$output .= '<div class="row-actions">'. implode( ' | ', $links ) .'</div>';
403
+		$output .= '<div class="row-actions">' . implode( ' | ', $links ) . '</div>';
404 404
 
405 405
 		return $output;
406 406
 	}
@@ -414,8 +414,8 @@  discard block
 block discarded – undo
414 414
 		// Get the date column and save it for later to add back in.
415 415
 		// This adds it after the Data Source column.
416 416
 		// This way, we don't need to do array_slice, array_merge, etc.
417
-		$date = $columns['date'];
418
-		unset( $columns['date'] );
417
+		$date = $columns[ 'date' ];
418
+		unset( $columns[ 'date' ] );
419 419
 
420 420
 		$data_source_required_caps = array(
421 421
 			'gravityforms_edit_forms',
@@ -426,14 +426,14 @@  discard block
 block discarded – undo
426 426
 			'gravityforms_preview_forms',
427 427
 		);
428 428
 
429
-		if( GVCommon::has_cap( $data_source_required_caps ) ) {
430
-			$columns['gv_connected_form'] = __( 'Data Source', 'gravityview' );
429
+		if ( GVCommon::has_cap( $data_source_required_caps ) ) {
430
+			$columns[ 'gv_connected_form' ] = __( 'Data Source', 'gravityview' );
431 431
 		}
432 432
 
433
-		$columns['gv_template'] = _x( 'Template', 'Column title that shows what template is being used for Views', 'gravityview' );
433
+		$columns[ 'gv_template' ] = _x( 'Template', 'Column title that shows what template is being used for Views', 'gravityview' );
434 434
 
435 435
 		// Add the date back in.
436
-		$columns['date'] = $date;
436
+		$columns[ 'date' ] = $date;
437 437
 
438 438
 		return $columns;
439 439
 	}
@@ -447,12 +447,12 @@  discard block
 block discarded – undo
447 447
 	 */
448 448
 	function save_postdata( $post_id ) {
449 449
 
450
-		if( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ){
450
+		if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
451 451
 			return;
452 452
 		}
453 453
 
454 454
 		// validate post_type
455
-		if ( ! isset( $_POST['post_type'] ) || 'gravityview' != $_POST['post_type'] ) {
455
+		if ( ! isset( $_POST[ 'post_type' ] ) || 'gravityview' != $_POST[ 'post_type' ] ) {
456 456
 			return;
457 457
 		}
458 458
 
@@ -467,63 +467,63 @@  discard block
 block discarded – undo
467 467
 		$statii = array();
468 468
 
469 469
 		// check if this is a start fresh View
470
-		if ( isset( $_POST['gravityview_select_form_nonce'] ) && wp_verify_nonce( $_POST['gravityview_select_form_nonce'], 'gravityview_select_form' ) ) {
470
+		if ( isset( $_POST[ 'gravityview_select_form_nonce' ] ) && wp_verify_nonce( $_POST[ 'gravityview_select_form_nonce' ], 'gravityview_select_form' ) ) {
471 471
 
472
-			$form_id = !empty( $_POST['gravityview_form_id'] ) ? $_POST['gravityview_form_id'] : '';
472
+			$form_id = ! empty( $_POST[ 'gravityview_form_id' ] ) ? $_POST[ 'gravityview_form_id' ] : '';
473 473
 			// save form id
474
-			$statii['form_id'] = update_post_meta( $post_id, '_gravityview_form_id', $form_id );
474
+			$statii[ 'form_id' ] = update_post_meta( $post_id, '_gravityview_form_id', $form_id );
475 475
 
476 476
 		}
477 477
 
478
-		if( false === GVCommon::has_cap( 'gravityforms_create_form' ) && empty( $statii['form_id'] ) ) {
478
+		if ( false === GVCommon::has_cap( 'gravityforms_create_form' ) && empty( $statii[ 'form_id' ] ) ) {
479 479
 			do_action( 'gravityview_log_error', __METHOD__ . ' - Current user does not have the capability to create a new Form.', wp_get_current_user() );
480 480
 			return;
481 481
 		}
482 482
 
483 483
 		// Was this a start fresh?
484
-		if ( ! empty( $_POST['gravityview_form_id_start_fresh'] ) ) {
485
-			$statii['start_fresh'] = add_post_meta( $post_id, '_gravityview_start_fresh', 1 );
484
+		if ( ! empty( $_POST[ 'gravityview_form_id_start_fresh' ] ) ) {
485
+			$statii[ 'start_fresh' ] = add_post_meta( $post_id, '_gravityview_start_fresh', 1 );
486 486
 		} else {
487
-			$statii['start_fresh'] = delete_post_meta( $post_id, '_gravityview_start_fresh' );
487
+			$statii[ 'start_fresh' ] = delete_post_meta( $post_id, '_gravityview_start_fresh' );
488 488
 		}
489 489
 
490 490
 		// Check if we have a template id
491
-		if ( isset( $_POST['gravityview_select_template_nonce'] ) && wp_verify_nonce( $_POST['gravityview_select_template_nonce'], 'gravityview_select_template' ) ) {
491
+		if ( isset( $_POST[ 'gravityview_select_template_nonce' ] ) && wp_verify_nonce( $_POST[ 'gravityview_select_template_nonce' ], 'gravityview_select_template' ) ) {
492 492
 
493
-			$template_id = !empty( $_POST['gravityview_directory_template'] ) ? $_POST['gravityview_directory_template'] : '';
493
+			$template_id = ! empty( $_POST[ 'gravityview_directory_template' ] ) ? $_POST[ 'gravityview_directory_template' ] : '';
494 494
 
495 495
 			// now save template id
496
-			$statii['directory_template'] = update_post_meta( $post_id, '_gravityview_directory_template', $template_id );
496
+			$statii[ 'directory_template' ] = update_post_meta( $post_id, '_gravityview_directory_template', $template_id );
497 497
 		}
498 498
 
499 499
 
500 500
 		// save View Configuration metabox
501
-		if ( isset( $_POST['gravityview_view_configuration_nonce'] ) && wp_verify_nonce( $_POST['gravityview_view_configuration_nonce'], 'gravityview_view_configuration' ) ) {
501
+		if ( isset( $_POST[ 'gravityview_view_configuration_nonce' ] ) && wp_verify_nonce( $_POST[ 'gravityview_view_configuration_nonce' ], 'gravityview_view_configuration' ) ) {
502 502
 
503 503
 			// template settings
504
-			if( empty( $_POST['template_settings'] ) ) {
505
-				$_POST['template_settings'] = array();
504
+			if ( empty( $_POST[ 'template_settings' ] ) ) {
505
+				$_POST[ 'template_settings' ] = array();
506 506
 			}
507
-			$statii['template_settings'] = update_post_meta( $post_id, '_gravityview_template_settings', $_POST['template_settings'] );
507
+			$statii[ 'template_settings' ] = update_post_meta( $post_id, '_gravityview_template_settings', $_POST[ 'template_settings' ] );
508 508
 
509 509
 			$fields = array();
510 510
 
511 511
 			// Directory&single Visible Fields
512
-			if( !empty( $preset_fields ) ) {
512
+			if ( ! empty( $preset_fields ) ) {
513 513
 
514 514
 				$fields = $preset_fields;
515 515
 
516
-			} elseif( !empty( $_POST['gv_fields'] ) ) {
516
+			} elseif ( ! empty( $_POST[ 'gv_fields' ] ) ) {
517 517
 				$fields = _gravityview_process_posted_fields();
518 518
 			}
519 519
 
520
-			$statii['directory_fields'] = update_post_meta( $post_id, '_gravityview_directory_fields', $fields );
520
+			$statii[ 'directory_fields' ] = update_post_meta( $post_id, '_gravityview_directory_fields', $fields );
521 521
 
522 522
 			// Directory Visible Widgets
523
-			if( empty( $_POST['widgets'] ) ) {
524
-				$_POST['widgets'] = array();
523
+			if ( empty( $_POST[ 'widgets' ] ) ) {
524
+				$_POST[ 'widgets' ] = array();
525 525
 			}
526
-			$statii['directory_widgets'] = gravityview_set_directory_widgets( $post_id, $_POST['widgets'] );
526
+			$statii[ 'directory_widgets' ] = gravityview_set_directory_widgets( $post_id, $_POST[ 'widgets' ] );
527 527
 
528 528
 		} // end save view configuration
529 529
 
@@ -533,9 +533,9 @@  discard block
 block discarded – undo
533 533
 		 * @param array $statii Array of statuses of the post meta saving processes. If saving worked, each key should be mapped to a value of the post ID (`directory_widgets` => `124`). If failed (or didn't change), the value will be false.
534 534
 		 * @since 1.17.2
535 535
 		 */
536
-		do_action('gravityview_view_saved', $post_id, $statii );
536
+		do_action( 'gravityview_view_saved', $post_id, $statii );
537 537
 
538
-		do_action('gravityview_log_debug', '[save_postdata] Update Post Meta Statuses (also returns false if nothing changed)', array_map( 'intval', $statii ) );
538
+		do_action( 'gravityview_log_debug', '[save_postdata] Update Post Meta Statuses (also returns false if nothing changed)', array_map( 'intval', $statii ) );
539 539
 	}
540 540
 
541 541
 	/**
@@ -577,20 +577,20 @@  discard block
 block discarded – undo
577 577
 
578 578
 		$output = '';
579 579
 
580
-		if( !empty( $fields ) ) {
580
+		if ( ! empty( $fields ) ) {
581 581
 
582
-			foreach( $fields as $id => $details ) {
582
+			foreach ( $fields as $id => $details ) {
583 583
 
584
-				if( in_array( $details['type'], (array) $blacklist_field_types ) ) {
584
+				if ( in_array( $details[ 'type' ], (array)$blacklist_field_types ) ) {
585 585
 					continue;
586 586
 				}
587 587
 
588 588
 				// Edit mode only allows editing the parent fields, not single inputs.
589
-				if( $context === 'edit' && !empty( $details['parent'] ) ) {
589
+				if ( $context === 'edit' && ! empty( $details[ 'parent' ] ) ) {
590 590
 					continue;
591 591
 				}
592 592
 
593
-				$output .= new GravityView_Admin_View_Field( $details['label'], $id, $details );
593
+				$output .= new GravityView_Admin_View_Field( $details[ 'label' ], $id, $details );
594 594
 
595 595
 			} // End foreach
596 596
 		}
@@ -598,7 +598,7 @@  discard block
 block discarded – undo
598 598
 		echo $output;
599 599
 
600 600
 		// For the EDIT view we only want to allow the form fields.
601
-		if( $context === 'edit' ) {
601
+		if ( $context === 'edit' ) {
602 602
 			return;
603 603
 		}
604 604
 
@@ -622,16 +622,16 @@  discard block
 block discarded – undo
622 622
 		$additional_fields = apply_filters( 'gravityview_additional_fields', array(
623 623
 			array(
624 624
 				'label_text' => __( '+ Add All Fields', 'gravityview' ),
625
-				'desc' => __('Add all the available fields at once.', 'gravityview'),
625
+				'desc' => __( 'Add all the available fields at once.', 'gravityview' ),
626 626
 				'field_id' => 'all-fields',
627 627
 				'label_type' => 'field',
628 628
 				'input_type' => NULL,
629 629
 				'field_options' => NULL,
630 630
 				'settings_html'	=> NULL,
631 631
 			)
632
-		));
632
+		) );
633 633
 
634
-		if( !empty( $additional_fields )) {
634
+		if ( ! empty( $additional_fields ) ) {
635 635
 			foreach ( (array)$additional_fields as $item ) {
636 636
 
637 637
 				// Prevent items from not having index set
@@ -642,16 +642,16 @@  discard block
 block discarded – undo
642 642
 					'input_type' => NULL,
643 643
 					'field_options' => NULL,
644 644
 					'settings_html'	=> NULL,
645
-				));
645
+				) );
646 646
 
647 647
 				// Backward compat.
648
-				if( !empty( $item['field_options'] ) ) {
648
+				if ( ! empty( $item[ 'field_options' ] ) ) {
649 649
 					// Use settings_html from now on.
650
-					$item['settings_html'] = $item['field_options'];
650
+					$item[ 'settings_html' ] = $item[ 'field_options' ];
651 651
 				}
652 652
 
653 653
 				// Render a label for each of them
654
-				echo new GravityView_Admin_View_Field( $item['label_text'], $item['field_id'], $item );
654
+				echo new GravityView_Admin_View_Field( $item[ 'label_text' ], $item[ 'field_id' ], $item );
655 655
 
656 656
 			}
657 657
 		}
@@ -664,54 +664,54 @@  discard block
 block discarded – undo
664 664
 	 * @param  string $zone   Either 'single', 'directory', 'header', 'footer'
665 665
 	 * @return array
666 666
 	 */
667
-	function get_entry_default_fields($form, $zone) {
667
+	function get_entry_default_fields( $form, $zone ) {
668 668
 
669 669
 		$entry_default_fields = array();
670 670
 
671
-		if( in_array( $zone, array( 'directory', 'single' ) ) ) {
671
+		if ( in_array( $zone, array( 'directory', 'single' ) ) ) {
672 672
 
673 673
 			$entry_default_fields = array(
674 674
 				'id' => array(
675
-					'label' => __('Entry ID', 'gravityview'),
675
+					'label' => __( 'Entry ID', 'gravityview' ),
676 676
 					'type' => 'id',
677
-					'desc'	=> __('The unique ID of the entry.', 'gravityview'),
677
+					'desc'	=> __( 'The unique ID of the entry.', 'gravityview' ),
678 678
 				),
679 679
 				'date_created' => array(
680
-					'label' => __('Entry Date', 'gravityview'),
681
-					'desc'	=> __('The date the entry was created.', 'gravityview'),
680
+					'label' => __( 'Entry Date', 'gravityview' ),
681
+					'desc'	=> __( 'The date the entry was created.', 'gravityview' ),
682 682
 					'type' => 'date_created',
683 683
 				),
684 684
 				'source_url' => array(
685
-					'label' => __('Source URL', 'gravityview'),
685
+					'label' => __( 'Source URL', 'gravityview' ),
686 686
 					'type' => 'source_url',
687
-					'desc'	=> __('The URL of the page where the form was submitted.', 'gravityview'),
687
+					'desc'	=> __( 'The URL of the page where the form was submitted.', 'gravityview' ),
688 688
 				),
689 689
 				'ip' => array(
690
-					'label' => __('User IP', 'gravityview'),
690
+					'label' => __( 'User IP', 'gravityview' ),
691 691
 					'type' => 'ip',
692
-					'desc'	=> __('The IP Address of the user who created the entry.', 'gravityview'),
692
+					'desc'	=> __( 'The IP Address of the user who created the entry.', 'gravityview' ),
693 693
 				),
694 694
 				'created_by' => array(
695
-					'label' => __('User', 'gravityview'),
695
+					'label' => __( 'User', 'gravityview' ),
696 696
 					'type' => 'created_by',
697
-					'desc'	=> __('Details of the logged-in user who created the entry (if any).', 'gravityview'),
697
+					'desc'	=> __( 'Details of the logged-in user who created the entry (if any).', 'gravityview' ),
698 698
 				),
699 699
 
700 700
 				/**
701 701
 				 * @since 1.7.2
702 702
 				 */
703 703
 			    'other_entries' => array(
704
-				    'label'	=> __('Other Entries', 'gravityview'),
704
+				    'label'	=> __( 'Other Entries', 'gravityview' ),
705 705
 				    'type'	=> 'other_entries',
706
-				    'desc'	=> __('Display other entries created by the entry creator.', 'gravityview'),
706
+				    'desc'	=> __( 'Display other entries created by the entry creator.', 'gravityview' ),
707 707
 			    ),
708 708
 	        );
709 709
 
710
-			if( 'single' !== $zone) {
710
+			if ( 'single' !== $zone ) {
711 711
 
712
-				$entry_default_fields['entry_link'] = array(
713
-					'label' => __('Link to Entry', 'gravityview'),
714
-					'desc'	=> __('A dedicated link to the single entry with customizable text.', 'gravityview'),
712
+				$entry_default_fields[ 'entry_link' ] = array(
713
+					'label' => __( 'Link to Entry', 'gravityview' ),
714
+					'desc'	=> __( 'A dedicated link to the single entry with customizable text.', 'gravityview' ),
715 715
 					'type' => 'entry_link',
716 716
 				);
717 717
 			}
@@ -721,10 +721,10 @@  discard block
 block discarded – undo
721 721
 		/**
722 722
 		 * @since  1.2
723 723
 		 */
724
-		$entry_default_fields['custom']	= array(
725
-			'label'	=> __('Custom Content', 'gravityview'),
724
+		$entry_default_fields[ 'custom' ] = array(
725
+			'label'	=> __( 'Custom Content', 'gravityview' ),
726 726
 			'type'	=> 'custom',
727
-			'desc'	=> __('Insert custom text or HTML.', 'gravityview'),
727
+			'desc'	=> __( 'Insert custom text or HTML.', 'gravityview' ),
728 728
 		);
729 729
 
730 730
 		/**
@@ -733,7 +733,7 @@  discard block
 block discarded – undo
733 733
 		 * @param  string|array $form form_ID or form object
734 734
 		 * @param  string $zone   Either 'single', 'directory', 'header', 'footer'
735 735
 		 */
736
-		return apply_filters( 'gravityview_entry_default_fields', $entry_default_fields, $form, $zone);
736
+		return apply_filters( 'gravityview_entry_default_fields', $entry_default_fields, $form, $zone );
737 737
 	}
738 738
 
739 739
 	/**
@@ -744,7 +744,7 @@  discard block
 block discarded – undo
744 744
 	 */
745 745
 	function get_available_fields( $form = '', $zone = NULL ) {
746 746
 
747
-		if( empty( $form ) ) {
747
+		if ( empty( $form ) ) {
748 748
 			do_action( 'gravityview_log_error', '[get_available_fields] $form is empty' );
749 749
 			return array();
750 750
 		}
@@ -753,7 +753,7 @@  discard block
 block discarded – undo
753 753
 		$fields = gravityview_get_form_fields( $form, true );
754 754
 
755 755
 		// get meta fields ( only if form was already created )
756
-		if( !is_array( $form ) ) {
756
+		if ( ! is_array( $form ) ) {
757 757
 			$meta_fields = gravityview_get_entry_meta( $form );
758 758
 		} else {
759 759
 			$meta_fields = array();
@@ -777,11 +777,11 @@  discard block
 block discarded – undo
777 777
 
778 778
 		$widgets = $this->get_registered_widgets();
779 779
 
780
-		if( !empty( $widgets ) ) {
780
+		if ( ! empty( $widgets ) ) {
781 781
 
782
-			foreach( $widgets as $id => $details ) {
782
+			foreach ( $widgets as $id => $details ) {
783 783
 
784
-				echo new GravityView_Admin_View_Widget( $details['label'], $id, $details );
784
+				echo new GravityView_Admin_View_Widget( $details[ 'label' ], $id, $details );
785 785
 
786 786
 			}
787 787
 		}
@@ -815,7 +815,7 @@  discard block
 block discarded – undo
815 815
 	function render_active_areas( $template_id, $type, $zone, $rows, $values ) {
816 816
 		global $post;
817 817
 
818
-		if( $type === 'widget' ) {
818
+		if ( $type === 'widget' ) {
819 819
 			$button_label = __( 'Add Widget', 'gravityview' );
820 820
 		} else {
821 821
 			$button_label = __( 'Add Field', 'gravityview' );
@@ -824,15 +824,15 @@  discard block
 block discarded – undo
824 824
 		$available_items = array();
825 825
 
826 826
 		// if saved values, get available fields to label everyone
827
-		if( !empty( $values ) && ( !empty( $post->ID ) || !empty( $_POST['template_id'] ) ) ) {
827
+		if ( ! empty( $values ) && ( ! empty( $post->ID ) || ! empty( $_POST[ 'template_id' ] ) ) ) {
828 828
 
829
-			if( !empty( $_POST['template_id'] ) ) {
830
-				$form = GravityView_Ajax::pre_get_form_fields( $_POST['template_id'] );
829
+			if ( ! empty( $_POST[ 'template_id' ] ) ) {
830
+				$form = GravityView_Ajax::pre_get_form_fields( $_POST[ 'template_id' ] );
831 831
 			} else {
832 832
 				$form = gravityview_get_form_id( $post->ID );
833 833
 			}
834 834
 
835
-			if( 'field' === $type ) {
835
+			if ( 'field' === $type ) {
836 836
 				$available_items = $this->get_available_fields( $form, $zone );
837 837
 			} else {
838 838
 				$available_items = $this->get_registered_widgets();
@@ -840,39 +840,39 @@  discard block
 block discarded – undo
840 840
 
841 841
 		}
842 842
 
843
-		foreach( $rows as $row ) :
844
-			foreach( $row as $col => $areas ) :
845
-				$column = ($col == '2-2') ? '1-2' : $col; ?>
843
+		foreach ( $rows as $row ) :
844
+			foreach ( $row as $col => $areas ) :
845
+				$column = ( $col == '2-2' ) ? '1-2' : $col; ?>
846 846
 
847 847
 				<div class="gv-grid-col-<?php echo esc_attr( $column ); ?>">
848 848
 
849
-					<?php foreach( $areas as $area ) : 	?>
849
+					<?php foreach ( $areas as $area ) : 	?>
850 850
 
851 851
 						<div class="gv-droppable-area">
852
-							<div class="active-drop active-drop-<?php echo esc_attr( $type ); ?>" data-areaid="<?php echo esc_attr( $zone .'_'. $area['areaid'] ); ?>">
852
+							<div class="active-drop active-drop-<?php echo esc_attr( $type ); ?>" data-areaid="<?php echo esc_attr( $zone . '_' . $area[ 'areaid' ] ); ?>">
853 853
 
854 854
 								<?php // render saved fields
855 855
 
856
-								if( !empty( $values[ $zone .'_'. $area['areaid'] ] ) ) {
856
+								if ( ! empty( $values[ $zone . '_' . $area[ 'areaid' ] ] ) ) {
857 857
 
858
-									foreach( $values[ $zone .'_'. $area['areaid'] ] as $uniqid => $field ) {
858
+									foreach ( $values[ $zone . '_' . $area[ 'areaid' ] ] as $uniqid => $field ) {
859 859
 
860 860
 										$input_type = NULL;
861
-										$original_item = isset( $available_items[ $field['id'] ] ) ? $available_items[ $field['id'] ] : false ;
861
+										$original_item = isset( $available_items[ $field[ 'id' ] ] ) ? $available_items[ $field[ 'id' ] ] : false;
862 862
 
863
-										if( !$original_item ) {
863
+										if ( ! $original_item ) {
864 864
 
865
-											do_action('gravityview_log_error', 'An item was not available when rendering the output; maybe it was added by a plugin that is now de-activated.', array('available_items' => $available_items, 'field' => $field ));
865
+											do_action( 'gravityview_log_error', 'An item was not available when rendering the output; maybe it was added by a plugin that is now de-activated.', array( 'available_items' => $available_items, 'field' => $field ) );
866 866
 
867 867
 											$original_item = $field;
868 868
 										} else {
869 869
 
870
-											$input_type = isset( $original_item['type'] ) ? $original_item['type'] : NULL;
870
+											$input_type = isset( $original_item[ 'type' ] ) ? $original_item[ 'type' ] : NULL;
871 871
 
872 872
 										}
873 873
 
874 874
 										// Field options dialog box
875
-										$field_options = GravityView_Render_Settings::render_field_options( $type, $template_id, $field['id'], $original_item['label'], $zone .'_'. $area['areaid'], $input_type, $uniqid, $field, $zone, $original_item );
875
+										$field_options = GravityView_Render_Settings::render_field_options( $type, $template_id, $field[ 'id' ], $original_item[ 'label' ], $zone . '_' . $area[ 'areaid' ], $input_type, $uniqid, $field, $zone, $original_item );
876 876
 
877 877
 										$item = array(
878 878
 											'input_type' => $input_type,
@@ -881,16 +881,16 @@  discard block
 block discarded – undo
881 881
 										);
882 882
 
883 883
 										// Merge the values with the current item to pass things like widget descriptions and original field names
884
-										if( $original_item ) {
884
+										if ( $original_item ) {
885 885
 											$item = wp_parse_args( $item, $original_item );
886 886
 										}
887 887
 
888
-										switch( $type ) {
888
+										switch ( $type ) {
889 889
 											case 'widget':
890
-												echo new GravityView_Admin_View_Widget( $item['label'], $field['id'], $item, $field );
890
+												echo new GravityView_Admin_View_Widget( $item[ 'label' ], $field[ 'id' ], $item, $field );
891 891
 												break;
892 892
 											default:
893
-												echo new GravityView_Admin_View_Field( $item['label'], $field['id'], $item, $field );
893
+												echo new GravityView_Admin_View_Field( $item[ 'label' ], $field[ 'id' ], $item, $field );
894 894
 										}
895 895
 
896 896
 
@@ -900,11 +900,11 @@  discard block
 block discarded – undo
900 900
 
901 901
 								} // End if zone is not empty ?>
902 902
 
903
-								<span class="drop-message"><?php echo sprintf(esc_attr__('"+ %s" or drag existing %ss here.', 'gravityview'), $button_label, $type ); ?></span>
903
+								<span class="drop-message"><?php echo sprintf( esc_attr__( '"+ %s" or drag existing %ss here.', 'gravityview' ), $button_label, $type ); ?></span>
904 904
 							</div>
905 905
 							<div class="gv-droppable-area-action">
906
-								<a href="#" class="gv-add-field button-secondary" title="" data-objecttype="<?php echo esc_attr( $type ); ?>" data-areaid="<?php echo esc_attr( $zone .'_'. $area['areaid'] ); ?>" data-context="<?php echo esc_attr( $zone ); ?>"><?php echo '+ '.esc_html( $button_label ); ?></a>
907
-								<p class="gv-droppable-area-title"><strong><?php echo esc_html( $area['title'] ); ?></strong><?php if( !empty( $area['subtitle'] ) ) { ?><span class="gv-droppable-area-subtitle"> &ndash; <?php echo esc_html( $area['subtitle'] ); ?></span><?php } ?></p>
906
+								<a href="#" class="gv-add-field button-secondary" title="" data-objecttype="<?php echo esc_attr( $type ); ?>" data-areaid="<?php echo esc_attr( $zone . '_' . $area[ 'areaid' ] ); ?>" data-context="<?php echo esc_attr( $zone ); ?>"><?php echo '+ ' . esc_html( $button_label ); ?></a>
907
+								<p class="gv-droppable-area-title"><strong><?php echo esc_html( $area[ 'title' ] ); ?></strong><?php if ( ! empty( $area[ 'subtitle' ] ) ) { ?><span class="gv-droppable-area-subtitle"> &ndash; <?php echo esc_html( $area[ 'subtitle' ] ); ?></span><?php } ?></p>
908 908
 							</div>
909 909
 						</div>
910 910
 
@@ -926,7 +926,7 @@  discard block
 block discarded – undo
926 926
 		$default_widget_areas = GravityView_Plugin::get_default_widget_areas();
927 927
 
928 928
 		$widgets = array();
929
-		if( !empty( $post_id ) ) {
929
+		if ( ! empty( $post_id ) ) {
930 930
 			$widgets = gravityview_get_directory_widgets( $post_id );
931 931
 		}
932 932
 
@@ -956,7 +956,7 @@  discard block
 block discarded – undo
956 956
 	 */
957 957
 	function render_directory_active_areas( $template_id = '', $context = 'single', $post_id = '', $echo = false ) {
958 958
 
959
-		if( empty( $template_id ) ) {
959
+		if ( empty( $template_id ) ) {
960 960
 			do_action( 'gravityview_log_debug', '[render_directory_active_areas] $template_id is empty' );
961 961
 			return '';
962 962
 		}
@@ -970,12 +970,12 @@  discard block
 block discarded – undo
970 970
 		 */
971 971
 		$template_areas = apply_filters( 'gravityview_template_active_areas', array(), $template_id, $context );
972 972
 
973
-		if( empty( $template_areas ) ) {
973
+		if ( empty( $template_areas ) ) {
974 974
 
975 975
 			do_action( 'gravityview_log_debug', '[render_directory_active_areas] No areas defined. Maybe template %s is disabled.', $template_id );
976 976
 			$output = '<div>';
977
-			$output .= '<h2 class="description" style="font-size: 16px; margin:0">'. sprintf( esc_html__( 'This View is configured using the %s View type, which is disabled.', 'gravityview' ), '<em>'.$template_id.'</em>' ) .'</h2>';
978
-			$output .= '<p class="description" style="font-size: 14px; margin:0 0 1em 0;padding:0">'.esc_html__('The data is not lost; re-activate the associated plugin and the configuration will re-appear.', 'gravityview').'</p>';
977
+			$output .= '<h2 class="description" style="font-size: 16px; margin:0">' . sprintf( esc_html__( 'This View is configured using the %s View type, which is disabled.', 'gravityview' ), '<em>' . $template_id . '</em>' ) . '</h2>';
978
+			$output .= '<p class="description" style="font-size: 14px; margin:0 0 1em 0;padding:0">' . esc_html__( 'The data is not lost; re-activate the associated plugin and the configuration will re-appear.', 'gravityview' ) . '</p>';
979 979
 			$output .= '</div>';
980 980
 		} else {
981 981
 
@@ -990,7 +990,7 @@  discard block
 block discarded – undo
990 990
 
991 991
 		}
992 992
 
993
-		if( $echo ) {
993
+		if ( $echo ) {
994 994
 			echo $output;
995 995
 		}
996 996
 
@@ -1010,26 +1010,26 @@  discard block
 block discarded – undo
1010 1010
 		$is_widgets_page = ( $pagenow === 'widgets.php' );
1011 1011
 
1012 1012
 		// Add the GV font (with the Astronaut)
1013
-		wp_enqueue_style( 'gravityview_global', plugins_url('assets/css/admin-global.css', GRAVITYVIEW_FILE), array(), GravityView_Plugin::version );
1013
+		wp_enqueue_style( 'gravityview_global', plugins_url( 'assets/css/admin-global.css', GRAVITYVIEW_FILE ), array(), GravityView_Plugin::version );
1014 1014
 
1015
-		wp_register_script( 'gravityview-jquery-cookie', plugins_url('assets/lib/jquery.cookie/jquery.cookie.min.js', GRAVITYVIEW_FILE), array( 'jquery' ), GravityView_Plugin::version, true );
1015
+		wp_register_script( 'gravityview-jquery-cookie', plugins_url( 'assets/lib/jquery.cookie/jquery.cookie.min.js', GRAVITYVIEW_FILE ), array( 'jquery' ), GravityView_Plugin::version, true );
1016 1016
 
1017 1017
 		// Don't process any scripts below here if it's not a GravityView page.
1018
-		if( ! gravityview_is_admin_page( $hook, 'single' ) && ! $is_widgets_page ) {
1018
+		if ( ! gravityview_is_admin_page( $hook, 'single' ) && ! $is_widgets_page ) {
1019 1019
 		    return;
1020 1020
 		}
1021 1021
 
1022 1022
         wp_enqueue_script( 'jquery-ui-datepicker' );
1023
-        wp_enqueue_style( 'gravityview_views_datepicker', plugins_url('assets/css/admin-datepicker.css', GRAVITYVIEW_FILE), GravityView_Plugin::version );
1023
+        wp_enqueue_style( 'gravityview_views_datepicker', plugins_url( 'assets/css/admin-datepicker.css', GRAVITYVIEW_FILE ), GravityView_Plugin::version );
1024 1024
 
1025
-        $script_debug = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';
1025
+        $script_debug = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
1026 1026
 
1027 1027
         //enqueue scripts
1028 1028
         wp_enqueue_script( 'gravityview_views_scripts', plugins_url( 'assets/js/admin-views' . $script_debug . '.js', GRAVITYVIEW_FILE ), array( 'jquery-ui-tabs', 'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-sortable', 'jquery-ui-tooltip', 'jquery-ui-dialog', 'gravityview-jquery-cookie', 'jquery-ui-datepicker', 'underscore' ), GravityView_Plugin::version );
1029 1029
 
1030
-        wp_localize_script('gravityview_views_scripts', 'gvGlobals', array(
1030
+        wp_localize_script( 'gravityview_views_scripts', 'gvGlobals', array(
1031 1031
             'cookiepath' => COOKIEPATH,
1032
-            'passed_form_id' => (bool) rgget( 'form_id' ),
1032
+            'passed_form_id' => (bool)rgget( 'form_id' ),
1033 1033
             'nonce' => wp_create_nonce( 'gravityview_ajaxviews' ),
1034 1034
             'label_viewname' => __( 'Enter View name here', 'gravityview' ),
1035 1035
             'label_close' => __( 'Close', 'gravityview' ),
@@ -1041,9 +1041,9 @@  discard block
 block discarded – undo
1041 1041
             'loading_error' => esc_html__( 'There was an error loading dynamic content.', 'gravityview' ),
1042 1042
             'field_loaderror' => __( 'Error while adding the field. Please try again or contact GravityView support.', 'gravityview' ),
1043 1043
             'remove_all_fields' => __( 'Would you like to remove all fields in this zone? (You are seeing this message because you were holding down the ALT key)', 'gravityview' ),
1044
-        ));
1044
+        ) );
1045 1045
 
1046
-        wp_enqueue_style( 'gravityview_views_styles', plugins_url( 'assets/css/admin-views.css', GRAVITYVIEW_FILE ), array('dashicons', 'wp-jquery-ui-dialog' ), GravityView_Plugin::version );
1046
+        wp_enqueue_style( 'gravityview_views_styles', plugins_url( 'assets/css/admin-views.css', GRAVITYVIEW_FILE ), array( 'dashicons', 'wp-jquery-ui-dialog' ), GravityView_Plugin::version );
1047 1047
 
1048 1048
         // Enqueue scripts needed for merge tags
1049 1049
         self::enqueue_gravity_forms_scripts();
@@ -1068,7 +1068,7 @@  discard block
 block discarded – undo
1068 1068
 		);
1069 1069
 
1070 1070
 		if ( wp_is_mobile() ) {
1071
-		    $scripts[] = 'jquery-touch-punch';
1071
+		    $scripts[ ] = 'jquery-touch-punch';
1072 1072
 		}
1073 1073
 
1074 1074
 		wp_enqueue_script( $scripts );
Please login to merge, or discard this patch.
includes/class-admin.php 1 patch
Spacing   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -4,10 +4,10 @@  discard block
 block discarded – undo
4 4
 
5 5
 	function __construct() {
6 6
 
7
-		if( ! is_admin() ) { return; }
7
+		if ( ! is_admin() ) { return; }
8 8
 
9 9
 		// If Gravity Forms isn't active or compatibile, stop loading
10
-		if( false === GravityView_Compatibility::is_valid() ) {
10
+		if ( false === GravityView_Compatibility::is_valid() ) {
11 11
 			return;
12 12
 		}
13 13
 
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 		add_filter( 'post_updated_messages', array( $this, 'post_updated_messages' ) );
49 49
 		add_filter( 'bulk_post_updated_messages', array( $this, 'post_updated_messages' ) );
50 50
 
51
-		add_filter( 'plugin_action_links_'. plugin_basename( GRAVITYVIEW_FILE ) , array( $this, 'plugin_action_links' ) );
51
+		add_filter( 'plugin_action_links_' . plugin_basename( GRAVITYVIEW_FILE ), array( $this, 'plugin_action_links' ) );
52 52
 
53 53
 		add_action( 'plugins_loaded', array( $this, 'backend_actions' ), 100 );
54 54
 
@@ -63,9 +63,9 @@  discard block
 block discarded – undo
63 63
 	 */
64 64
 	public static function no_views_text() {
65 65
 		
66
-		if ( isset( $_REQUEST['post_status'] ) && 'trash' === $_REQUEST['post_status'] ) {
66
+		if ( isset( $_REQUEST[ 'post_status' ] ) && 'trash' === $_REQUEST[ 'post_status' ] ) {
67 67
 			return __( 'No Views found in Trash', 'gravityview' );
68
-		} elseif( ! empty( $_GET['s'] ) ) {
68
+		} elseif ( ! empty( $_GET[ 's' ] ) ) {
69 69
 			return __( 'No Views found.', 'gravityview' );
70 70
 		}
71 71
 
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 			$error .= ' ' . esc_html__( 'or select another form.', 'gravityview' );
110 110
 		}
111 111
 
112
-		if( $error ) {
112
+		if ( $error ) {
113 113
 			?>
114 114
 			<div class="wp-dialog notice-warning inline error wp-clearfix">
115 115
 				<?php echo gravityview_get_floaty(); ?>
@@ -128,22 +128,22 @@  discard block
 block discarded – undo
128 128
 	public function backend_actions() {
129 129
 
130 130
 		/** @define "GRAVITYVIEW_DIR" "../" */
131
-		include_once( GRAVITYVIEW_DIR .'includes/admin/class.field.type.php' );
132
-		include_once( GRAVITYVIEW_DIR .'includes/admin/class.render.settings.php' );
133
-		include_once( GRAVITYVIEW_DIR .'includes/admin/class-gravityview-admin-view-item.php' );
134
-		include_once( GRAVITYVIEW_DIR .'includes/admin/class-gravityview-admin-view-field.php' );
135
-		include_once( GRAVITYVIEW_DIR .'includes/admin/class-gravityview-admin-view-widget.php' );
136
-		include_once( GRAVITYVIEW_DIR .'includes/class-admin-views.php' );
137
-		include_once( GRAVITYVIEW_DIR .'includes/class-admin-welcome.php' );
138
-		include_once( GRAVITYVIEW_DIR .'includes/class-admin-add-shortcode.php' );
139
-		include_once( GRAVITYVIEW_DIR .'includes/class-admin-approve-entries.php' );
131
+		include_once( GRAVITYVIEW_DIR . 'includes/admin/class.field.type.php' );
132
+		include_once( GRAVITYVIEW_DIR . 'includes/admin/class.render.settings.php' );
133
+		include_once( GRAVITYVIEW_DIR . 'includes/admin/class-gravityview-admin-view-item.php' );
134
+		include_once( GRAVITYVIEW_DIR . 'includes/admin/class-gravityview-admin-view-field.php' );
135
+		include_once( GRAVITYVIEW_DIR . 'includes/admin/class-gravityview-admin-view-widget.php' );
136
+		include_once( GRAVITYVIEW_DIR . 'includes/class-admin-views.php' );
137
+		include_once( GRAVITYVIEW_DIR . 'includes/class-admin-welcome.php' );
138
+		include_once( GRAVITYVIEW_DIR . 'includes/class-admin-add-shortcode.php' );
139
+		include_once( GRAVITYVIEW_DIR . 'includes/class-admin-approve-entries.php' );
140 140
 
141 141
 		/**
142 142
 		 * @action `gravityview_include_backend_actions` Triggered after all GravityView admin files are loaded
143 143
 		 *
144 144
 		 * Nice place to insert extensions' backend stuff
145 145
 		 */
146
-		do_action('gravityview_include_backend_actions');
146
+		do_action( 'gravityview_include_backend_actions' );
147 147
 	}
148 148
 
149 149
 	/**
@@ -159,12 +159,12 @@  discard block
 block discarded – undo
159 159
 
160 160
 		$actions = array();
161 161
 
162
-		if( GVCommon::has_cap( 'gravityview_view_settings' ) ) {
163
-			$actions[] = sprintf( '<a href="%s">%s</a>', admin_url( 'edit.php?post_type=gravityview&page=gravityview_settings' ), esc_html__( 'Settings', 'gravityview' ) );
162
+		if ( GVCommon::has_cap( 'gravityview_view_settings' ) ) {
163
+			$actions[ ] = sprintf( '<a href="%s">%s</a>', admin_url( 'edit.php?post_type=gravityview&page=gravityview_settings' ), esc_html__( 'Settings', 'gravityview' ) );
164 164
 		}
165 165
 
166
-		if( GVCommon::has_cap( 'gravityview_support_port' ) ) {
167
-			$actions[] = '<a href="http://docs.gravityview.co">' . esc_html__( 'Support', 'gravityview' ) . '</a>';
166
+		if ( GVCommon::has_cap( 'gravityview_support_port' ) ) {
167
+			$actions[ ] = '<a href="http://docs.gravityview.co">' . esc_html__( 'Support', 'gravityview' ) . '</a>';
168 168
 		}
169 169
 
170 170
 		return array_merge( $actions, $links );
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 		// By default, there will only be one item being modified.
193 193
 		// When in the `bulk_post_updated_messages` filter, there will be passed a number
194 194
 		// of modified items that will override this array.
195
-		$bulk_counts = is_null( $bulk_counts ) ? array( 'updated' => 1 , 'locked' => 1 , 'deleted' => 1 , 'trashed' => 1, 'untrashed' => 1 ) : $bulk_counts;
195
+		$bulk_counts = is_null( $bulk_counts ) ? array( 'updated' => 1, 'locked' => 1, 'deleted' => 1, 'trashed' => 1, 'untrashed' => 1 ) : $bulk_counts;
196 196
 
197 197
 		// If we're starting fresh, a new form was created.
198 198
 		// We should let the user know this is the case.
@@ -200,60 +200,60 @@  discard block
 block discarded – undo
200 200
 
201 201
 		$new_form_text = '';
202 202
 
203
-		if( !empty( $start_fresh ) ) {
203
+		if ( ! empty( $start_fresh ) ) {
204 204
 
205 205
 			// Get the form that was created
206 206
 			$connected_form = gravityview_get_form_id( $post_id );
207 207
 
208
-			if( !empty( $connected_form ) ) {
208
+			if ( ! empty( $connected_form ) ) {
209 209
 				$form = gravityview_get_form( $connected_form );
210
-				$form_name = esc_attr( $form['title'] );
210
+				$form_name = esc_attr( $form[ 'title' ] );
211 211
 				$image = self::get_floaty();
212
-				$new_form_text .= '<h3>'.$image.sprintf( __( 'A new form was created for this View: "%s"', 'gravityview' ), $form_name ).'</h3>';
213
-				$new_form_text .=  sprintf( __( '%sThere are no entries for the new form, so the View will also be empty.%s To start collecting entries, you can add submissions through %sthe preview form%s and also embed the form on a post or page using this code: %s
212
+				$new_form_text .= '<h3>' . $image . sprintf( __( 'A new form was created for this View: "%s"', 'gravityview' ), $form_name ) . '</h3>';
213
+				$new_form_text .= sprintf( __( '%sThere are no entries for the new form, so the View will also be empty.%s To start collecting entries, you can add submissions through %sthe preview form%s and also embed the form on a post or page using this code: %s
214 214
 
215 215
 					You can %sedit the form%s in Gravity Forms and the updated fields will be available here. Don&rsquo;t forget to %scustomize the form settings%s.
216
-					', 'gravityview' ), '<strong>', '</strong>', '<a href="'.site_url( '?gf_page=preview&amp;id='.$connected_form ).'">', '</a>', '<code>[gravityform id="'.$connected_form.'" name="'.$form_name.'"]</code>', '<a href="'.admin_url( 'admin.php?page=gf_edit_forms&amp;id='.$connected_form ).'">', '</a>', '<a href="'.admin_url( 'admin.php?page=gf_edit_forms&amp;view=settings&amp;id='.$connected_form ).'">', '</a>');
216
+					', 'gravityview' ), '<strong>', '</strong>', '<a href="' . site_url( '?gf_page=preview&amp;id=' . $connected_form ) . '">', '</a>', '<code>[gravityform id="' . $connected_form . '" name="' . $form_name . '"]</code>', '<a href="' . admin_url( 'admin.php?page=gf_edit_forms&amp;id=' . $connected_form ) . '">', '</a>', '<a href="' . admin_url( 'admin.php?page=gf_edit_forms&amp;view=settings&amp;id=' . $connected_form ) . '">', '</a>' );
217 217
 				$new_form_text = wpautop( $new_form_text );
218 218
 
219 219
 				delete_post_meta( $post_id, '_gravityview_start_fresh' );
220 220
 			}
221 221
 		}
222 222
 
223
-		$messages['gravityview'] = array(
223
+		$messages[ 'gravityview' ] = array(
224 224
 			0  => '', // Unused. Messages start at index 1.
225 225
 			/* translators: %s and %s are HTML tags linking to the View on the website */
226
-			1  => sprintf(__( 'View updated. %sView on website.%s', 'gravityview' ), '<a href="'.get_permalink( $post_id ).'">', '</a>'),
226
+			1  => sprintf( __( 'View updated. %sView on website.%s', 'gravityview' ), '<a href="' . get_permalink( $post_id ) . '">', '</a>' ),
227 227
 			/* translators: %s and %s are HTML tags linking to the View on the website */
228
-			2  => sprintf(__( 'View updated. %sView on website.%s', 'gravityview' ), '<a href="'.get_permalink( $post_id ).'">', '</a>'),
228
+			2  => sprintf( __( 'View updated. %sView on website.%s', 'gravityview' ), '<a href="' . get_permalink( $post_id ) . '">', '</a>' ),
229 229
 			3  => __( 'View deleted.', 'gravityview' ),
230 230
 			/* translators: %s and %s are HTML tags linking to the View on the website */
231
-			4  => sprintf(__( 'View updated. %sView on website.%s', 'gravityview' ), '<a href="'.get_permalink( $post_id ).'">', '</a>'),
231
+			4  => sprintf( __( 'View updated. %sView on website.%s', 'gravityview' ), '<a href="' . get_permalink( $post_id ) . '">', '</a>' ),
232 232
 			/* translators: %s: date and time of the revision */
233
-			5  => isset( $_GET['revision'] ) ? sprintf( __( 'View restored to revision from %s', 'gravityview' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
233
+			5  => isset( $_GET[ 'revision' ] ) ? sprintf( __( 'View restored to revision from %s', 'gravityview' ), wp_post_revision_title( (int)$_GET[ 'revision' ], false ) ) : false,
234 234
 			/* translators: %s and %s are HTML tags linking to the View on the website */
235
-			6  => sprintf(__( 'View published. %sView on website.%s', 'gravityview' ), '<a href="'.get_permalink( $post_id ).'">', '</a>') . $new_form_text,
235
+			6  => sprintf( __( 'View published. %sView on website.%s', 'gravityview' ), '<a href="' . get_permalink( $post_id ) . '">', '</a>' ) . $new_form_text,
236 236
 			/* translators: %s and %s are HTML tags linking to the View on the website */
237
-			7  => sprintf(__( 'View saved. %sView on website.%s', 'gravityview' ), '<a href="'.get_permalink( $post_id ).'">', '</a>') . $new_form_text,
237
+			7  => sprintf( __( 'View saved. %sView on website.%s', 'gravityview' ), '<a href="' . get_permalink( $post_id ) . '">', '</a>' ) . $new_form_text,
238 238
 			8  => __( 'View submitted.', 'gravityview' ),
239 239
 			9  => sprintf(
240 240
 		        /* translators: Date and time the View is scheduled to be published */
241 241
 				__( 'View scheduled for: %1$s.', 'gravityview' ),
242 242
 				// translators: Publish box date format, see http://php.net/date
243
-				date_i18n( __( 'M j, Y @ G:i', 'gravityview' ), strtotime( ( isset( $post->post_date ) ? $post->post_date : NULL )  ) )
243
+				date_i18n( __( 'M j, Y @ G:i', 'gravityview' ), strtotime( ( isset( $post->post_date ) ? $post->post_date : NULL ) ) )
244 244
 			) . $new_form_text,
245 245
 			/* translators: %s and %s are HTML tags linking to the View on the website */
246
-			10  => sprintf(__( 'View draft updated. %sView on website.%s', 'gravityview' ), '<a href="'.get_permalink( $post_id ).'">', '</a>') . $new_form_text,
246
+			10  => sprintf( __( 'View draft updated. %sView on website.%s', 'gravityview' ), '<a href="' . get_permalink( $post_id ) . '">', '</a>' ) . $new_form_text,
247 247
 
248 248
 			/**
249 249
 			 * These apply to `bulk_post_updated_messages`
250 250
 			 * @file wp-admin/edit.php
251 251
 			 */
252
-			'updated'   => _n( '%s View updated.', '%s Views updated.', $bulk_counts['updated'], 'gravityview' ),
253
-			'locked'    => _n( '%s View not updated, somebody is editing it.', '%s Views not updated, somebody is editing them.', $bulk_counts['locked'], 'gravityview' ),
254
-			'deleted'   => _n( '%s View permanently deleted.', '%s Views permanently deleted.', $bulk_counts['deleted'], 'gravityview' ),
255
-			'trashed'   => _n( '%s View moved to the Trash.', '%s Views moved to the Trash.', $bulk_counts['trashed'], 'gravityview' ),
256
-			'untrashed' => _n( '%s View restored from the Trash.', '%s Views restored from the Trash.', $bulk_counts['untrashed'], 'gravityview' ),
252
+			'updated'   => _n( '%s View updated.', '%s Views updated.', $bulk_counts[ 'updated' ], 'gravityview' ),
253
+			'locked'    => _n( '%s View not updated, somebody is editing it.', '%s Views not updated, somebody is editing them.', $bulk_counts[ 'locked' ], 'gravityview' ),
254
+			'deleted'   => _n( '%s View permanently deleted.', '%s Views permanently deleted.', $bulk_counts[ 'deleted' ], 'gravityview' ),
255
+			'trashed'   => _n( '%s View moved to the Trash.', '%s Views moved to the Trash.', $bulk_counts[ 'trashed' ], 'gravityview' ),
256
+			'untrashed' => _n( '%s View restored from the Trash.', '%s Views restored from the Trash.', $bulk_counts[ 'untrashed' ], 'gravityview' ),
257 257
 		);
258 258
 
259 259
 		return $messages;
@@ -313,29 +313,29 @@  discard block
 block discarded – undo
313 313
 	static function is_admin_page( $hook = '', $page = NULL ) {
314 314
 		global $current_screen, $plugin_page, $pagenow, $post;
315 315
 
316
-		if( ! is_admin() ) { return false; }
316
+		if ( ! is_admin() ) { return false; }
317 317
 
318 318
 		$is_page = false;
319 319
 
320
-		$is_gv_screen = (!empty($current_screen) && isset($current_screen->post_type) && $current_screen->post_type === 'gravityview');
320
+		$is_gv_screen = ( ! empty( $current_screen ) && isset( $current_screen->post_type ) && $current_screen->post_type === 'gravityview' );
321 321
 
322
-		$is_gv_post_type_get = (isset($_GET['post_type']) && $_GET['post_type'] === 'gravityview');
322
+		$is_gv_post_type_get = ( isset( $_GET[ 'post_type' ] ) && $_GET[ 'post_type' ] === 'gravityview' );
323 323
 
324
-		$is_gv_settings_get = isset( $_GET['page'] ) && $_GET['page'] === 'gravityview_settings';
324
+		$is_gv_settings_get = isset( $_GET[ 'page' ] ) && $_GET[ 'page' ] === 'gravityview_settings';
325 325
 
326
-		if( empty( $post ) && $pagenow === 'post.php' && !empty( $_GET['post'] ) ) {
327
-			$gv_post = get_post( intval( $_GET['post'] ) );
328
-			$is_gv_post_type = (!empty($gv_post) && !empty($gv_post->post_type) && $gv_post->post_type === 'gravityview');
326
+		if ( empty( $post ) && $pagenow === 'post.php' && ! empty( $_GET[ 'post' ] ) ) {
327
+			$gv_post = get_post( intval( $_GET[ 'post' ] ) );
328
+			$is_gv_post_type = ( ! empty( $gv_post ) && ! empty( $gv_post->post_type ) && $gv_post->post_type === 'gravityview' );
329 329
 		} else {
330
-			$is_gv_post_type = (!empty($post) && !empty($post->post_type) && $post->post_type === 'gravityview');
330
+			$is_gv_post_type = ( ! empty( $post ) && ! empty( $post->post_type ) && $post->post_type === 'gravityview' );
331 331
 		}
332 332
 
333
-		if( $is_gv_screen || $is_gv_post_type || $is_gv_post_type || $is_gv_post_type_get || $is_gv_settings_get ) {
333
+		if ( $is_gv_screen || $is_gv_post_type || $is_gv_post_type || $is_gv_post_type_get || $is_gv_settings_get ) {
334 334
 
335 335
 			// $_GET `post_type` variable
336
-			if(in_array($pagenow, array( 'post.php' , 'post-new.php' )) ) {
336
+			if ( in_array( $pagenow, array( 'post.php', 'post-new.php' ) ) ) {
337 337
 				$is_page = 'single';
338
-			} else if ( in_array( $plugin_page, array( 'gravityview_settings', 'gravityview_page_gravityview_settings' ) ) || ( !empty( $_GET['page'] ) && $_GET['page'] === 'gravityview_settings' ) ) {
338
+			} else if ( in_array( $plugin_page, array( 'gravityview_settings', 'gravityview_page_gravityview_settings' ) ) || ( ! empty( $_GET[ 'page' ] ) && $_GET[ 'page' ] === 'gravityview_settings' ) ) {
339 339
 				$is_page = 'settings';
340 340
 			} else {
341 341
 				$is_page = 'views';
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
 		$is_page = apply_filters( 'gravityview_is_admin_page', $is_page, $hook );
351 351
 
352 352
 		// If the current page is the same as the compared page
353
-		if( !empty( $page ) ) {
353
+		if ( ! empty( $page ) ) {
354 354
 			return $is_page === $page;
355 355
 		}
356 356
 
@@ -371,6 +371,6 @@  discard block
 block discarded – undo
371 371
  *
372 372
  * @return bool|string If `false`, not a GravityView page. `true` if $page is passed and is the same as current page. Otherwise, the name of the page (`single`, `settings`, or `views`)
373 373
  */
374
-function gravityview_is_admin_page($hook = '', $page = NULL) {
374
+function gravityview_is_admin_page( $hook = '', $page = NULL ) {
375 375
 	return GravityView_Admin::is_admin_page( $hook, $page );
376 376
 }
Please login to merge, or discard this patch.
includes/class-gravityview-settings.php 1 patch
Spacing   +89 added lines, -89 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if( ! class_exists('GFAddOn') ) {
3
+if ( ! class_exists( 'GFAddOn' ) ) {
4 4
 	return;
5 5
 }
6 6
 
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 	 */
76 76
 	public function __construct( $prevent_multiple_instances = '' ) {
77 77
 
78
-		if( $prevent_multiple_instances === 'get_instance' ) {
78
+		if ( $prevent_multiple_instances === 'get_instance' ) {
79 79
 			return parent::__construct();
80 80
 		}
81 81
 
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 	 */
88 88
 	public static function get_instance() {
89 89
 
90
-		if( empty( self::$instance ) ) {
90
+		if ( empty( self::$instance ) ) {
91 91
 			self::$instance = new self( 'get_instance' );
92 92
 		}
93 93
 
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 	 */
107 107
 	public function current_user_can_any( $caps ) {
108 108
 
109
-		if( empty( $caps ) ) {
109
+		if ( empty( $caps ) ) {
110 110
 			$caps = array( 'gravityview_full_access' );
111 111
 		}
112 112
 
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
             ),
168 168
 			'found-other' => array(
169 169
                 'label' => esc_html__( 'I found a better plugin', 'gravityview' ),
170
-                'followup' => esc_attr__('What plugin you are using, and why?', 'gravityview'),
170
+                'followup' => esc_attr__( 'What plugin you are using, and why?', 'gravityview' ),
171 171
             ),
172 172
 			'other' => array(
173 173
                 'label' => esc_html__( 'Other', 'gravityview' ),
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
                 });
255 255
 
256 256
                 function gv_feedback_append_error_message() {
257
-                    $('#gv-uninstall-thanks').append('<div class="notice error"><?php echo esc_js( __('There was an error sharing your feedback. Sorry! Please email us at [email protected]', 'gravityview' ) ) ?></div>');
257
+                    $('#gv-uninstall-thanks').append('<div class="notice error"><?php echo esc_js( __( 'There was an error sharing your feedback. Sorry! Please email us at [email protected]', 'gravityview' ) ) ?></div>');
258 258
                 }
259 259
             });
260 260
         </script>
@@ -271,15 +271,15 @@  discard block
 block discarded – undo
271 271
             </ul>
272 272
             <div class="gv-followup widefat">
273 273
                 <p><strong><label for="gv-reason-details"><?php esc_html_e( 'Comments', 'gravityview' ); ?></label></strong></p>
274
-                <textarea id="gv-reason-details" name="reason_details" data-default="<?php esc_attr_e('Please share your thoughts about GravityView', 'gravityview') ?>" placeholder="<?php esc_attr_e('Please share your thoughts about GravityView', 'gravityview'); ?>" class="large-text"></textarea>
274
+                <textarea id="gv-reason-details" name="reason_details" data-default="<?php esc_attr_e( 'Please share your thoughts about GravityView', 'gravityview' ) ?>" placeholder="<?php esc_attr_e( 'Please share your thoughts about GravityView', 'gravityview' ); ?>" class="large-text"></textarea>
275 275
             </div>
276 276
             <div class="scale-description">
277
-                <p><strong><?php esc_html_e('How likely are you to recommend GravityView?', 'gravityview' ); ?></strong></p>
277
+                <p><strong><?php esc_html_e( 'How likely are you to recommend GravityView?', 'gravityview' ); ?></strong></p>
278 278
                 <ul class="inline">
279 279
 					<?php
280 280
 					$i = 0;
281
-					while( $i < 11 ) {
282
-						echo '<li class="inline number-scale"><label><input name="likely_to_refer" id="likely_to_refer_'.$i.'" value="'.$i.'" type="radio"> '.$i.'</label></li>';
281
+					while ( $i < 11 ) {
282
+						echo '<li class="inline number-scale"><label><input name="likely_to_refer" id="likely_to_refer_' . $i . '" value="' . $i . '" type="radio"> ' . $i . '</label></li>';
283 283
 						$i++;
284 284
 					}
285 285
 					?>
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
             </div>
289 289
 
290 290
             <div class="gv-form-field-wrapper">
291
-                <label><input type="checkbox" class="checkbox" name="follow_up_with_me" value="1" /> <?php esc_html_e('Please follow up with me about my feedback', 'gravityview'); ?></label>
291
+                <label><input type="checkbox" class="checkbox" name="follow_up_with_me" value="1" /> <?php esc_html_e( 'Please follow up with me about my feedback', 'gravityview' ); ?></label>
292 292
             </div>
293 293
 
294 294
             <div class="submit">
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
         <div id="gv-uninstall-thanks" class="notice notice-large notice-updated below-h2" style="display:none;">
303 303
             <h3 class="notice-title"><?php esc_html_e( 'Thank you for using GravityView!', 'gravityview' ); ?></h3>
304 304
             <p><?php echo gravityview_get_floaty(); ?>
305
-				<?php echo make_clickable( esc_html__('Your feedback helps us improve GravityView. If you have any questions or comments, email us: [email protected]', 'gravityview' ) ); ?>
305
+				<?php echo make_clickable( esc_html__( 'Your feedback helps us improve GravityView. If you have any questions or comments, email us: [email protected]', 'gravityview' ) ); ?>
306 306
             </p>
307 307
             <div class="wp-clearfix"></div>
308 308
         </div>
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
 		add_filter( 'gform_addon_app_settings_menu_gravityview', array( $this, 'modify_app_settings_menu_title' ) );
377 377
 
378 378
 		/** @since 1.7.6 */
379
-		add_action('network_admin_menu', array( $this, 'add_network_menu' ) );
379
+		add_action( 'network_admin_menu', array( $this, 'add_network_menu' ) );
380 380
 
381 381
 		parent::init_admin();
382 382
 	}
@@ -390,7 +390,7 @@  discard block
 block discarded – undo
390 390
 	 */
391 391
 	public function modify_app_settings_menu_title( $setting_tabs ) {
392 392
 
393
-		$setting_tabs[0]['label'] = __( 'GravityView Settings', 'gravityview');
393
+		$setting_tabs[ 0 ][ 'label' ] = __( 'GravityView Settings', 'gravityview' );
394 394
 
395 395
 		return $setting_tabs;
396 396
 	}
@@ -407,11 +407,11 @@  discard block
 block discarded – undo
407 407
 	 */
408 408
 	private function _load_license_handler() {
409 409
 
410
-		if( !empty( $this->License_Handler ) ) {
410
+		if ( ! empty( $this->License_Handler ) ) {
411 411
 			return;
412 412
 		}
413 413
 
414
-		require_once( GRAVITYVIEW_DIR . 'includes/class-gv-license-handler.php');
414
+		require_once( GRAVITYVIEW_DIR . 'includes/class-gv-license-handler.php' );
415 415
 
416 416
 		$this->License_Handler = GV_License_Handler::get_instance( $this );
417 417
 	}
@@ -423,42 +423,42 @@  discard block
 block discarded – undo
423 423
 	function license_key_notice() {
424 424
 
425 425
 		// Only show on GravityView pages
426
-		if( ! gravityview_is_admin_page() ) {
426
+		if ( ! gravityview_is_admin_page() ) {
427 427
 			return;
428 428
 		}
429 429
 
430
-		$license_status = self::getSetting('license_key_status');
431
-		$license_key = self::getSetting('license_key');
432
-		if( '' === $license_key ) {
430
+		$license_status = self::getSetting( 'license_key_status' );
431
+		$license_key = self::getSetting( 'license_key' );
432
+		if ( '' === $license_key ) {
433 433
 			$license_status = 'inactive';
434 434
         }
435 435
 		$license_id = empty( $license_key ) ? 'license' : $license_key;
436 436
 
437
-		$message = esc_html__('Your GravityView license %s. This means you&rsquo;re missing out on updates and support! %sActivate your license%s or %sget a license here%s.', 'gravityview');
437
+		$message = esc_html__( 'Your GravityView license %s. This means you&rsquo;re missing out on updates and support! %sActivate your license%s or %sget a license here%s.', 'gravityview' );
438 438
 
439 439
 		/**
440 440
 		 * I wanted to remove the period from after the buttons in the string,
441 441
 		 * but didn't want to mess up the translation strings for the translators.
442 442
 		 */
443 443
 		$message = mb_substr( $message, 0, mb_strlen( $message ) - 1 );
444
-		$title = __('Inactive License', 'gravityview');
444
+		$title = __( 'Inactive License', 'gravityview' );
445 445
 		$status = '';
446 446
 		$update_below = false;
447 447
 		$primary_button_link = admin_url( 'edit.php?post_type=gravityview&amp;page=gravityview_settings' );
448 448
 		switch ( $license_status ) {
449 449
 			/** @since 1.17 */
450 450
 			case 'expired':
451
-				$title = __('Expired License', 'gravityview');
451
+				$title = __( 'Expired License', 'gravityview' );
452 452
 				$status = 'expired';
453
-				$message = $this->get_license_handler()->strings( 'expired', self::getSetting('license_key_response') );
453
+				$message = $this->get_license_handler()->strings( 'expired', self::getSetting( 'license_key_response' ) );
454 454
 				break;
455 455
 			case 'invalid':
456
-				$title = __('Invalid License', 'gravityview');
457
-				$status = __('is invalid', 'gravityview');
456
+				$title = __( 'Invalid License', 'gravityview' );
457
+				$status = __( 'is invalid', 'gravityview' );
458 458
 				break;
459 459
 			case 'deactivated':
460
-				$status = __('is inactive', 'gravityview');
461
-				$update_below = __('Activate your license key below.', 'gravityview');
460
+				$status = __( 'is inactive', 'gravityview' );
461
+				$update_below = __( 'Activate your license key below.', 'gravityview' );
462 462
 				break;
463 463
 			/** @noinspection PhpMissingBreakStatementInspection */
464 464
 			case '':
@@ -466,27 +466,27 @@  discard block
 block discarded – undo
466 466
 				// break intentionally left blank
467 467
 			case 'inactive':
468 468
 			case 'site_inactive':
469
-				$status = __('has not been activated', 'gravityview');
470
-				$update_below = __('Activate your license key below.', 'gravityview');
469
+				$status = __( 'has not been activated', 'gravityview' );
470
+				$update_below = __( 'Activate your license key below.', 'gravityview' );
471 471
 				break;
472 472
 		}
473
-		$url = 'https://gravityview.co/pricing/?utm_source=admin_notice&utm_medium=admin&utm_content='.$license_status.'&utm_campaign=Admin%20Notice';
473
+		$url = 'https://gravityview.co/pricing/?utm_source=admin_notice&utm_medium=admin&utm_content=' . $license_status . '&utm_campaign=Admin%20Notice';
474 474
 
475 475
 		// Show a different notice on settings page for inactive licenses (hide the buttons)
476
-		if( $update_below && gravityview_is_admin_page( '', 'settings' ) ) {
476
+		if ( $update_below && gravityview_is_admin_page( '', 'settings' ) ) {
477 477
 			$message = sprintf( $message, $status, '<div class="hidden">', '', '', '</div><a href="#" onclick="jQuery(\'#license_key\').focus(); return false;">' . $update_below . '</a>' );
478 478
 		} else {
479 479
 			$message = sprintf( $message, $status, "\n\n" . '<a href="' . esc_url( $primary_button_link ) . '" class="button button-primary">', '</a>', '<a href="' . esc_url( $url ) . '" class="button button-secondary">', '</a>' );
480 480
 		}
481 481
 
482
-		if( !empty( $status ) ) {
482
+		if ( ! empty( $status ) ) {
483 483
 			GravityView_Admin_Notices::add_notice( array(
484 484
 				'message' => $message,
485 485
 				'class'	=> 'updated',
486 486
 				'title' => $title,
487 487
 				'cap' => 'gravityview_edit_settings',
488
-				'dismiss' => sha1( $license_status.'_'.$license_id ),
489
-			));
488
+				'dismiss' => sha1( $license_status . '_' . $license_id ),
489
+			) );
490 490
 		}
491 491
 	}
492 492
 
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
 	public function scripts() {
503 503
 		$scripts = parent::scripts();
504 504
 
505
-		$scripts[] = array(
505
+		$scripts[ ] = array(
506 506
 			'handle'  => 'gform_tooltip_init',
507 507
 			'enqueue' => array(
508 508
                 array(
@@ -522,7 +522,7 @@  discard block
 block discarded – undo
522 522
 
523 523
 		$styles = parent::styles();
524 524
 
525
-		$styles[] = array(
525
+		$styles[ ] = array(
526 526
 			'handle'  => 'gravityview_settings',
527 527
 			'src'     => plugins_url( 'assets/css/admin-settings.css', GRAVITYVIEW_FILE ),
528 528
 			'version' => GravityView_Plugin::version,
@@ -547,7 +547,7 @@  discard block
 block discarded – undo
547 547
 	 * @return void
548 548
 	 */
549 549
 	public function add_network_menu() {
550
-		if( GravityView_Plugin::is_network_activated() ) {
550
+		if ( GravityView_Plugin::is_network_activated() ) {
551 551
 			add_menu_page( __( 'Settings', 'gravityview' ), __( 'GravityView', 'gravityview' ), $this->_capabilities_app_settings, "{$this->_slug}_settings", array( $this, 'app_tab_page' ), 'none' );
552 552
 		}
553 553
 	}
@@ -564,7 +564,7 @@  discard block
 block discarded – undo
564 564
 		 * If multisite and not network admin, we don't want the settings to show.
565 565
 		 * @since 1.7.6
566 566
 		 */
567
-		$show_submenu = !is_multisite() ||  is_main_site() || !GravityView_Plugin::is_network_activated() || ( is_network_admin() && GravityView_Plugin::is_network_activated() );
567
+		$show_submenu = ! is_multisite() || is_main_site() || ! GravityView_Plugin::is_network_activated() || ( is_network_admin() && GravityView_Plugin::is_network_activated() );
568 568
 
569 569
 		/**
570 570
 		 * Override whether to show the Settings menu on a per-blog basis.
@@ -573,7 +573,7 @@  discard block
 block discarded – undo
573 573
 		 */
574 574
 		$show_submenu = apply_filters( 'gravityview/show-settings-menu', $show_submenu );
575 575
 
576
-		if( $show_submenu ) {
576
+		if ( $show_submenu ) {
577 577
 			add_submenu_page( 'edit.php?post_type=gravityview', __( 'Settings', 'gravityview' ), __( 'Settings', 'gravityview' ), $this->_capabilities_app_settings, $this->_slug . '_settings', array( $this, 'app_tab_page' ) );
578 578
 		}
579 579
 	}
@@ -612,7 +612,7 @@  discard block
 block discarded – undo
612 612
 		/**
613 613
 		 * Backward compatibility with Redux
614 614
 		 */
615
-		if( $setting_name === 'license' ) {
615
+		if ( $setting_name === 'license' ) {
616 616
 			return array(
617 617
 				'license' => parent::get_app_setting( 'license_key' ),
618 618
 				'status' => parent::get_app_setting( 'license_key_status' ),
@@ -676,7 +676,7 @@  discard block
 block discarded – undo
676 676
 
677 677
 		$return = $text . $activation;
678 678
 
679
-		if( $echo ) {
679
+		if ( $echo ) {
680 680
 			echo $return;
681 681
 		}
682 682
 
@@ -703,15 +703,15 @@  discard block
 block discarded – undo
703 703
 	 */
704 704
 	public function settings_submit( $field, $echo = true ) {
705 705
 
706
-		$field['type']  = ( isset($field['type']) && in_array( $field['type'], array('submit','reset','button') ) ) ? $field['type'] : 'submit';
706
+		$field[ 'type' ] = ( isset( $field[ 'type' ] ) && in_array( $field[ 'type' ], array( 'submit', 'reset', 'button' ) ) ) ? $field[ 'type' ] : 'submit';
707 707
 
708 708
 		$attributes    = $this->get_field_attributes( $field );
709 709
 		$default_value = rgar( $field, 'value' ) ? rgar( $field, 'value' ) : rgar( $field, 'default_value' );
710
-		$value         = $this->get_setting( $field['name'], $default_value );
710
+		$value         = $this->get_setting( $field[ 'name' ], $default_value );
711 711
 
712 712
 
713
-		$attributes['class'] = isset( $attributes['class'] ) ? esc_attr( $attributes['class'] ) : 'button-primary gfbutton';
714
-		$name    = ( $field['name'] === 'gform-settings-save' ) ? $field['name'] : '_gaddon_setting_'.$field['name'];
713
+		$attributes[ 'class' ] = isset( $attributes[ 'class' ] ) ? esc_attr( $attributes[ 'class' ] ) : 'button-primary gfbutton';
714
+		$name = ( $field[ 'name' ] === 'gform-settings-save' ) ? $field[ 'name' ] : '_gaddon_setting_' . $field[ 'name' ];
715 715
 
716 716
 		if ( empty( $value ) ) {
717 717
 			$value = __( 'Update Settings', 'gravityview' );
@@ -720,7 +720,7 @@  discard block
 block discarded – undo
720 720
 		$attributes = $this->get_field_attributes( $field );
721 721
 
722 722
 		$html = '<input
723
-                    type="' . $field['type'] . '"
723
+                    type="' . $field[ 'type' ] . '"
724 724
                     name="' . esc_attr( $name ) . '"
725 725
                     value="' . $value . '" ' .
726 726
 		        implode( ' ', $attributes ) .
@@ -742,12 +742,12 @@  discard block
 block discarded – undo
742 742
 	 * @return string
743 743
 	 */
744 744
 	public function settings_save( $field, $echo = true ) {
745
-		$field['type']  = 'submit';
746
-		$field['name']  = 'gform-settings-save';
747
-		$field['class'] = isset( $field['class'] ) ? $field['class'] : 'button-primary gfbutton';
745
+		$field[ 'type' ]  = 'submit';
746
+		$field[ 'name' ]  = 'gform-settings-save';
747
+		$field[ 'class' ] = isset( $field[ 'class' ] ) ? $field[ 'class' ] : 'button-primary gfbutton';
748 748
 
749 749
 		if ( ! rgar( $field, 'value' ) ) {
750
-			$field['value'] = __( 'Update Settings', 'gravityview' );
750
+			$field[ 'value' ] = __( 'Update Settings', 'gravityview' );
751 751
 		}
752 752
 
753 753
 		$output = $this->settings_submit( $field, false );
@@ -756,7 +756,7 @@  discard block
 block discarded – undo
756 756
 		$this->app_settings_uninstall_tab();
757 757
 		$output .= ob_get_clean();
758 758
 
759
-		if( $echo ) {
759
+		if ( $echo ) {
760 760
 			echo $output;
761 761
 		}
762 762
 
@@ -774,8 +774,8 @@  discard block
 block discarded – undo
774 774
 		parent::single_setting_label( $field );
775 775
 
776 776
 		// Added by GravityView
777
-		if ( isset( $field['description'] ) ) {
778
-			echo '<span class="description">'. $field['description'] .'</span>';
777
+		if ( isset( $field[ 'description' ] ) ) {
778
+			echo '<span class="description">' . $field[ 'description' ] . '</span>';
779 779
 		}
780 780
 
781 781
 	}
@@ -838,11 +838,11 @@  discard block
 block discarded – undo
838 838
 
839 839
 		// If the posted key doesn't match the activated/deactivated key (set using the Activate License button, AJAX response),
840 840
 		// then we assume it's changed. If it's changed, unset the status and the previous response.
841
-		if( $local_key !== $response_key ) {
841
+		if ( $local_key !== $response_key ) {
842 842
 
843
-			unset( $posted_settings['license_key_response'] );
844
-			unset( $posted_settings['license_key_status'] );
845
-			GFCommon::add_error_message( __('The license key you entered has been saved, but not activated. Please activate the license.', 'gravityview' ) );
843
+			unset( $posted_settings[ 'license_key_response' ] );
844
+			unset( $posted_settings[ 'license_key_status' ] );
845
+			GFCommon::add_error_message( __( 'The license key you entered has been saved, but not activated. Please activate the license.', 'gravityview' ) );
846 846
 		}
847 847
 
848 848
 		return $posted_settings;
@@ -877,25 +877,25 @@  discard block
 block discarded – undo
877 877
 				'label'             => __( 'License Key', 'gravityview' ),
878 878
 				'description'          => __( 'Enter the license key that was sent to you on purchase. This enables plugin updates &amp; support.', 'gravityview' ) . $this->get_license_handler()->license_details( $this->get_app_setting( 'license_key_response' ) ),
879 879
 				'type'              => 'edd_license',
880
-				'data-pending-text' => __('Verifying license&hellip;', 'gravityview'),
881
-				'default_value'           => $default_settings['license_key'],
880
+				'data-pending-text' => __( 'Verifying license&hellip;', 'gravityview' ),
881
+				'default_value'           => $default_settings[ 'license_key' ],
882 882
 				'class'             => ( '' == $this->get_app_setting( 'license_key' ) ) ? 'activate code regular-text edd-license-key' : 'deactivate code regular-text edd-license-key',
883 883
 			),
884 884
 			array(
885 885
 				'name'       => 'license_key_response',
886
-				'default_value'  => $default_settings['license_key_response'],
886
+				'default_value'  => $default_settings[ 'license_key_response' ],
887 887
 				'type'     => 'hidden',
888 888
 			),
889 889
 			array(
890 890
 				'name'       => 'license_key_status',
891
-				'default_value'  => $default_settings['license_key_status'],
891
+				'default_value'  => $default_settings[ 'license_key_status' ],
892 892
 				'type'     => 'hidden',
893 893
 			),
894 894
 			array(
895 895
 				'name'       => 'support-email',
896 896
 				'type'     => 'text',
897 897
 				'validate' => 'email',
898
-				'default_value'  => $default_settings['support-email'],
898
+				'default_value'  => $default_settings[ 'support-email' ],
899 899
 				'label'    => __( 'Support Email', 'gravityview' ),
900 900
 				'description' => __( 'In order to provide responses to your support requests, please provide your email address.', 'gravityview' ),
901 901
 				'class'    => 'code regular-text',
@@ -907,53 +907,53 @@  discard block
 block discarded – undo
907 907
 				'name'         => 'support_port',
908 908
 				'type'       => 'radio',
909 909
 				'label'      => __( 'Show Support Port?', 'gravityview' ),
910
-				'default_value'    => $default_settings['support_port'],
910
+				'default_value'    => $default_settings[ 'support_port' ],
911 911
 				'horizontal' => 1,
912 912
 				'choices'    => array(
913 913
 					array(
914
-						'label' => _x('Show', 'Setting: Show or Hide', 'gravityview'),
914
+						'label' => _x( 'Show', 'Setting: Show or Hide', 'gravityview' ),
915 915
 						'value' => '1',
916 916
 					),
917 917
 					array(
918
-						'label' => _x('Hide', 'Setting: Show or Hide', 'gravityview'),
918
+						'label' => _x( 'Hide', 'Setting: Show or Hide', 'gravityview' ),
919 919
 						'value' => '0',
920 920
 					),
921 921
 				),
922
-				'tooltip' => '<p><img src="' . esc_url_raw( plugins_url('assets/images/beacon.png', GRAVITYVIEW_FILE ) ) . '" alt="' . esc_attr__( 'The Support Port looks like this.', 'gravityview' ) . '" class="alignright" style="max-width:40px; margin:.5em;" />' . esc_html__('The Support Port provides quick access to how-to articles and tutorials. For administrators, it also makes it easy to contact support.', 'gravityview') . '</p>',
922
+				'tooltip' => '<p><img src="' . esc_url_raw( plugins_url( 'assets/images/beacon.png', GRAVITYVIEW_FILE ) ) . '" alt="' . esc_attr__( 'The Support Port looks like this.', 'gravityview' ) . '" class="alignright" style="max-width:40px; margin:.5em;" />' . esc_html__( 'The Support Port provides quick access to how-to articles and tutorials. For administrators, it also makes it easy to contact support.', 'gravityview' ) . '</p>',
923 923
 				'description'   => __( 'Show the Support Port on GravityView pages?', 'gravityview' ),
924 924
 			),
925 925
 			array(
926 926
 				'name'         => 'no-conflict-mode',
927 927
 				'type'       => 'radio',
928 928
 				'label'      => __( 'No-Conflict Mode', 'gravityview' ),
929
-				'default_value'    => $default_settings['no-conflict-mode'],
929
+				'default_value'    => $default_settings[ 'no-conflict-mode' ],
930 930
 				'horizontal' => 1,
931 931
 				'choices'    => array(
932 932
 					array(
933
-						'label' => _x('On', 'Setting: On or off', 'gravityview'),
933
+						'label' => _x( 'On', 'Setting: On or off', 'gravityview' ),
934 934
 						'value' => '1',
935 935
 					),
936 936
 					array(
937
-						'label' => _x('Off', 'Setting: On or off', 'gravityview'),
937
+						'label' => _x( 'Off', 'Setting: On or off', 'gravityview' ),
938 938
 						'value' => '0',
939 939
 					),
940 940
 				),
941
-				'description'   => __( 'Set this to ON to prevent extraneous scripts and styles from being printed on GravityView admin pages, reducing conflicts with other plugins and themes.', 'gravityview' ) . ' ' . __('If your Edit View tabs are ugly, enable this setting.', 'gravityview'),
941
+				'description'   => __( 'Set this to ON to prevent extraneous scripts and styles from being printed on GravityView admin pages, reducing conflicts with other plugins and themes.', 'gravityview' ) . ' ' . __( 'If your Edit View tabs are ugly, enable this setting.', 'gravityview' ),
942 942
 			),
943 943
 			array(
944 944
 				'name'       => 'beta',
945 945
 				'type'       => 'checkbox',
946 946
 				'label'      => __( 'Become a Beta Tester', 'gravityview' ),
947
-				'default_value'    => $default_settings['beta'],
947
+				'default_value'    => $default_settings[ 'beta' ],
948 948
 				'horizontal' => 1,
949 949
 				'choices'    => array(
950 950
 					array(
951
-						'label' => _x('Show me beta versions if they are available.', 'gravityview'),
951
+						'label' => _x( 'Show me beta versions if they are available.', 'gravityview' ),
952 952
 						'value' => '1',
953 953
                         'name'  => 'beta',
954 954
 					),
955 955
 				),
956
-				'description'   => __( 'You will have early access to the latest GravityView features and improvements. There may be bugs! If you encounter an issue, help make GravityView better by reporting it!', 'gravityview'),
956
+				'description'   => __( 'You will have early access to the latest GravityView features and improvements. There may be bugs! If you encounter an issue, help make GravityView better by reporting it!', 'gravityview' ),
957 957
 			),
958 958
 		) );
959 959
 
@@ -964,20 +964,20 @@  discard block
 block discarded – undo
964 964
 		 * @since 1.7.4
965 965
 		 */
966 966
 		foreach ( $fields as &$field ) {
967
-			$field['name']          = isset( $field['name'] ) ? $field['name'] : rgget('id', $field );
968
-			$field['label']         = isset( $field['label'] ) ? $field['label'] : rgget('title', $field );
969
-			$field['default_value'] = isset( $field['default_value'] ) ? $field['default_value'] : rgget('default', $field );
970
-			$field['description']   = isset( $field['description'] ) ? $field['description'] : rgget('subtitle', $field );
967
+			$field[ 'name' ]          = isset( $field[ 'name' ] ) ? $field[ 'name' ] : rgget( 'id', $field );
968
+			$field[ 'label' ]         = isset( $field[ 'label' ] ) ? $field[ 'label' ] : rgget( 'title', $field );
969
+			$field[ 'default_value' ] = isset( $field[ 'default_value' ] ) ? $field[ 'default_value' ] : rgget( 'default', $field );
970
+			$field[ 'description' ]   = isset( $field[ 'description' ] ) ? $field[ 'description' ] : rgget( 'subtitle', $field );
971 971
 
972
-			if( $disabled_attribute ) {
973
-				$field['disabled']  = $disabled_attribute;
972
+			if ( $disabled_attribute ) {
973
+				$field[ 'disabled' ] = $disabled_attribute;
974 974
 			}
975 975
 		}
976 976
 
977 977
 
978 978
         $sections = array(
979 979
             array(
980
-                'description' =>      sprintf( '<span class="version-info description">%s</span>', sprintf( __('You are running GravityView version %s', 'gravityview'), GravityView_Plugin::version ) ),
980
+                'description' =>      sprintf( '<span class="version-info description">%s</span>', sprintf( __( 'You are running GravityView version %s', 'gravityview' ), GravityView_Plugin::version ) ),
981 981
                 'fields'      => $fields,
982 982
             )
983 983
         );
@@ -988,8 +988,8 @@  discard block
 block discarded – undo
988 988
             'type'     => 'save',
989 989
         );
990 990
 
991
-		if( $disabled_attribute ) {
992
-			$button['disabled'] = $disabled_attribute;
991
+		if ( $disabled_attribute ) {
992
+			$button[ 'disabled' ] = $disabled_attribute;
993 993
 		}
994 994
 
995 995
 
@@ -1009,20 +1009,20 @@  discard block
 block discarded – undo
1009 1009
 		// If there are extensions, add a section for them
1010 1010
 		if ( ! empty( $extension_sections ) ) {
1011 1011
 
1012
-			if( $disabled_attribute ) {
1012
+			if ( $disabled_attribute ) {
1013 1013
 				foreach ( $extension_sections as &$section ) {
1014
-					foreach ( $section['fields'] as &$field ) {
1015
-						$field['disabled'] = $disabled_attribute;
1014
+					foreach ( $section[ 'fields' ] as &$field ) {
1015
+						$field[ 'disabled' ] = $disabled_attribute;
1016 1016
 					}
1017 1017
 				}
1018 1018
 			}
1019 1019
 
1020
-            $k = count( $extension_sections ) - 1 ;
1021
-            $extension_sections[ $k ]['fields'][] = $button;
1020
+            $k = count( $extension_sections ) - 1;
1021
+            $extension_sections[ $k ][ 'fields' ][ ] = $button;
1022 1022
 			$sections = array_merge( $sections, $extension_sections );
1023 1023
 		} else {
1024 1024
             // add the 'update settings' button to the general section
1025
-            $sections[0]['fields'][] = $button;
1025
+            $sections[ 0 ][ 'fields' ][ ] = $button;
1026 1026
         }
1027 1027
 
1028 1028
 		return $sections;
Please login to merge, or discard this patch.
includes/class-admin-welcome.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -34,10 +34,10 @@  discard block
 block discarded – undo
34 34
 	 * @since 1.0
35 35
 	 */
36 36
 	public function __construct() {
37
-		add_action( 'admin_menu', array( $this, 'admin_menus'), 200 );
37
+		add_action( 'admin_menu', array( $this, 'admin_menus' ), 200 );
38 38
 		add_action( 'admin_head', array( $this, 'admin_head' ) );
39
-		add_action( 'admin_init', array( $this, 'welcome'    ) );
40
-		add_filter( 'gravityview_is_admin_page', array( $this, 'is_dashboard_page'), 10, 2 );
39
+		add_action( 'admin_init', array( $this, 'welcome' ) );
40
+		add_filter( 'gravityview_is_admin_page', array( $this, 'is_dashboard_page' ), 10, 2 );
41 41
 	}
42 42
 
43 43
 	/**
@@ -53,8 +53,8 @@  discard block
 block discarded – undo
53 53
 		// Add help page to GravityView menu
54 54
 		add_submenu_page(
55 55
 			'edit.php?post_type=gravityview',
56
-			__('GravityView: Getting Started', 'gravityview'),
57
-			__('Getting Started', 'gravityview'),
56
+			__( 'GravityView: Getting Started', 'gravityview' ),
57
+			__( 'Getting Started', 'gravityview' ),
58 58
 			$this->minimum_capability,
59 59
 			'gv-getting-started',
60 60
 			array( $this, 'getting_started_screen' )
@@ -87,10 +87,10 @@  discard block
 block discarded – undo
87 87
 	 *
88 88
 	 * @return boolean  $is_page   True: yep; false: nope
89 89
 	 */
90
-	public function is_dashboard_page($is_page = false, $hook = NULL) {
90
+	public function is_dashboard_page( $is_page = false, $hook = NULL ) {
91 91
 		global $plugin_page;
92 92
 
93
-		if($is_page) { return $is_page; }
93
+		if ( $is_page ) { return $is_page; }
94 94
 
95 95
 		return in_array( $plugin_page, array( 'gv-about', 'gv-credits', 'gv-getting-started' ) );
96 96
 	}
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 		remove_submenu_page( 'edit.php?post_type=gravityview', 'gv-credits' );
109 109
 		remove_submenu_page( 'edit.php?post_type=gravityview', 'gv-changelog' );
110 110
 
111
-		if( !$this->is_dashboard_page() ) { return; }
111
+		if ( ! $this->is_dashboard_page() ) { return; }
112 112
 
113 113
 		?>
114 114
         <style type="text/css" media="screen" xmlns="http://www.w3.org/1999/html">
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 		// Don't fetch -beta, etc.
142 142
 		list( $display_version ) = explode( '-', GravityView_Plugin::version );
143 143
 
144
-		$selected = !empty( $plugin_page ) ? $plugin_page : 'gv-getting-started';
144
+		$selected = ! empty( $plugin_page ) ? $plugin_page : 'gv-getting-started';
145 145
 
146 146
 		echo gravityview_get_floaty( 132 );
147 147
 		?>
@@ -150,13 +150,13 @@  discard block
 block discarded – undo
150 150
 		<div class="about-text"><?php esc_html_e( 'Thank you for installing GravityView. Beautifully display your Gravity Forms entries.', 'gravityview' ); ?></div>
151 151
 
152 152
 		<h2 class="nav-tab-wrapper clear">
153
-			<a class="nav-tab <?php echo $selected == 'gv-getting-started' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'gv-getting-started', 'post_type' => 'gravityview'), 'edit.php' ) ) ); ?>">
153
+			<a class="nav-tab <?php echo $selected == 'gv-getting-started' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'gv-getting-started', 'post_type' => 'gravityview' ), 'edit.php' ) ) ); ?>">
154 154
 				<?php _e( "Getting Started", 'gravityview' ); ?>
155 155
 			</a>
156
-			<a class="nav-tab <?php echo $selected == 'gv-changelog' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'gv-changelog', 'post_type' => 'gravityview'), 'edit.php' ) ) ); ?>">
156
+			<a class="nav-tab <?php echo $selected == 'gv-changelog' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'gv-changelog', 'post_type' => 'gravityview' ), 'edit.php' ) ) ); ?>">
157 157
 				<?php _e( "List of Changes", 'gravityview' ); ?>
158 158
 			</a>
159
-			<a class="nav-tab <?php echo $selected == 'gv-credits' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'gv-credits', 'post_type' => 'gravityview'), 'edit.php' ) ) ); ?>">
159
+			<a class="nav-tab <?php echo $selected == 'gv-credits' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'gv-credits', 'post_type' => 'gravityview' ), 'edit.php' ) ) ); ?>">
160 160
 				<?php _e( 'Credits', 'gravityview' ); ?>
161 161
 			</a>
162 162
 		</h2>
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
 					<h2>Create a View</h2>
196 196
 
197 197
 					<ol class="ol-decimal">
198
-						<li>Go to <a href="<?php echo admin_url('post-new.php?post_type=gravityview'); ?>">Views &gt; New View</a></li>
198
+						<li>Go to <a href="<?php echo admin_url( 'post-new.php?post_type=gravityview' ); ?>">Views &gt; New View</a></li>
199 199
 						<li>If you want to <strong>create a new form</strong>, click the "Use a Form Preset" button</li>
200 200
 						<li>If you want to <strong>use an existing form&rsquo;s entries</strong>, select from the dropdown.</li>
201 201
 						<li>Select the type of View you would like to create. There are two core types of Views: <strong>Table</strong> and <strong>Listing</strong>.
@@ -423,7 +423,7 @@  discard block
 block discarded – undo
423 423
 					</ul>
424 424
 
425 425
 					<h4><?php esc_attr_e( 'Want to contribute?', 'gravityview' ); ?></h4>
426
-					<p><?php echo sprintf( esc_attr__( 'If you want to contribute to the code, %syou can on Github%s. If your contributions are accepted, you will be thanked here.', 'gravityview'), '<a href="https://github.com/katzwebservices/GravityView">', '</a>' ); ?></p>
426
+					<p><?php echo sprintf( esc_attr__( 'If you want to contribute to the code, %syou can on Github%s. If your contributions are accepted, you will be thanked here.', 'gravityview' ), '<a href="https://github.com/katzwebservices/GravityView">', '</a>' ); ?></p>
427 427
 				</div>
428 428
 			</div>
429 429
 
@@ -466,7 +466,7 @@  discard block
 block discarded – undo
466 466
 		global $plugin_page;
467 467
 
468 468
 		// Bail if we're just editing the plugin
469
-		if( $plugin_page === 'plugin-editor.php' ) { return; }
469
+		if ( $plugin_page === 'plugin-editor.php' ) { return; }
470 470
 
471 471
 		// Bail if no activation redirect
472 472
 		if ( ! get_transient( '_gv_activation_redirect' ) ) { return; }
@@ -477,7 +477,7 @@  discard block
 block discarded – undo
477 477
 		$upgrade = get_option( 'gv_version_upgraded_from' );
478 478
 
479 479
 		// Don't do anything if they've already seen the new version info
480
-		if( $upgrade === GravityView_Plugin::version ) {
480
+		if ( $upgrade === GravityView_Plugin::version ) {
481 481
 			return;
482 482
 		}
483 483
 
@@ -485,10 +485,10 @@  discard block
 block discarded – undo
485 485
 		update_option( 'gv_version_upgraded_from', GravityView_Plugin::version );
486 486
 
487 487
 		// Bail if activating from network, or bulk
488
-		if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) { return; }
488
+		if ( is_network_admin() || isset( $_GET[ 'activate-multi' ] ) ) { return; }
489 489
 
490 490
 		// First time install
491
-		if( ! $upgrade ) {
491
+		if ( ! $upgrade ) {
492 492
 			wp_safe_redirect( admin_url( 'edit.php?post_type=gravityview&page=gv-getting-started' ) ); exit;
493 493
 		}
494 494
 		// Update
Please login to merge, or discard this patch.
gravityview.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 	 */
91 91
 	public static function getInstance() {
92 92
 
93
-		if( empty( self::$instance ) ) {
93
+		if ( empty( self::$instance ) ) {
94 94
 			self::$instance = new self;
95 95
 		}
96 96
 
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 
102 102
 		self::require_files();
103 103
 
104
-		if( ! GravityView_Compatibility::is_valid() ) {
104
+		if ( ! GravityView_Compatibility::is_valid() ) {
105 105
 			return;
106 106
 		}
107 107
 
@@ -116,14 +116,14 @@  discard block
 block discarded – undo
116 116
 	 */
117 117
 	private static function require_files() {
118 118
 		require_once( GRAVITYVIEW_DIR . 'includes/helper-functions.php' );
119
-		require_once( GRAVITYVIEW_DIR . 'includes/class-common.php');
120
-		require_once( GRAVITYVIEW_DIR . 'includes/connector-functions.php');
119
+		require_once( GRAVITYVIEW_DIR . 'includes/class-common.php' );
120
+		require_once( GRAVITYVIEW_DIR . 'includes/connector-functions.php' );
121 121
 		require_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-compatibility.php' );
122 122
 		require_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-roles-capabilities.php' );
123 123
 		require_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-admin-notices.php' );
124 124
 		require_once( GRAVITYVIEW_DIR . 'includes/class-admin.php' );
125
-		require_once( GRAVITYVIEW_DIR . 'includes/class-post-types.php');
126
-		require_once( GRAVITYVIEW_DIR . 'includes/class-cache.php');
125
+		require_once( GRAVITYVIEW_DIR . 'includes/class-post-types.php' );
126
+		require_once( GRAVITYVIEW_DIR . 'includes/class-cache.php' );
127 127
 	}
128 128
 
129 129
 	/**
@@ -156,22 +156,22 @@  discard block
 block discarded – undo
156 156
 		}
157 157
 
158 158
 		include_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-entry-approval-status.php' );
159
-		include_once( GRAVITYVIEW_DIR .'includes/class-gravityview-entry-approval.php' );
159
+		include_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-entry-approval.php' );
160 160
 
161
-		include_once( GRAVITYVIEW_DIR .'includes/class-gravityview-entry-notes.php' );
162
-		include_once( GRAVITYVIEW_DIR .'includes/load-plugin-and-theme-hooks.php' );
161
+		include_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-entry-notes.php' );
162
+		include_once( GRAVITYVIEW_DIR . 'includes/load-plugin-and-theme-hooks.php' );
163 163
 
164 164
 		// Load Extensions
165 165
 		// @todo: Convert to a scan of the directory or a method where this all lives
166
-		include_once( GRAVITYVIEW_DIR .'includes/extensions/edit-entry/class-edit-entry.php' );
167
-		include_once( GRAVITYVIEW_DIR .'includes/extensions/delete-entry/class-delete-entry.php' );
168
-		include_once( GRAVITYVIEW_DIR .'includes/extensions/entry-notes/class-gravityview-field-notes.php' );
166
+		include_once( GRAVITYVIEW_DIR . 'includes/extensions/edit-entry/class-edit-entry.php' );
167
+		include_once( GRAVITYVIEW_DIR . 'includes/extensions/delete-entry/class-delete-entry.php' );
168
+		include_once( GRAVITYVIEW_DIR . 'includes/extensions/entry-notes/class-gravityview-field-notes.php' );
169 169
 
170 170
 		// Load WordPress Widgets
171
-		include_once( GRAVITYVIEW_DIR .'includes/wordpress-widgets/register-wordpress-widgets.php' );
171
+		include_once( GRAVITYVIEW_DIR . 'includes/wordpress-widgets/register-wordpress-widgets.php' );
172 172
 
173 173
 		// Load GravityView Widgets
174
-		include_once( GRAVITYVIEW_DIR .'includes/widgets/register-gravityview-widgets.php' );
174
+		include_once( GRAVITYVIEW_DIR . 'includes/widgets/register-gravityview-widgets.php' );
175 175
 
176 176
 		// Add oEmbed
177 177
 		include_once( GRAVITYVIEW_DIR . 'includes/class-oembed.php' );
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 		include_once( GRAVITYVIEW_DIR . 'includes/class-frontend-views.php' );
185 185
 		include_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-admin-bar.php' );
186 186
 		include_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-entry-list.php' );
187
-		include_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-merge-tags.php'); /** @since 1.8.4 */
187
+		include_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-merge-tags.php' ); /** @since 1.8.4 */
188 188
 		include_once( GRAVITYVIEW_DIR . 'includes/class-data.php' );
189 189
 		include_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-shortcode.php' );
190 190
 		include_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-entry-link-shortcode.php' );
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
 	 * @return bool
200 200
 	 */
201 201
 	public static function is_network_activated() {
202
-		return is_multisite() && ( function_exists('is_plugin_active_for_network') && is_plugin_active_for_network( 'gravityview/gravityview.php' ) );
202
+		return is_multisite() && ( function_exists( 'is_plugin_active_for_network' ) && is_plugin_active_for_network( 'gravityview/gravityview.php' ) );
203 203
 	}
204 204
 
205 205
 
@@ -220,12 +220,12 @@  discard block
 block discarded – undo
220 220
 
221 221
 			if ( php_sapi_name() == 'cli' ) {
222 222
 				printf( __( "GravityView requires PHP Version %s or newer. You're using Version %s. Please ask your host to upgrade your server's PHP.", 'gravityview' ),
223
-					GV_FUTURE_MIN_PHP_VERSION , phpversion() );
223
+					GV_FUTURE_MIN_PHP_VERSION, phpversion() );
224 224
 			} else {
225 225
 				printf( '<body style="padding: 0; margin: 0; font-family: -apple-system, BlinkMacSystemFont, \'Segoe UI\', Roboto, Oxygen-Sans, Ubuntu, Cantarell, \'Helvetica Neue\', sans-serif;">' );
226 226
 				printf( '<img src="' . plugins_url( 'assets/images/astronaut-200x263.png', GRAVITYVIEW_FILE ) . '" alt="The GravityView Astronaut Says:" style="float: left; height: 60px; margin-right : 10px;" />' );
227 227
 				printf( __( "%sGravityView requires PHP Version %s or newer.%s \n\nYou're using Version %s. Please ask your host to upgrade your server's PHP.", 'gravityview' ),
228
-					'<h3 style="font-size:16px; margin: 0 0 8px 0;">', GV_FUTURE_MIN_PHP_VERSION , "</h3>\n\n", $version );
228
+					'<h3 style="font-size:16px; margin: 0 0 8px 0;">', GV_FUTURE_MIN_PHP_VERSION, "</h3>\n\n", $version );
229 229
 				printf( '</body>' );
230 230
 			}
231 231
 
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
 	 * @since 1.7.5.1
296 296
 	 */
297 297
 	public static function include_widget_class() {
298
-		include_once( GRAVITYVIEW_DIR .'includes/widgets/class-gravityview-widget.php' );
298
+		include_once( GRAVITYVIEW_DIR . 'includes/widgets/class-gravityview-widget.php' );
299 299
 	}
300 300
 
301 301
 
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
 		}
318 318
 		if ( ! $loaded ) {
319 319
 			$locale = apply_filters( 'plugin_locale', get_locale(), 'gravityview' );
320
-			$mofile = dirname( __FILE__ ) . '/languages/gravityview-'. $locale .'.mo';
320
+			$mofile = dirname( __FILE__ ) . '/languages/gravityview-' . $locale . '.mo';
321 321
 			load_textdomain( 'gravityview', $mofile );
322 322
 		}
323 323
 
@@ -354,12 +354,12 @@  discard block
 block discarded – undo
354 354
 	 */
355 355
 	public function frontend_actions( $force = false ) {
356 356
 
357
-		if( self::is_admin() && ! $force ) { return; }
357
+		if ( self::is_admin() && ! $force ) { return; }
358 358
 
359 359
 		include_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-image.php' );
360
-		include_once( GRAVITYVIEW_DIR .'includes/class-template.php' );
361
-		include_once( GRAVITYVIEW_DIR .'includes/class-api.php' );
362
-		include_once( GRAVITYVIEW_DIR .'includes/class-frontend-views.php' );
360
+		include_once( GRAVITYVIEW_DIR . 'includes/class-template.php' );
361
+		include_once( GRAVITYVIEW_DIR . 'includes/class-api.php' );
362
+		include_once( GRAVITYVIEW_DIR . 'includes/class-frontend-views.php' );
363 363
 		include_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-change-entry-creator.php' );
364 364
 
365 365
 
@@ -384,8 +384,8 @@  discard block
 block discarded – undo
384 384
 	 */
385 385
 	public static function get_default_widget_areas() {
386 386
 		$default_areas = array(
387
-			array( '1-1' => array( array( 'areaid' => 'top', 'title' => __('Top', 'gravityview' ) , 'subtitle' => '' ) ) ),
388
-			array( '1-2' => array( array( 'areaid' => 'left', 'title' => __('Left', 'gravityview') , 'subtitle' => '' ) ), '2-2' => array( array( 'areaid' => 'right', 'title' => __('Right', 'gravityview') , 'subtitle' => '' ) ) ),
387
+			array( '1-1' => array( array( 'areaid' => 'top', 'title' => __( 'Top', 'gravityview' ), 'subtitle' => '' ) ) ),
388
+			array( '1-2' => array( array( 'areaid' => 'left', 'title' => __( 'Left', 'gravityview' ), 'subtitle' => '' ) ), '2-2' => array( array( 'areaid' => 'right', 'title' => __( 'Right', 'gravityview' ), 'subtitle' => '' ) ) ),
389 389
 		);
390 390
 
391 391
 		/**
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
      * @param mixed $data Additional data to display
404 404
      * @return void
405 405
      */
406
-    public static function log_debug( $message, $data = null ){
406
+    public static function log_debug( $message, $data = null ) {
407 407
 	    /**
408 408
 	     * @action `gravityview_log_debug` Log a debug message that shows up in the Gravity Forms Logging Addon and also the Debug Bar plugin output
409 409
 	     * @param string $message Message to display
@@ -417,7 +417,7 @@  discard block
 block discarded – undo
417 417
      * @param  string $message log message
418 418
      * @return void
419 419
      */
420
-    public static function log_error( $message, $data = null ){
420
+    public static function log_error( $message, $data = null ) {
421 421
 	    /**
422 422
 	     * @action `gravityview_log_error` Log an error message that shows up in the Gravity Forms Logging Addon and also the Debug Bar plugin output
423 423
 	     * @param string $message Error message to display
@@ -428,4 +428,4 @@  discard block
 block discarded – undo
428 428
 
429 429
 } // end class GravityView_Plugin
430 430
 
431
-add_action('plugins_loaded', array('GravityView_Plugin', 'getInstance'), 1);
431
+add_action( 'plugins_loaded', array( 'GravityView_Plugin', 'getInstance' ), 1 );
Please login to merge, or discard this patch.
includes/class-gravityview-roles-capabilities.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 	 */
34 34
 	public static function get_instance() {
35 35
 
36
-		if( ! self::$instance ) {
36
+		if ( ! self::$instance ) {
37 37
 			self::$instance = new self;
38 38
 		}
39 39
 
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 		add_filter( 'members_get_capabilities', array( 'GravityView_Roles_Capabilities', 'merge_with_all_caps' ) );
57 57
 		add_action( 'members_register_cap_groups', array( $this, 'members_register_cap_group' ), 20 );
58 58
 		add_filter( 'user_has_cap', array( $this, 'filter_user_has_cap' ), 10, 4 );
59
-        add_action( 'admin_init', array( $this, 'add_caps') );
59
+        add_action( 'admin_init', array( $this, 'add_caps' ) );
60 60
 	}
61 61
 
62 62
 
@@ -77,18 +77,18 @@  discard block
 block discarded – undo
77 77
 	public function filter_user_has_cap( $usercaps = array(), $caps = array(), $args = array(), $user = NULL ) {
78 78
 
79 79
 		// Empty caps_to_check array
80
-		if( ! $usercaps || ! $caps ) {
80
+		if ( ! $usercaps || ! $caps ) {
81 81
 			return $usercaps;
82 82
 		}
83 83
 
84 84
 		/**
85 85
 		 * Enable all GravityView caps_to_check if `gravityview_full_access` is enabled
86 86
 		 */
87
-		if( ! empty( $usercaps['gravityview_full_access'] ) ) {
87
+		if ( ! empty( $usercaps[ 'gravityview_full_access' ] ) ) {
88 88
 
89 89
 			$all_gravityview_caps = self::all_caps();
90 90
 
91
-			foreach( $all_gravityview_caps as $gv_cap ) {
91
+			foreach ( $all_gravityview_caps as $gv_cap ) {
92 92
 				$usercaps[ $gv_cap ] = true;
93 93
 			}
94 94
 
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
 		$all = $administrator;
307 307
 
308 308
 		// If role is set, return caps_to_check for just that role.
309
-		if( $single_role ) {
309
+		if ( $single_role ) {
310 310
 			$caps = isset( ${$single_role} ) ? ${$single_role} : false;
311 311
 			return $flat_array ? $caps : array( $single_role => $caps );
312 312
 		}
@@ -364,13 +364,13 @@  discard block
 block discarded – undo
364 364
 		$caps_to_check = self::maybe_add_full_access_caps( $caps_to_check );
365 365
 
366 366
 		foreach ( $caps_to_check as $cap ) {
367
-			if( ! is_null( $object_id ) ) {
367
+			if ( ! is_null( $object_id ) ) {
368 368
 				$has_cap = $user_id ? user_can( $user_id, $cap, $object_id ) : current_user_can( $cap, $object_id );
369 369
 			} else {
370 370
 				$has_cap = $user_id ? user_can( $user_id, $cap ) : current_user_can( $cap );
371 371
 			}
372 372
 			// At the first successful response, stop checking
373
-			if( $has_cap ) {
373
+			if ( $has_cap ) {
374 374
 				break;
375 375
 			}
376 376
 		}
@@ -394,15 +394,15 @@  discard block
 block discarded – undo
394 394
 		$all_gravityview_caps = self::all_caps();
395 395
 
396 396
 		// Are there any $caps_to_check that are from GravityView?
397
-		if( $has_gravityview_caps = array_intersect( $caps_to_check, $all_gravityview_caps ) ) {
398
-			$caps_to_check[] = 'gravityview_full_access';
397
+		if ( $has_gravityview_caps = array_intersect( $caps_to_check, $all_gravityview_caps ) ) {
398
+			$caps_to_check[ ] = 'gravityview_full_access';
399 399
 		}
400 400
 
401 401
 		$all_gravity_forms_caps = class_exists( 'GFCommon' ) ? GFCommon::all_caps() : array();
402 402
 
403 403
 		// Are there any $caps_to_check that are from Gravity Forms?
404
-		if( $all_gravity_forms_caps = array_intersect( $caps_to_check, $all_gravity_forms_caps ) ) {
405
-			$caps_to_check[] = 'gform_full_access';
404
+		if ( $all_gravity_forms_caps = array_intersect( $caps_to_check, $all_gravity_forms_caps ) ) {
405
+			$caps_to_check[ ] = 'gform_full_access';
406 406
 		}
407 407
 
408 408
 		return array_unique( $caps_to_check );
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
 			$capabilities = self::all_caps();
425 425
 
426 426
 			// Loop through each role and remove GV caps_to_check
427
-			foreach( $wp_roles->get_names() as $role_slug => $role_name ) {
427
+			foreach ( $wp_roles->get_names() as $role_slug => $role_name ) {
428 428
 				foreach ( $capabilities as $cap ) {
429 429
 					$wp_roles->remove_cap( $role_slug, $cap );
430 430
 				}
Please login to merge, or discard this patch.
future/includes/class-gv-settings-view.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 		 */
40 40
 		$default_settings = apply_filters( 'gravityview_default_args', array(
41 41
 			'id' => array(
42
-				'label' => __('View ID', 'gravityview'),
42
+				'label' => __( 'View ID', 'gravityview' ),
43 43
 				'type' => 'number',
44 44
 				'group'	=> 'default',
45 45
 				'value' => NULL,
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 				'show_in_shortcode' => false,
48 48
 			),
49 49
 			'page_size' => array(
50
-				'label' 	=> __('Number of entries per page', 'gravityview'),
50
+				'label' 	=> __( 'Number of entries per page', 'gravityview' ),
51 51
 				'type' => 'number',
52 52
 				'class'	=> 'small-text',
53 53
 				'group'	=> 'default',
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 				'show_in_shortcode' => true,
56 56
 			),
57 57
 			'offset' => array(
58
-				'label' 	=> __('Offset entries starting from', 'gravityview'),
58
+				'label' 	=> __( 'Offset entries starting from', 'gravityview' ),
59 59
 				'type' => 'number',
60 60
 				'class'	=> 'small-text',
61 61
 				'group'	=> 'default',
@@ -79,8 +79,8 @@  discard block
 block discarded – undo
79 79
 			),
80 80
 			'admin_show_all_statuses' => array(
81 81
 				'label' => __( 'Show all entries to administrators', 'gravityview' ),
82
-				'desc'	=> __('Administrators will be able to see entries with any approval status.', 'gravityview'),
83
-				'tooltip' => __('Logged-out visitors and non-administrators will only see approved entries, while administrators will see entries with all statuses. This makes it easier for administrators to moderate entries from a View.', 'gravityview'),
82
+				'desc'	=> __( 'Administrators will be able to see entries with any approval status.', 'gravityview' ),
83
+				'tooltip' => __( 'Logged-out visitors and non-administrators will only see approved entries, while administrators will see entries with all statuses. This makes it easier for administrators to moderate entries from a View.', 'gravityview' ),
84 84
 				'requires' => 'show_only_approved',
85 85
 				'type' => 'checkbox',
86 86
 				'group'	=> 'default',
@@ -105,40 +105,40 @@  discard block
 block discarded – undo
105 105
 			'user_edit' => array(
106 106
 				'label'	=> __( 'Allow User Edit', 'gravityview' ),
107 107
 				'group'	=> 'default',
108
-				'desc'	=> __('Allow logged-in users to edit entries they created.', 'gravityview'),
108
+				'desc'	=> __( 'Allow logged-in users to edit entries they created.', 'gravityview' ),
109 109
 				'value'	=> 0,
110
-				'tooltip' => __('Display "Edit Entry" fields to non-administrator users if they created the entry. Edit Entry fields will always be displayed to site administrators.', 'gravityview'),
110
+				'tooltip' => __( 'Display "Edit Entry" fields to non-administrator users if they created the entry. Edit Entry fields will always be displayed to site administrators.', 'gravityview' ),
111 111
 				'type'	=> 'checkbox',
112 112
 				'show_in_shortcode' => true,
113 113
 			),
114 114
 			'user_delete' => array(
115 115
 				'label'	=> __( 'Allow User Delete', 'gravityview' ),
116 116
 				'group'	=> 'default',
117
-				'desc'	=> __('Allow logged-in users to delete entries they created.', 'gravityview'),
117
+				'desc'	=> __( 'Allow logged-in users to delete entries they created.', 'gravityview' ),
118 118
 				'value'	=> 0,
119
-				'tooltip' => __('Display "Delete Entry" fields to non-administrator users if they created the entry. Delete Entry fields will always be displayed to site administrators.', 'gravityview'),
119
+				'tooltip' => __( 'Display "Delete Entry" fields to non-administrator users if they created the entry. Delete Entry fields will always be displayed to site administrators.', 'gravityview' ),
120 120
 				'type'	=> 'checkbox',
121 121
 				'show_in_shortcode' => true,
122 122
 			),
123 123
 			'sort_field' => array(
124
-				'label'	=> __('Sort by field', 'gravityview'),
124
+				'label'	=> __( 'Sort by field', 'gravityview' ),
125 125
 				'type' => 'select',
126 126
 				'value' => '',
127 127
 				'group'	=> 'sort',
128 128
 				'options' => array(
129
-					'' => __( 'Default', 'gravityview'),
130
-					'date_created' => __( 'Date Created', 'gravityview'),
129
+					'' => __( 'Default', 'gravityview' ),
130
+					'date_created' => __( 'Date Created', 'gravityview' ),
131 131
 				),
132 132
 				'show_in_shortcode' => true,
133 133
 			),
134 134
 			'sort_direction' => array(
135
-				'label' 	=> __('Sort direction', 'gravityview'),
135
+				'label' 	=> __( 'Sort direction', 'gravityview' ),
136 136
 				'type' => 'select',
137 137
 				'value' => 'ASC',
138 138
 				'group'	=> 'sort',
139 139
 				'options' => array(
140
-					'ASC' => __('ASC', 'gravityview'),
141
-					'DESC' => __('DESC', 'gravityview'),
140
+					'ASC' => __( 'ASC', 'gravityview' ),
141
+					'DESC' => __( 'DESC', 'gravityview' ),
142 142
 					//'RAND' => __('Random', 'gravityview'),
143 143
 				),
144 144
 				'show_in_shortcode' => true,
@@ -154,69 +154,69 @@  discard block
 block discarded – undo
154 154
 				'show_in_template' => array( 'default_table', 'preset_business_data', 'preset_issue_tracker', 'preset_resume_board', 'preset_job_board' ),
155 155
 			),
156 156
 			'start_date' => array(
157
-				'label' 	=> __('Filter by Start Date', 'gravityview'),
157
+				'label' 	=> __( 'Filter by Start Date', 'gravityview' ),
158 158
 				'class'	=> 'gv-datepicker',
159
-				'desc'	=> __('Show entries submitted after this date. Supports relative dates, such as "-1 week" or "-1 month".', 'gravityview' ),
159
+				'desc'	=> __( 'Show entries submitted after this date. Supports relative dates, such as "-1 week" or "-1 month".', 'gravityview' ),
160 160
 				'type' => 'text',
161 161
 				'value' => '',
162 162
 				'group'	=> 'filter',
163 163
 				'show_in_shortcode' => true,
164 164
 			),
165 165
 			'end_date' => array(
166
-				'label' 	=> __('Filter by End Date', 'gravityview'),
166
+				'label' 	=> __( 'Filter by End Date', 'gravityview' ),
167 167
 				'class'	=> 'gv-datepicker',
168
-				'desc'	=> __('Show entries submitted before this date. Supports relative dates, such as "now" or "-3 days".', 'gravityview' ),
168
+				'desc'	=> __( 'Show entries submitted before this date. Supports relative dates, such as "now" or "-3 days".', 'gravityview' ),
169 169
 				'type' => 'text',
170 170
 				'value' => '',
171 171
 				'group'	=> 'filter',
172 172
 				'show_in_shortcode' => true,
173 173
 			),
174 174
 			'class' => array(
175
-				'label' 	=> __('CSS Class', 'gravityview'),
176
-				'desc'	=> __('CSS class to add to the wrapping HTML container.', 'gravityview'),
175
+				'label' 	=> __( 'CSS Class', 'gravityview' ),
176
+				'desc'	=> __( 'CSS class to add to the wrapping HTML container.', 'gravityview' ),
177 177
 				'group'	=> 'default',
178 178
 				'type' => 'text',
179 179
 				'value' => '',
180 180
 				'show_in_shortcode' => false,
181 181
 			),
182 182
 			'search_value' => array(
183
-				'label' 	=> __('Search Value', 'gravityview'),
184
-				'desc'	=> __('Define a default search value for the View', 'gravityview'),
183
+				'label' 	=> __( 'Search Value', 'gravityview' ),
184
+				'desc'	=> __( 'Define a default search value for the View', 'gravityview' ),
185 185
 				'type' => 'text',
186 186
 				'value' => '',
187 187
 				'group'	=> 'filter',
188 188
 				'show_in_shortcode' => false,
189 189
 			),
190 190
 			'search_field' => array(
191
-				'label' 	=> __('Search Field', 'gravityview'),
192
-				'desc'	=> __('If Search Value is set, you can define a specific field to search in. Otherwise, all fields will be searched.', 'gravityview'),
191
+				'label' 	=> __( 'Search Field', 'gravityview' ),
192
+				'desc'	=> __( 'If Search Value is set, you can define a specific field to search in. Otherwise, all fields will be searched.', 'gravityview' ),
193 193
 				'type' => 'number',
194 194
 				'value' => '',
195 195
 				'group'	=> 'filter',
196 196
 				'show_in_shortcode' => false,
197 197
 			),
198 198
 			'single_title' => array(
199
-				'label'	=> __('Single Entry Title', 'gravityview'),
199
+				'label'	=> __( 'Single Entry Title', 'gravityview' ),
200 200
 				'type'	=> 'text',
201
-				'desc'	=> __('When viewing a single entry, change the title of the page to this setting. Otherwise, the title will not change between the Multiple Entries and Single Entry views.', 'gravityview'),
201
+				'desc'	=> __( 'When viewing a single entry, change the title of the page to this setting. Otherwise, the title will not change between the Multiple Entries and Single Entry views.', 'gravityview' ),
202 202
 				'group'	=> 'default',
203 203
 				'value'	=> '',
204 204
 				'show_in_shortcode' => false,
205 205
 				'full_width' => true,
206 206
 			),
207 207
 			'back_link_label' => array(
208
-				'label'	=> __('Back Link Label', 'gravityview'),
208
+				'label'	=> __( 'Back Link Label', 'gravityview' ),
209 209
 				'group'	=> 'default',
210
-				'desc'	=> __('The text of the link that returns to the multiple entries view.', 'gravityview'),
210
+				'desc'	=> __( 'The text of the link that returns to the multiple entries view.', 'gravityview' ),
211 211
 				'type'	=> 'text',
212 212
 				'value'	=> '',
213 213
 				'show_in_shortcode' => false,
214 214
 				'full_width' => true,
215 215
 			),
216 216
 			'embed_only' => array(
217
-				'label'	=> __('Prevent Direct Access', 'gravityview'),
217
+				'label'	=> __( 'Prevent Direct Access', 'gravityview' ),
218 218
 				'group'	=> 'default',
219
-				'desc'	=> __('Only allow access to this View when embedded using the shortcode.', 'gravityview'),
219
+				'desc'	=> __( 'Only allow access to this View when embedded using the shortcode.', 'gravityview' ),
220 220
 				'type'	=> 'checkbox',
221 221
 				'value'	=> '',
222 222
 				'tooltip' => false,
@@ -239,19 +239,19 @@  discard block
 block discarded – undo
239 239
 		// By default, we only want the key => value pairing, not the whole array.
240 240
 		if ( ! $detailed ) {
241 241
 			$defaults = array();
242
-			foreach( $default_settings as $key => $value ) {
243
-				$defaults[ $key ] = $value['value'];
242
+			foreach ( $default_settings as $key => $value ) {
243
+				$defaults[ $key ] = $value[ 'value' ];
244 244
 			}
245 245
 			return $defaults;
246 246
 
247 247
 		// But sometimes, we want all the details.
248 248
 		} else {
249
-			foreach ($default_settings as $key => $value) {
249
+			foreach ( $default_settings as $key => $value ) {
250 250
 
251 251
 				// If the $group argument is set for the method,
252 252
 				// ignore any settings that aren't in that group.
253 253
 				if ( ! empty( $group ) && is_string( $group ) ) {
254
-					if ( empty( $value['group'] ) || $value['group'] !== $group ) {
254
+					if ( empty( $value[ 'group' ] ) || $value[ 'group' ] !== $group ) {
255 255
 						unset( $default_settings[ $key ] );
256 256
 					}
257 257
 				}
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-source-url.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -26,24 +26,24 @@
 block discarded – undo
26 26
 	function field_options( $field_options, $template_id, $field_id, $context, $input_type ) {
27 27
 
28 28
 		// Don't link to entry; doesn't make sense.
29
-		unset( $field_options['show_as_link'] );
29
+		unset( $field_options[ 'show_as_link' ] );
30 30
 
31
-		if( 'edit' === $context ) {
31
+		if ( 'edit' === $context ) {
32 32
 			return $field_options;
33 33
 		}
34 34
 
35 35
 		$add_options = array();
36
-		$add_options['link_to_source'] = array(
36
+		$add_options[ 'link_to_source' ] = array(
37 37
 			'type' => 'checkbox',
38 38
 			'label' => __( 'Link to URL:', 'gravityview' ),
39
-			'desc' => __('Display as a link to the Source URL', 'gravityview'),
39
+			'desc' => __( 'Display as a link to the Source URL', 'gravityview' ),
40 40
 			'value' => false,
41 41
 			'merge_tags' => false,
42 42
 		);
43
-		$add_options['source_link_text'] = array(
43
+		$add_options[ 'source_link_text' ] = array(
44 44
 			'type' => 'text',
45 45
 			'label' => __( 'Link Text:', 'gravityview' ),
46
-			'desc' => __('Customize the link text. If empty, the link text will be the URL.', 'gravityview'),
46
+			'desc' => __( 'Customize the link text. If empty, the link text will be the URL.', 'gravityview' ),
47 47
 			'value' => NULL,
48 48
 			'merge_tags' => true,
49 49
 		);
Please login to merge, or discard this patch.
includes/class-data.php 1 patch
Spacing   +129 added lines, -129 removed lines patch added patch discarded remove patch
@@ -21,12 +21,12 @@  discard block
 block discarded – undo
21 21
 			gravityview()->request = new \GV\Dummy_Request();
22 22
 		}
23 23
 
24
-		if( !empty( $passed_post ) ) {
24
+		if ( ! empty( $passed_post ) ) {
25 25
 
26 26
 			$id_or_id_array = $this->maybe_get_view_id( $passed_post );
27 27
 
28 28
 			if ( defined( 'GRAVITYVIEW_FUTURE_CORE_LOADED' ) ) {
29
-				foreach( is_array( $id_or_id_array ) ? $id_or_id_array : array( $id_or_id_array ) as $view_id ) {
29
+				foreach ( is_array( $id_or_id_array ) ? $id_or_id_array : array( $id_or_id_array ) as $view_id ) {
30 30
 					if ( \GV\View::exists( $view_id ) && ! gravityview()->views->contains( $view_id ) ) {
31 31
 						gravityview()->views->add( \GV\View::by_id( $view_id ) );
32 32
 					}
@@ -73,24 +73,24 @@  discard block
 block discarded – undo
73 73
 	public function maybe_get_view_id( $passed_post ) {
74 74
 		$ids = array();
75 75
 
76
-		if( ! empty( $passed_post ) ) {
76
+		if ( ! empty( $passed_post ) ) {
77 77
 
78
-			if( is_numeric( $passed_post ) ) {
78
+			if ( is_numeric( $passed_post ) ) {
79 79
 				$passed_post = get_post( $passed_post );
80 80
 			}
81 81
 
82 82
 			// Convert WP_Posts into WP_Posts[] array
83
-			if( $passed_post instanceof WP_Post ) {
83
+			if ( $passed_post instanceof WP_Post ) {
84 84
 				$passed_post = array( $passed_post );
85 85
 			}
86 86
 
87
-			if( is_array( $passed_post ) ) {
87
+			if ( is_array( $passed_post ) ) {
88 88
 
89
-				foreach ( $passed_post as &$post) {
89
+				foreach ( $passed_post as &$post ) {
90 90
 					if ( defined( 'GRAVITYVIEW_FUTURE_CORE_LOADED' ) && $post instanceof WP_Post ) {
91 91
 						$views = \GV\View_Collection::from_post( $post );
92 92
 						foreach ( $views->all() as $view ) {
93
-							$ids []= $view->ID;
93
+							$ids [ ] = $view->ID;
94 94
 
95 95
 							/** And as a side-effect... add each view to the global scope. */
96 96
 							if ( ! gravityview()->views->contains( $view->ID ) ) {
@@ -99,19 +99,19 @@  discard block
 block discarded – undo
99 99
 						}
100 100
 					} else {
101 101
 						/** Deprecated, see \GV\View_Collection::from_post */
102
-						if( ( get_post_type( $post ) === 'gravityview' ) ) {
103
-							$ids[] = $post->ID;
104
-						} else{
102
+						if ( ( get_post_type( $post ) === 'gravityview' ) ) {
103
+							$ids[ ] = $post->ID;
104
+						} else {
105 105
 							// Parse the Post Content
106 106
 							$id = $this->parse_post_content( $post->post_content );
107
-							if( $id ) {
108
-								$ids = array_merge( $ids, (array) $id );
107
+							if ( $id ) {
108
+								$ids = array_merge( $ids, (array)$id );
109 109
 							}
110 110
 
111 111
 							// Parse the Post Meta
112 112
 							$id = $this->parse_post_meta( $post->ID );
113
-							if( $id ) {
114
-								$ids = array_merge( $ids, (array) $id );
113
+							if ( $id ) {
114
+								$ids = array_merge( $ids, (array)$id );
115 115
 							}
116 116
 						}
117 117
 					}
@@ -125,37 +125,37 @@  discard block
 block discarded – undo
125 125
 					if ( defined( 'GRAVITYVIEW_FUTURE_CORE_LOADED' ) ) {
126 126
 						$shortcodes = \GV\Shortcode::parse( $passed_post );
127 127
 						foreach ( $shortcodes as $shortcode ) {
128
-							if ( $shortcode->name == 'gravityview' && !empty( $shortcode->atts['id'] ) ) {
129
-								$ids []= $shortcode->atts['id'];
128
+							if ( $shortcode->name == 'gravityview' && ! empty( $shortcode->atts[ 'id' ] ) ) {
129
+								$ids [ ] = $shortcode->atts[ 'id' ];
130 130
 
131 131
 								/** And as a side-effect... add each view to the global scope. */
132
-								if ( ! gravityview()->views->contains( $shortcode->atts['id'] ) && \GV\View::exists( $shortcode->atts['id'] ) ) {
133
-									gravityview()->views->add( $shortcode->atts['id'] );
132
+								if ( ! gravityview()->views->contains( $shortcode->atts[ 'id' ] ) && \GV\View::exists( $shortcode->atts[ 'id' ] ) ) {
133
+									gravityview()->views->add( $shortcode->atts[ 'id' ] );
134 134
 								}
135 135
 							}
136 136
 						}
137 137
 					} else {
138 138
 						/** Deprecated, use \GV\Shortcode::parse. */
139 139
 						$id = $this->parse_post_content( $passed_post );
140
-						if( $id ) {
141
-							$ids = array_merge( $ids, (array) $id );
140
+						if ( $id ) {
141
+							$ids = array_merge( $ids, (array)$id );
142 142
 						}
143 143
 					}
144 144
 
145 145
 				} else {
146 146
 					$id = $this->get_id_from_atts( $passed_post );
147
-					$ids[] = intval( $id );
147
+					$ids[ ] = intval( $id );
148 148
 				}
149 149
 			}
150 150
 		}
151 151
 
152
-		if( empty($ids) ) {
152
+		if ( empty( $ids ) ) {
153 153
 			return NULL;
154 154
 		}
155 155
 
156 156
 		// If it's just one ID, return that.
157 157
 		// Otherwise, return array of IDs
158
-		return ( sizeof( $ids ) === 1 ) ? $ids[0] : $ids;
158
+		return ( sizeof( $ids ) === 1 ) ? $ids[ 0 ] : $ids;
159 159
 	}
160 160
 
161 161
 	/**
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 	 */
164 164
 	public static function getInstance( $passed_post = NULL ) {
165 165
 
166
-		if( empty( self::$instance ) ) {
166
+		if ( empty( self::$instance ) ) {
167 167
 			self::$instance = new GravityView_View_Data( $passed_post );
168 168
 		}
169 169
 
@@ -180,8 +180,8 @@  discard block
 block discarded – undo
180 180
 				return array();
181 181
 			}
182 182
 			return array_combine(
183
-				array_map( function ( $view ) { return $view->ID; }, gravityview()->views->all() ),
184
-				array_map( function ( $view ) { return $view->as_data(); }, gravityview()->views->all() )
183
+				array_map( function( $view ) { return $view->ID; }, gravityview()->views->all() ),
184
+				array_map( function( $view ) { return $view->as_data(); }, gravityview()->views->all() )
185 185
 			);
186 186
 		}
187 187
 		return $this->views;
@@ -208,19 +208,19 @@  discard block
 block discarded – undo
208 208
 			return $view->as_data();
209 209
 		}
210 210
 
211
-		if( ! is_numeric( $view_id) ) {
212
-			do_action('gravityview_log_error', sprintf('GravityView_View_Data[get_view] $view_id passed is not numeric.', $view_id) );
211
+		if ( ! is_numeric( $view_id ) ) {
212
+			do_action( 'gravityview_log_error', sprintf( 'GravityView_View_Data[get_view] $view_id passed is not numeric.', $view_id ) );
213 213
 			return false;
214 214
 		}
215 215
 
216 216
 		// Backup: the view hasn't been fetched yet. Doing it now.
217 217
 		if ( ! isset( $this->views[ $view_id ] ) ) {
218
-			do_action('gravityview_log_debug', sprintf('GravityView_View_Data[get_view] View #%s not set yet.', $view_id) );
218
+			do_action( 'gravityview_log_debug', sprintf( 'GravityView_View_Data[get_view] View #%s not set yet.', $view_id ) );
219 219
 			return $this->add_view( $view_id, $atts );
220 220
 		}
221 221
 
222 222
 		if ( empty( $this->views[ $view_id ] ) ) {
223
-			do_action('gravityview_log_debug', sprintf('GravityView_View_Data[get_view] Returning; View #%s was empty.', $view_id) );
223
+			do_action( 'gravityview_log_debug', sprintf( 'GravityView_View_Data[get_view] Returning; View #%s was empty.', $view_id ) );
224 224
 			return false;
225 225
 		}
226 226
 
@@ -265,8 +265,8 @@  discard block
 block discarded – undo
265 265
 		}
266 266
 
267 267
 		// Handle array of IDs
268
-		if( is_array( $view_id ) ) {
269
-			foreach( $view_id as $id ) {
268
+		if ( is_array( $view_id ) ) {
269
+			foreach ( $view_id as $id ) {
270 270
 
271 271
 				$this->add_view( $id, $atts );
272 272
 			}
@@ -275,21 +275,21 @@  discard block
 block discarded – undo
275 275
 		}
276 276
 
277 277
 		// The view has been set already; returning stored view.
278
-		if ( !empty( $this->views[ $view_id ] ) ) {
279
-			do_action('gravityview_log_debug', sprintf('GravityView_View_Data[add_view] Returning; View #%s already exists.', $view_id) );
278
+		if ( ! empty( $this->views[ $view_id ] ) ) {
279
+			do_action( 'gravityview_log_debug', sprintf( 'GravityView_View_Data[add_view] Returning; View #%s already exists.', $view_id ) );
280 280
 			return $this->views[ $view_id ];
281 281
 		}
282 282
 
283
-		if( ! $this->view_exists( $view_id ) ) {
284
-			do_action('gravityview_log_debug', sprintf('GravityView_View_Data[add_view] Returning; View #%s does not exist.', $view_id) );
283
+		if ( ! $this->view_exists( $view_id ) ) {
284
+			do_action( 'gravityview_log_debug', sprintf( 'GravityView_View_Data[add_view] Returning; View #%s does not exist.', $view_id ) );
285 285
 			return false;
286 286
 		}
287 287
 
288 288
 		$form_id = gravityview_get_form_id( $view_id );
289 289
 
290
-		if( empty( $form_id ) ) {
290
+		if ( empty( $form_id ) ) {
291 291
 
292
-			do_action('gravityview_log_debug', sprintf('GravityView_View_Data[add_view] Returning; Post ID #%s does not have a connected form.', $view_id) );
292
+			do_action( 'gravityview_log_debug', sprintf( 'GravityView_View_Data[add_view] Returning; Post ID #%s does not have a connected form.', $view_id ) );
293 293
 
294 294
 			return false;
295 295
 		}
@@ -297,21 +297,21 @@  discard block
 block discarded – undo
297 297
 		// Get the settings for the View ID
298 298
 		$view_settings = gravityview_get_template_settings( $view_id );
299 299
 
300
-		do_action('gravityview_log_debug', sprintf('GravityView_View_Data[add_view] Settings pulled in from View #%s', $view_id), $view_settings );
300
+		do_action( 'gravityview_log_debug', sprintf( 'GravityView_View_Data[add_view] Settings pulled in from View #%s', $view_id ), $view_settings );
301 301
 
302 302
 		// Merge the view settings with the defaults
303 303
 		$view_defaults = wp_parse_args( $view_settings, defined( 'GRAVITYVIEW_FUTURE_CORE_LOADED' ) ? \GV\View_Settings::defaults() : self::get_default_args() );
304 304
 
305
-		do_action('gravityview_log_debug', 'GravityView_View_Data[add_view] View Defaults after merging View Settings with the default args.', $view_defaults );
305
+		do_action( 'gravityview_log_debug', 'GravityView_View_Data[add_view] View Defaults after merging View Settings with the default args.', $view_defaults );
306 306
 
307
-		if( ! empty( $atts ) && is_array( $atts ) ) {
307
+		if ( ! empty( $atts ) && is_array( $atts ) ) {
308 308
 
309
-			do_action('gravityview_log_debug', 'GravityView_View_Data[add_view] $atts before merging  with the $view_defaults', $atts );
309
+			do_action( 'gravityview_log_debug', 'GravityView_View_Data[add_view] $atts before merging  with the $view_defaults', $atts );
310 310
 
311 311
 			// Get the settings from the shortcode and merge them with defaults.
312 312
 			$atts = shortcode_atts( $view_defaults, $atts );
313 313
 
314
-			do_action('gravityview_log_debug', 'GravityView_View_Data[add_view] $atts after merging  with the $view_defaults', $atts );
314
+			do_action( 'gravityview_log_debug', 'GravityView_View_Data[add_view] $atts after merging  with the $view_defaults', $atts );
315 315
 
316 316
 		} else {
317 317
 
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
 
321 321
 		}
322 322
 
323
-		unset( $atts['id'], $view_defaults, $view_settings );
323
+		unset( $atts[ 'id' ], $view_defaults, $view_settings );
324 324
 
325 325
 		$data = array(
326 326
 			'id' => $view_id,
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
 			'form' => gravityview_get_form( $form_id ),
334 334
 		);
335 335
 
336
-		do_action('gravityview_log_debug', sprintf('GravityView_View_Data[add_view] View #%s being added.', $view_id), $data );
336
+		do_action( 'gravityview_log_debug', sprintf( 'GravityView_View_Data[add_view] View #%s being added.', $view_id ), $data );
337 337
 
338 338
 		$this->views[ $view_id ] = $data;
339 339
 
@@ -383,15 +383,15 @@  discard block
 block discarded – undo
383 383
 			throw new Exception( __METHOD__ . ' should not be called anymore. Why was it?' );
384 384
 		}
385 385
 
386
-		if( empty( $dir_fields ) || !is_array( $dir_fields ) ) {
386
+		if ( empty( $dir_fields ) || ! is_array( $dir_fields ) ) {
387 387
 			return $dir_fields;
388 388
 		}
389 389
 
390
-		foreach( $dir_fields as $area => $fields ) {
390
+		foreach ( $dir_fields as $area => $fields ) {
391 391
 
392
-			foreach( (array)$fields as $uniqid => $properties ) {
392
+			foreach ( (array)$fields as $uniqid => $properties ) {
393 393
 
394
-				if( $this->hide_field_check_conditions( $properties ) ) {
394
+				if ( $this->hide_field_check_conditions( $properties ) ) {
395 395
 					unset( $dir_fields[ $area ][ $uniqid ] );
396 396
 				}
397 397
 
@@ -418,7 +418,7 @@  discard block
 block discarded – undo
418 418
 		}
419 419
 
420 420
 		// logged-in visibility
421
-		if( ! empty( $properties['only_loggedin'] ) && ! GVCommon::has_cap( $properties['only_loggedin_cap'] ) ) {
421
+		if ( ! empty( $properties[ 'only_loggedin' ] ) && ! GVCommon::has_cap( $properties[ 'only_loggedin_cap' ] ) ) {
422 422
 			return true;
423 423
 		}
424 424
 
@@ -449,14 +449,14 @@  discard block
 block discarded – undo
449 449
 		// Get the settings from the shortcode and merge them with defaults.
450 450
 		$atts = wp_parse_args( $atts, defined( 'GRAVITYVIEW_FUTURE_CORE_LOADED' ) ? \GV\View_Settings::defaults() : self::get_default_args() );
451 451
 
452
-		$view_id = ! empty( $atts['view_id'] ) ? (int)$atts['view_id'] : NULL;
452
+		$view_id = ! empty( $atts[ 'view_id' ] ) ? (int)$atts[ 'view_id' ] : NULL;
453 453
 
454
-		if( empty( $view_id ) && !empty( $atts['id'] ) ) {
455
-			$view_id = (int)$atts['id'];
454
+		if ( empty( $view_id ) && ! empty( $atts[ 'id' ] ) ) {
455
+			$view_id = (int)$atts[ 'id' ];
456 456
 		}
457 457
 
458
-		if( empty( $view_id ) ) {
459
-			do_action('gravityview_log_error', 'GravityView_View_Data[get_id_from_atts] Returning; no ID defined (Atts)', $atts );
458
+		if ( empty( $view_id ) ) {
459
+			do_action( 'gravityview_log_error', 'GravityView_View_Data[get_id_from_atts] Returning; no ID defined (Atts)', $atts );
460 460
 			return;
461 461
 		}
462 462
 
@@ -480,68 +480,68 @@  discard block
 block discarded – undo
480 480
 		if ( defined( 'GRAVITYVIEW_FUTURE_CORE_LOADED' ) ) {
481 481
 			$ids = array();
482 482
 			foreach ( \GV\Shortcode::parse( $content ) as $shortcode ) {
483
-				if ( $shortcode->name == 'gravityview' && is_numeric( $shortcode->atts['id'] ) ) {
484
-					if ( \GV\View::exists( $shortcode->atts['id'] ) && ! gravityview()->views->contains( $shortcode->atts['id'] ) ) {
485
-						gravityview()->views->add( \GV\View::by_id( $shortcode->atts['id'] ) );
483
+				if ( $shortcode->name == 'gravityview' && is_numeric( $shortcode->atts[ 'id' ] ) ) {
484
+					if ( \GV\View::exists( $shortcode->atts[ 'id' ] ) && ! gravityview()->views->contains( $shortcode->atts[ 'id' ] ) ) {
485
+						gravityview()->views->add( \GV\View::by_id( $shortcode->atts[ 'id' ] ) );
486 486
 					}
487 487
 					/**
488 488
 					 * The original function outputs the ID even though it wasn't added by ::add_view()
489 489
 					 * Wether this is a bug or not remains a mystery. But we need to emulate this behavior
490 490
 					 * until better times.
491 491
 					 */
492
-					$ids []= $shortcode->atts['id'];
492
+					$ids [ ] = $shortcode->atts[ 'id' ];
493 493
 				}
494 494
 			}
495 495
 			if ( empty ( $ids ) ) {
496 496
 				return null;
497 497
 			}
498
-			return ( sizeof( $ids ) === 1 ) ? $ids[0] : $ids;
498
+			return ( sizeof( $ids ) === 1 ) ? $ids[ 0 ] : $ids;
499 499
 		}
500 500
 
501 501
 		/**
502 502
 		 * @hack This is so that the shortcode is registered for the oEmbed preview in the Admin
503 503
 		 * @since 1.6
504 504
 		 */
505
-		if( ! shortcode_exists('gravityview') && class_exists( 'GravityView_Shortcode' ) ) {
505
+		if ( ! shortcode_exists( 'gravityview' ) && class_exists( 'GravityView_Shortcode' ) ) {
506 506
 			new GravityView_Shortcode;
507 507
 		}
508 508
 
509 509
 		$shortcodes = gravityview_has_shortcode_r( $content, 'gravityview' );
510 510
 
511
-		if( empty( $shortcodes ) ) {
511
+		if ( empty( $shortcodes ) ) {
512 512
 			return NULL;
513 513
 		}
514 514
 
515
-		do_action('gravityview_log_debug', 'GravityView_View_Data[parse_post_content] Parsing content, found shortcodes:', $shortcodes );
515
+		do_action( 'gravityview_log_debug', 'GravityView_View_Data[parse_post_content] Parsing content, found shortcodes:', $shortcodes );
516 516
 
517 517
 		$ids = array();
518 518
 
519
-		foreach ($shortcodes as $key => $shortcode) {
519
+		foreach ( $shortcodes as $key => $shortcode ) {
520 520
 
521
-			$shortcode[3] = htmlspecialchars_decode( $shortcode[3], ENT_QUOTES );
521
+			$shortcode[ 3 ] = htmlspecialchars_decode( $shortcode[ 3 ], ENT_QUOTES );
522 522
 
523
-			$args = shortcode_parse_atts( $shortcode[3] );
523
+			$args = shortcode_parse_atts( $shortcode[ 3 ] );
524 524
 
525
-			if( empty( $args['id'] ) ) {
526
-				do_action('gravityview_log_error', 'GravityView_View_Data[parse_post_content] Returning; no ID defined in shortcode atts', $shortcode );
525
+			if ( empty( $args[ 'id' ] ) ) {
526
+				do_action( 'gravityview_log_error', 'GravityView_View_Data[parse_post_content] Returning; no ID defined in shortcode atts', $shortcode );
527 527
 				continue;
528 528
 			}
529 529
 
530
-			do_action('gravityview_log_debug', sprintf('GravityView_View_Data[parse_post_content] Adding view #%s with shortcode args', $args['id']), $args );
530
+			do_action( 'gravityview_log_debug', sprintf( 'GravityView_View_Data[parse_post_content] Adding view #%s with shortcode args', $args[ 'id' ] ), $args );
531 531
 
532 532
 			// Store the View to the object for later fetching.
533
-			$this->add_view( $args['id'], $args );
533
+			$this->add_view( $args[ 'id' ], $args );
534 534
 
535
-			$ids[] = $args['id'];
535
+			$ids[ ] = $args[ 'id' ];
536 536
 		}
537 537
 
538
-		if( empty($ids) ) {
538
+		if ( empty( $ids ) ) {
539 539
 			return NULL;
540 540
 		}
541 541
 
542 542
 		// If it's just one ID, return that.
543 543
 		// Otherwise, return array of IDs
544
-		return ( sizeof( $ids ) === 1 ) ? $ids[0] : $ids;
544
+		return ( sizeof( $ids ) === 1 ) ? $ids[ 0 ] : $ids;
545 545
 
546 546
 	}
547 547
 
@@ -570,7 +570,7 @@  discard block
 block discarded – undo
570 570
 		 */
571 571
 		$meta_keys = (array)apply_filters( 'gravityview/data/parse/meta_keys', array(), $post_id );
572 572
 
573
-		if( empty( $meta_keys ) ) {
573
+		if ( empty( $meta_keys ) ) {
574 574
 			return NULL;
575 575
 		}
576 576
 
@@ -578,16 +578,16 @@  discard block
 block discarded – undo
578 578
 
579 579
 		$meta_content = '';
580 580
 
581
-		foreach( $meta_keys as $key ) {
582
-			$meta = get_post_meta( $post_id, $key , true );
583
-			if( ! is_string( $meta ) ) {
581
+		foreach ( $meta_keys as $key ) {
582
+			$meta = get_post_meta( $post_id, $key, true );
583
+			if ( ! is_string( $meta ) ) {
584 584
 				continue;
585 585
 			}
586 586
 			$meta_content .= $meta . ' ';
587 587
 		}
588 588
 
589
-		if( empty( $meta_content ) ) {
590
-			do_action('gravityview_log_error', sprintf( 'GravityView_View_Data[parse_post_meta] Returning; Empty custom fields for Post #%s (Custom fields keys:)', $post_id ), $meta_keys );
589
+		if ( empty( $meta_content ) ) {
590
+			do_action( 'gravityview_log_error', sprintf( 'GravityView_View_Data[parse_post_meta] Returning; Empty custom fields for Post #%s (Custom fields keys:)', $post_id ), $meta_keys );
591 591
 			return NULL;
592 592
 		}
593 593
 
@@ -615,16 +615,16 @@  discard block
 block discarded – undo
615 615
 		$message = NULL;
616 616
 
617 617
 		// Not invalid if not set!
618
-		if( empty( $post_id ) || empty( $view_id ) ) {
618
+		if ( empty( $post_id ) || empty( $view_id ) ) {
619 619
 
620
-			if( $empty_is_valid ) {
620
+			if ( $empty_is_valid ) {
621 621
 				return true;
622 622
 			}
623 623
 
624 624
 			$message = esc_html__( 'The ID is required.', 'gravityview' );
625 625
 		}
626 626
 
627
-		if( ! $message ) {
627
+		if ( ! $message ) {
628 628
 			$status = get_post_status( $post_id );
629 629
 
630 630
 			// Nothing exists with that post ID.
@@ -636,7 +636,7 @@  discard block
 block discarded – undo
636 636
 			}
637 637
 		}
638 638
 
639
-		if( ! $message ) {
639
+		if ( ! $message ) {
640 640
 
641 641
 			// Nothing exists with that post ID.
642 642
 			if ( empty( $status ) || in_array( $status, array( 'revision', 'attachment' ) ) ) {
@@ -645,8 +645,8 @@  discard block
 block discarded – undo
645 645
 
646 646
 		}
647 647
 
648
-		if( ! $message ) {
649
-			if ( defined( 'GRAVITYVIEW_FUTURE_CORE_LOADED' ) && $post = get_post( $post_id ) )  {
648
+		if ( ! $message ) {
649
+			if ( defined( 'GRAVITYVIEW_FUTURE_CORE_LOADED' ) && $post = get_post( $post_id ) ) {
650 650
 				$views = GV\View_Collection::from_post( $post );
651 651
 				$view_ids_in_post = array_map( function( $view ) { return $view->ID; }, $views->all() );
652 652
 			} else {
@@ -655,21 +655,21 @@  discard block
 block discarded – undo
655 655
 			}
656 656
 
657 657
 			// The post or page specified does not contain the shortcode.
658
-			if ( false === in_array( $view_id, (array) $view_ids_in_post ) ) {
658
+			if ( false === in_array( $view_id, (array)$view_ids_in_post ) ) {
659 659
 				$message = sprintf( esc_html__( 'The Post ID entered is not valid. You may have entered a post or page that does not contain the selected View. Make sure the post contains the following shortcode: %s', 'gravityview' ), '<br /><code>[gravityview id="' . intval( $view_id ) . '"]</code>' );
660 660
 			}
661 661
 		}
662 662
 
663
-		if( ! $message ) {
663
+		if ( ! $message ) {
664 664
 
665 665
 			// It's a View
666 666
 			if ( ( defined( 'GRAVITYVIEW_FUTURE_CORE_LOADED' ) && \GV\View::exists( $post_id ) )
667 667
 				|| 'gravityview' === get_post_type( $post_id ) ) {
668
-				$message = esc_html__( 'The ID is already a View.', 'gravityview' );;
668
+				$message = esc_html__( 'The ID is already a View.', 'gravityview' ); ;
669 669
 			}
670 670
 		}
671 671
 
672
-		if( $message ) {
672
+		if ( $message ) {
673 673
 			return new WP_Error( 'invalid_embed_id', $message );
674 674
 		}
675 675
 
@@ -686,7 +686,7 @@  discard block
 block discarded – undo
686 686
 
687 687
 		$args = defined( 'GRAVITYVIEW_FUTURE_CORE_LOADED' ) ? \GV\View_Settings::defaults( $with_details ) : self::get_default_args( $with_details );
688 688
 
689
-		if( !isset( $args[ $key ] ) ) { return NULL; }
689
+		if ( ! isset( $args[ $key ] ) ) { return NULL; }
690 690
 
691 691
 		return $args[ $key ];
692 692
 	}
@@ -723,7 +723,7 @@  discard block
 block discarded – undo
723 723
 		 */
724 724
 		$default_settings = apply_filters( 'gravityview_default_args', array(
725 725
 			'id' => array(
726
-				'label' => __('View ID', 'gravityview'),
726
+				'label' => __( 'View ID', 'gravityview' ),
727 727
 				'type' => 'number',
728 728
 				'group'	=> 'default',
729 729
 				'value' => NULL,
@@ -731,7 +731,7 @@  discard block
 block discarded – undo
731 731
 				'show_in_shortcode' => false,
732 732
 			),
733 733
 			'page_size' => array(
734
-				'label' 	=> __('Number of entries per page', 'gravityview'),
734
+				'label' 	=> __( 'Number of entries per page', 'gravityview' ),
735 735
 				'type' => 'number',
736 736
 				'class'	=> 'small-text',
737 737
 				'group'	=> 'default',
@@ -739,7 +739,7 @@  discard block
 block discarded – undo
739 739
 				'show_in_shortcode' => true,
740 740
 			),
741 741
 			'offset' => array(
742
-				'label' 	=> __('Offset entries starting from', 'gravityview'),
742
+				'label' 	=> __( 'Offset entries starting from', 'gravityview' ),
743 743
 				'type' => 'number',
744 744
 				'class'	=> 'small-text',
745 745
 				'group'	=> 'default',
@@ -763,8 +763,8 @@  discard block
 block discarded – undo
763 763
 			),
764 764
 			'admin_show_all_statuses' => array(
765 765
 				'label' => __( 'Show all entries to administrators', 'gravityview' ),
766
-				'desc'	=> __('Administrators will be able to see entries with any approval status.', 'gravityview'),
767
-				'tooltip' => __('Logged-out visitors and non-administrators will only see approved entries, while administrators will see entries with all statuses. This makes it easier for administrators to moderate entries from a View.', 'gravityview'),
766
+				'desc'	=> __( 'Administrators will be able to see entries with any approval status.', 'gravityview' ),
767
+				'tooltip' => __( 'Logged-out visitors and non-administrators will only see approved entries, while administrators will see entries with all statuses. This makes it easier for administrators to moderate entries from a View.', 'gravityview' ),
768 768
 				'requires' => 'show_only_approved',
769 769
 				'type' => 'checkbox',
770 770
 				'group'	=> 'default',
@@ -789,40 +789,40 @@  discard block
 block discarded – undo
789 789
 			'user_edit' => array(
790 790
 				'label'	=> __( 'Allow User Edit', 'gravityview' ),
791 791
 				'group'	=> 'default',
792
-				'desc'	=> __('Allow logged-in users to edit entries they created.', 'gravityview'),
792
+				'desc'	=> __( 'Allow logged-in users to edit entries they created.', 'gravityview' ),
793 793
 				'value'	=> 0,
794
-				'tooltip' => __('Display "Edit Entry" fields to non-administrator users if they created the entry. Edit Entry fields will always be displayed to site administrators.', 'gravityview'),
794
+				'tooltip' => __( 'Display "Edit Entry" fields to non-administrator users if they created the entry. Edit Entry fields will always be displayed to site administrators.', 'gravityview' ),
795 795
 				'type'	=> 'checkbox',
796 796
 				'show_in_shortcode' => true,
797 797
 			),
798 798
 			'user_delete' => array(
799 799
 				'label'	=> __( 'Allow User Delete', 'gravityview' ),
800 800
 				'group'	=> 'default',
801
-				'desc'	=> __('Allow logged-in users to delete entries they created.', 'gravityview'),
801
+				'desc'	=> __( 'Allow logged-in users to delete entries they created.', 'gravityview' ),
802 802
 				'value'	=> 0,
803
-				'tooltip' => __('Display "Delete Entry" fields to non-administrator users if they created the entry. Delete Entry fields will always be displayed to site administrators.', 'gravityview'),
803
+				'tooltip' => __( 'Display "Delete Entry" fields to non-administrator users if they created the entry. Delete Entry fields will always be displayed to site administrators.', 'gravityview' ),
804 804
 				'type'	=> 'checkbox',
805 805
 				'show_in_shortcode' => true,
806 806
 			),
807 807
 			'sort_field' => array(
808
-				'label'	=> __('Sort by field', 'gravityview'),
808
+				'label'	=> __( 'Sort by field', 'gravityview' ),
809 809
 				'type' => 'select',
810 810
 				'value' => '',
811 811
 				'group'	=> 'sort',
812 812
 				'options' => array(
813
-					'' => __( 'Default', 'gravityview'),
814
-					'date_created' => __( 'Date Created', 'gravityview'),
813
+					'' => __( 'Default', 'gravityview' ),
814
+					'date_created' => __( 'Date Created', 'gravityview' ),
815 815
 				),
816 816
 				'show_in_shortcode' => true,
817 817
 			),
818 818
 			'sort_direction' => array(
819
-				'label' 	=> __('Sort direction', 'gravityview'),
819
+				'label' 	=> __( 'Sort direction', 'gravityview' ),
820 820
 				'type' => 'select',
821 821
 				'value' => 'ASC',
822 822
 				'group'	=> 'sort',
823 823
 				'options' => array(
824
-					'ASC' => __('ASC', 'gravityview'),
825
-					'DESC' => __('DESC', 'gravityview'),
824
+					'ASC' => __( 'ASC', 'gravityview' ),
825
+					'DESC' => __( 'DESC', 'gravityview' ),
826 826
 					//'RAND' => __('Random', 'gravityview'),
827 827
 				),
828 828
 				'show_in_shortcode' => true,
@@ -838,69 +838,69 @@  discard block
 block discarded – undo
838 838
 				'show_in_template' => array( 'default_table', 'preset_business_data', 'preset_issue_tracker', 'preset_resume_board', 'preset_job_board' ),
839 839
 			),
840 840
 			'start_date' => array(
841
-				'label' 	=> __('Filter by Start Date', 'gravityview'),
841
+				'label' 	=> __( 'Filter by Start Date', 'gravityview' ),
842 842
 				'class'	=> 'gv-datepicker',
843
-				'desc'	=> __('Show entries submitted after this date. Supports relative dates, such as "-1 week" or "-1 month".', 'gravityview' ),
843
+				'desc'	=> __( 'Show entries submitted after this date. Supports relative dates, such as "-1 week" or "-1 month".', 'gravityview' ),
844 844
 				'type' => 'text',
845 845
 				'value' => '',
846 846
 				'group'	=> 'filter',
847 847
 				'show_in_shortcode' => true,
848 848
 			),
849 849
 			'end_date' => array(
850
-				'label' 	=> __('Filter by End Date', 'gravityview'),
850
+				'label' 	=> __( 'Filter by End Date', 'gravityview' ),
851 851
 				'class'	=> 'gv-datepicker',
852
-				'desc'	=> __('Show entries submitted before this date. Supports relative dates, such as "now" or "-3 days".', 'gravityview' ),
852
+				'desc'	=> __( 'Show entries submitted before this date. Supports relative dates, such as "now" or "-3 days".', 'gravityview' ),
853 853
 				'type' => 'text',
854 854
 				'value' => '',
855 855
 				'group'	=> 'filter',
856 856
 				'show_in_shortcode' => true,
857 857
 			),
858 858
 			'class' => array(
859
-				'label' 	=> __('CSS Class', 'gravityview'),
860
-				'desc'	=> __('CSS class to add to the wrapping HTML container.', 'gravityview'),
859
+				'label' 	=> __( 'CSS Class', 'gravityview' ),
860
+				'desc'	=> __( 'CSS class to add to the wrapping HTML container.', 'gravityview' ),
861 861
 				'group'	=> 'default',
862 862
 				'type' => 'text',
863 863
 				'value' => '',
864 864
 				'show_in_shortcode' => false,
865 865
 			),
866 866
 			'search_value' => array(
867
-				'label' 	=> __('Search Value', 'gravityview'),
868
-				'desc'	=> __('Define a default search value for the View', 'gravityview'),
867
+				'label' 	=> __( 'Search Value', 'gravityview' ),
868
+				'desc'	=> __( 'Define a default search value for the View', 'gravityview' ),
869 869
 				'type' => 'text',
870 870
 				'value' => '',
871 871
 				'group'	=> 'filter',
872 872
 				'show_in_shortcode' => false,
873 873
 			),
874 874
 			'search_field' => array(
875
-				'label' 	=> __('Search Field', 'gravityview'),
876
-				'desc'	=> __('If Search Value is set, you can define a specific field to search in. Otherwise, all fields will be searched.', 'gravityview'),
875
+				'label' 	=> __( 'Search Field', 'gravityview' ),
876
+				'desc'	=> __( 'If Search Value is set, you can define a specific field to search in. Otherwise, all fields will be searched.', 'gravityview' ),
877 877
 				'type' => 'number',
878 878
 				'value' => '',
879 879
 				'group'	=> 'filter',
880 880
 				'show_in_shortcode' => false,
881 881
 			),
882 882
 			'single_title' => array(
883
-				'label'	=> __('Single Entry Title', 'gravityview'),
883
+				'label'	=> __( 'Single Entry Title', 'gravityview' ),
884 884
 				'type'	=> 'text',
885
-				'desc'	=> __('When viewing a single entry, change the title of the page to this setting. Otherwise, the title will not change between the Multiple Entries and Single Entry views.', 'gravityview'),
885
+				'desc'	=> __( 'When viewing a single entry, change the title of the page to this setting. Otherwise, the title will not change between the Multiple Entries and Single Entry views.', 'gravityview' ),
886 886
 				'group'	=> 'default',
887 887
 				'value'	=> '',
888 888
 				'show_in_shortcode' => false,
889 889
 				'full_width' => true,
890 890
 			),
891 891
 			'back_link_label' => array(
892
-				'label'	=> __('Back Link Label', 'gravityview'),
892
+				'label'	=> __( 'Back Link Label', 'gravityview' ),
893 893
 				'group'	=> 'default',
894
-				'desc'	=> __('The text of the link that returns to the multiple entries view.', 'gravityview'),
894
+				'desc'	=> __( 'The text of the link that returns to the multiple entries view.', 'gravityview' ),
895 895
 				'type'	=> 'text',
896 896
 				'value'	=> '',
897 897
 				'show_in_shortcode' => false,
898 898
 				'full_width' => true,
899 899
 			),
900 900
 			'embed_only' => array(
901
-				'label'	=> __('Prevent Direct Access', 'gravityview'),
901
+				'label'	=> __( 'Prevent Direct Access', 'gravityview' ),
902 902
 				'group'	=> 'default',
903
-				'desc'	=> __('Only allow access to this View when embedded using the shortcode.', 'gravityview'),
903
+				'desc'	=> __( 'Only allow access to this View when embedded using the shortcode.', 'gravityview' ),
904 904
 				'type'	=> 'checkbox',
905 905
 				'value'	=> '',
906 906
 				'tooltip' => false,
@@ -912,15 +912,15 @@  discard block
 block discarded – undo
912 912
 				'value' => '',
913 913
 				'show_in_shortcode' => false,
914 914
 			),
915
-		));
915
+		) );
916 916
 
917 917
 		// By default, we only want the key => value pairing, not the whole array.
918
-		if( empty( $with_details ) ) {
918
+		if ( empty( $with_details ) ) {
919 919
 
920 920
 			$defaults = array();
921 921
 
922
-			foreach( $default_settings as $key => $value ) {
923
-				$defaults[ $key ] = $value['value'];
922
+			foreach ( $default_settings as $key => $value ) {
923
+				$defaults[ $key ] = $value[ 'value' ];
924 924
 			}
925 925
 
926 926
 			return $defaults;
@@ -929,12 +929,12 @@  discard block
 block discarded – undo
929 929
 		// But sometimes, we want all the details.
930 930
 		else {
931 931
 
932
-			foreach ($default_settings as $key => $value) {
932
+			foreach ( $default_settings as $key => $value ) {
933 933
 
934 934
 				// If the $group argument is set for the method,
935 935
 				// ignore any settings that aren't in that group.
936
-				if( !empty( $group ) && is_string( $group ) ) {
937
-					if( empty( $value['group'] ) || $value['group'] !== $group ) {
936
+				if ( ! empty( $group ) && is_string( $group ) ) {
937
+					if ( empty( $value[ 'group' ] ) || $value[ 'group' ] !== $group ) {
938 938
 						unset( $default_settings[ $key ] );
939 939
 					}
940 940
 				}
Please login to merge, or discard this patch.