Completed
Push — develop ( a94794...65380d )
by Zack
19:34
created
includes/load-plugin-and-theme-hooks.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,6 +24,6 @@
 block discarded – undo
24 24
 $plugin_theme_hooks_files = glob( $include_path . 'class-gravityview-{plugin,theme}-hooks-*.php', $glob_flags );
25 25
 
26 26
 // Load all plugin and theme files automatically
27
-foreach ( (array) $plugin_theme_hooks_files as $gv_hooks_filename ) {
27
+foreach ( (array)$plugin_theme_hooks_files as $gv_hooks_filename ) {
28 28
 	include $gv_hooks_filename;
29 29
 }
30 30
\ No newline at end of file
Please login to merge, or discard this patch.
includes/widgets/poll/class-gravityview-widget-poll.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -22,8 +22,8 @@  discard block
 block discarded – undo
22 22
 	function __construct() {
23 23
 
24 24
 		$this->widget_id = 'poll';
25
-		$this->widget_description = __('Displays the results of Poll Fields that exist in the form.', 'gravityview' );
26
-		$this->widget_subtitle = sprintf( _x('Note: this will display poll results for %sall form entries%s, not only the entries displayed in the View.', 'The string placeholders are for emphasis HTML', 'gravityview' ), '<em>', '</em>' );
25
+		$this->widget_description = __( 'Displays the results of Poll Fields that exist in the form.', 'gravityview' );
26
+		$this->widget_subtitle = sprintf( _x( 'Note: this will display poll results for %sall form entries%s, not only the entries displayed in the View.', 'The string placeholders are for emphasis HTML', 'gravityview' ), '<em>', '</em>' );
27 27
 
28 28
 		$default_values = array(
29 29
 			'header' => 1,
@@ -32,27 +32,27 @@  discard block
 block discarded – undo
32 32
 
33 33
 		$settings = array(
34 34
 			'percentages' => array(
35
-				'label' => __('Display Percentages', 'gravityview'),
35
+				'label' => __( 'Display Percentages', 'gravityview' ),
36 36
 				'type' => 'checkbox',
37 37
 				'value' => true,
38 38
 				'tooltip' => __( 'Display results percentages as part of results? Supported values are: true, false. Defaults to "true".', 'gravityview' ),
39 39
 			),
40 40
 			'counts' => array(
41
-				'label' => __('Display Counts', 'gravityview'),
41
+				'label' => __( 'Display Counts', 'gravityview' ),
42 42
 				'type' => 'checkbox',
43 43
 				'value' => true,
44 44
 				'tooltip' => __( 'Display number of times each choice has been selected when displaying results? Supported values are: true, false. Defaults to "true".', 'gravityview' ),
45 45
 			),
46 46
 			'style' => array(
47 47
 				'type' => 'select',
48
-				'label' => __('Style', 'gravityview'),
48
+				'label' => __( 'Style', 'gravityview' ),
49 49
 				'tooltip' => __( 'The Polls Add-On currently supports 4 built in styles: red, green, orange, blue. Defaults to "green".', 'gravityview' ),
50 50
 				'value' => 'green',
51 51
 				'choices' => array(
52
-					'green' => __('Green', 'gravityview'),
53
-					'blue' => __('Blue', 'gravityview'),
54
-					'red' => __('Red', 'gravityview'),
55
-					'orange' => __('Orange', 'gravityview'),
52
+					'green' => __( 'Green', 'gravityview' ),
53
+					'blue' => __( 'Blue', 'gravityview' ),
54
+					'red' => __( 'Red', 'gravityview' ),
55
+					'orange' => __( 'Orange', 'gravityview' ),
56 56
 				),
57 57
 			),
58 58
 		);
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 			add_filter( 'gravityview_template_paths', array( $this, 'add_template_path' ) );
63 63
 		}
64 64
 
65
-		parent::__construct( __( 'Poll Results', 'gravityview' ) , null, $default_values, $settings );
65
+		parent::__construct( __( 'Poll Results', 'gravityview' ), null, $default_values, $settings );
66 66
 	}
67 67
 
68 68
 	/**
@@ -89,11 +89,11 @@  discard block
 block discarded – undo
89 89
 
90 90
 		$GFPolls = GFPolls::get_instance();
91 91
 
92
-		wp_enqueue_script('gpoll_js', $GFPolls->get_base_url() . '/js/gpoll.js', array('jquery'), $GFPolls->_version);
92
+		wp_enqueue_script( 'gpoll_js', $GFPolls->get_base_url() . '/js/gpoll.js', array( 'jquery' ), $GFPolls->_version );
93 93
 
94 94
 		$GFPolls->localize_scripts();
95 95
 
96
-		wp_enqueue_style('gpoll_css', $GFPolls->get_base_url() . '/css/gpoll.css', null, $GFPolls->_version);
96
+		wp_enqueue_style( 'gpoll_css', $GFPolls->get_base_url() . '/css/gpoll.css', null, $GFPolls->_version );
97 97
 	}
98 98
 
99 99
 	/**
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 	 */
104 104
 	public function pre_render_frontend() {
105 105
 
106
-		if( ! class_exists('GFPolls') ) {
106
+		if ( ! class_exists( 'GFPolls' ) ) {
107 107
 
108 108
 			gravityview()->log->error( 'Poll Widget not displayed; the Poll Addon is not loaded' );
109 109
 
@@ -112,10 +112,10 @@  discard block
 block discarded – undo
112 112
 
113 113
 		$view = gravityview()->views->get();
114 114
 
115
-		$poll_fields = array( $view->form->form['id'] => GFCommon::get_fields_by_type( $view->form, array( 'poll' ) ) );
115
+		$poll_fields = array( $view->form->form[ 'id' ] => GFCommon::get_fields_by_type( $view->form, array( 'poll' ) ) );
116 116
 
117 117
 		foreach ( $view->joins as $join ) {
118
-			$poll_fields[ $join->join_on->form['id'] ] = GFCommon::get_fields_by_type( $join->join_on->form, array( 'poll' ) );
118
+			$poll_fields[ $join->join_on->form[ 'id' ] ] = GFCommon::get_fields_by_type( $join->join_on->form, array( 'poll' ) );
119 119
 		}
120 120
 
121 121
 		$poll_fields = array_filter( $poll_fields );
@@ -167,12 +167,12 @@  discard block
 block discarded – undo
167 167
 	 */
168 168
 	public function render_frontend( $widget_args, $content = '', $context = '' ) {
169 169
 
170
-		if( ! $this->pre_render_frontend() ) {
170
+		if ( ! $this->pre_render_frontend() ) {
171 171
 			return;
172 172
 		}
173 173
 
174 174
 		// Make sure the class is loaded in DataTables
175
-		if( !class_exists( 'GFFormDisplay' ) ) {
175
+		if ( ! class_exists( 'GFFormDisplay' ) ) {
176 176
 			include_once( GFCommon::get_base_path() . '/form_display.php' );
177 177
 		}
178 178
 
@@ -180,14 +180,14 @@  discard block
 block discarded – undo
180 180
 
181 181
 		$settings = $this->get_frontend_settings( $widget_args );
182 182
 
183
-		$percentages = empty( $settings['percentages'] ) ? 'false' : 'true';
183
+		$percentages = empty( $settings[ 'percentages' ] ) ? 'false' : 'true';
184 184
 
185
-		$counts = empty( $settings['counts'] ) ? 'false' : 'true';
185
+		$counts = empty( $settings[ 'counts' ] ) ? 'false' : 'true';
186 186
 
187
-		if( !empty( $settings['field'] ) ) {
188
-			$merge_tag = sprintf( '{gpoll: field="%d" style="%s" percentages="%s" counts="%s"}', $settings['field'], $settings['style'], $percentages, $counts );
187
+		if ( ! empty( $settings[ 'field' ] ) ) {
188
+			$merge_tag = sprintf( '{gpoll: field="%d" style="%s" percentages="%s" counts="%s"}', $settings[ 'field' ], $settings[ 'style' ], $percentages, $counts );
189 189
 		} else {
190
-			$merge_tag = sprintf( '{all_poll_results: style="%s" percentages="%s" counts="%s"}', $settings['style'], $percentages, $counts );
190
+			$merge_tag = sprintf( '{all_poll_results: style="%s" percentages="%s" counts="%s"}', $settings[ 'style' ], $percentages, $counts );
191 191
 		}
192 192
 
193 193
 		$gravityview_view = GravityView_View::getInstance();
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
 		$gravityview_view->poll_settings = $settings;
198 198
 		$gravityview_view->poll_fields = $this->poll_fields;
199 199
 
200
-		$gravityview_view->render('widget', 'poll', false );
200
+		$gravityview_view->render( 'widget', 'poll', false );
201 201
 
202 202
 		unset( $gravityview_view->poll_merge_tag, $gravityview_view->poll_settings, $gravityview_view->poll_form, $gravityview_view->poll_fields );
203 203
 	}
Please login to merge, or discard this patch.
future/includes/class-gv-template-entry-list.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 	 * @return string
27 27
 	 */
28 28
 	public function the_field( \GV\Field $field, $extras = null ) {
29
-		$form = \GV\GF_Form::by_id( $field->form_id ) ? : $this->view->form;
29
+		$form = \GV\GF_Form::by_id( $field->form_id ) ?: $this->view->form;
30 30
 		$entry = $this->entry->from_field( $field );
31 31
 
32 32
 		if ( ! $entry ) {
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 		}
35 35
 
36 36
 		$renderer = new Field_Renderer();
37
-		$source = is_numeric( $field->ID ) ? ( GF_Form::by_id( $field->form_id ) ? : $this->view->form ) : new Internal_Source();
37
+		$source = is_numeric( $field->ID ) ? ( GF_Form::by_id( $field->form_id ) ?: $this->view->form ) : new Internal_Source();
38 38
 		
39 39
 		$value = $renderer->render( $field, $this->view, $source, $entry, $this->request );
40 40
 		
@@ -62,13 +62,13 @@  discard block
 block discarded – undo
62 62
 		$hide_empty = apply_filters( 'gravityview/render/hide-empty-zone', Utils::get( $extras, 'hide_empty', $this->view->settings->get( 'hide_empty', false ) ), $context );
63 63
 
64 64
 		if ( is_numeric( $field->ID ) ) {
65
-			$extras['field'] = $field->as_configuration();
65
+			$extras[ 'field' ] = $field->as_configuration();
66 66
 		}
67 67
 
68
-		$extras['entry'] = $this->entry->as_entry();
69
-		$extras['hide_empty'] = $hide_empty;
70
-		$extras['label'] = $label;
71
-		$extras['value'] = $value;
68
+		$extras[ 'entry' ] = $this->entry->as_entry();
69
+		$extras[ 'hide_empty' ] = $hide_empty;
70
+		$extras[ 'label' ] = $label;
71
+		$extras[ 'value' ] = $value;
72 72
 
73 73
 		return \gravityview_field_output( $extras, $context );
74 74
 	}
Please login to merge, or discard this patch.
future/includes/class-gv-plugin.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 	/**
90 90
 	 * @var string The REST API functionality identifier.
91 91
 	 */
92
-	const FEATURE_REST  = 'rest_api';
92
+	const FEATURE_REST = 'rest_api';
93 93
 
94 94
 	/**
95 95
 	 * Get the global instance of \GV\Plugin.
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 		include_once $this->dir( 'includes/class-frontend-views.php' );
216 216
 		include_once $this->dir( 'includes/class-gravityview-admin-bar.php' );
217 217
 		include_once $this->dir( 'includes/class-gravityview-entry-list.php' );
218
-		include_once $this->dir( 'includes/class-gravityview-merge-tags.php'); /** @since 1.8.4 */
218
+		include_once $this->dir( 'includes/class-gravityview-merge-tags.php' ); /** @since 1.8.4 */
219 219
 		include_once $this->dir( 'includes/class-data.php' );
220 220
 		include_once $this->dir( 'includes/class-gravityview-shortcode.php' );
221 221
 		include_once $this->dir( 'includes/class-gravityview-entry-link-shortcode.php' );
@@ -269,11 +269,11 @@  discard block
 block discarded – undo
269 269
 
270 270
 		// Pre-4.6 loading
271 271
 		// TODO: Remove when GV minimum version is WordPress 4.6.0
272
-		$locale = apply_filters( 'plugin_locale', ( ( function_exists('get_user_locale') && is_admin() ) ? get_user_locale() : get_locale() ), 'gravityview' );
272
+		$locale = apply_filters( 'plugin_locale', ( ( function_exists( 'get_user_locale' ) && is_admin() ) ? get_user_locale() : get_locale() ), 'gravityview' );
273 273
 
274
-		$loaded = load_textdomain( 'gravityview', sprintf( '%s/%s-%s.mo', $this->dir('languages'), $domain, $locale ) );
274
+		$loaded = load_textdomain( 'gravityview', sprintf( '%s/%s-%s.mo', $this->dir( 'languages' ), $domain, $locale ) );
275 275
 
276
-		if( $loaded ) {
276
+		if ( $loaded ) {
277 277
 			return;
278 278
 		}
279 279
 
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
 	 */
425 425
 	public function is_compatible_wordpress( $version = null ) {
426 426
 
427
-		if( ! $version ) {
427
+		if ( ! $version ) {
428 428
 			$version = self::$min_wp_version;
429 429
 		}
430 430
 
@@ -465,8 +465,8 @@  discard block
 block discarded – undo
465 465
 	 * @return string The version of PHP.
466 466
 	 */
467 467
 	private function get_php_version() {
468
-		return ! empty( $GLOBALS['GRAVITYVIEW_TESTS_PHP_VERSION_OVERRIDE'] ) ?
469
-			$GLOBALS['GRAVITYVIEW_TESTS_PHP_VERSION_OVERRIDE'] : phpversion();
468
+		return ! empty( $GLOBALS[ 'GRAVITYVIEW_TESTS_PHP_VERSION_OVERRIDE' ] ) ?
469
+			$GLOBALS[ 'GRAVITYVIEW_TESTS_PHP_VERSION_OVERRIDE' ] : phpversion();
470 470
 	}
471 471
 
472 472
 	/**
@@ -477,8 +477,8 @@  discard block
 block discarded – undo
477 477
 	 * @return string The version of WordPress.
478 478
 	 */
479 479
 	private function get_wordpress_version() {
480
-		return ! empty( $GLOBALS['GRAVITYVIEW_TESTS_WP_VERSION_OVERRIDE'] ) ?
481
-			$GLOBALS['GRAVITYVIEW_TESTS_WP_VERSION_OVERRIDE'] : $GLOBALS['wp_version'];
480
+		return ! empty( $GLOBALS[ 'GRAVITYVIEW_TESTS_WP_VERSION_OVERRIDE' ] ) ?
481
+			$GLOBALS[ 'GRAVITYVIEW_TESTS_WP_VERSION_OVERRIDE' ] : $GLOBALS[ 'wp_version' ];
482 482
 	}
483 483
 
484 484
 	/**
@@ -489,13 +489,13 @@  discard block
 block discarded – undo
489 489
 	 * @return string|null The version of Gravity Forms or null if inactive.
490 490
 	 */
491 491
 	private function get_gravityforms_version() {
492
-		if ( ! class_exists( '\GFCommon' ) || ! empty( $GLOBALS['GRAVITYVIEW_TESTS_GF_INACTIVE_OVERRIDE'] ) ) {
492
+		if ( ! class_exists( '\GFCommon' ) || ! empty( $GLOBALS[ 'GRAVITYVIEW_TESTS_GF_INACTIVE_OVERRIDE' ] ) ) {
493 493
 			gravityview()->log->error( 'Gravity Forms is inactive or not installed.' );
494 494
 			return null;
495 495
 		}
496 496
 
497
-		return ! empty( $GLOBALS['GRAVITYVIEW_TESTS_GF_VERSION_OVERRIDE'] ) ?
498
-			$GLOBALS['GRAVITYVIEW_TESTS_GF_VERSION_OVERRIDE'] : \GFCommon::$version;
497
+		return ! empty( $GLOBALS[ 'GRAVITYVIEW_TESTS_GF_VERSION_OVERRIDE' ] ) ?
498
+			$GLOBALS[ 'GRAVITYVIEW_TESTS_GF_VERSION_OVERRIDE' ] : \GFCommon::$version;
499 499
 	}
500 500
 
501 501
 	/**
@@ -552,9 +552,9 @@  discard block
 block discarded – undo
552 552
 		$tables = array();
553 553
 
554 554
 		if ( version_compare( \GravityView_GFFormsModel::get_database_version(), '2.3-dev-1', '>=' ) ) {
555
-			$tables []= \GFFormsModel::get_entry_meta_table_name();
555
+			$tables [ ] = \GFFormsModel::get_entry_meta_table_name();
556 556
 		}
557
-		$tables []= \GFFormsModel::get_lead_meta_table_name();
557
+		$tables [ ] = \GFFormsModel::get_lead_meta_table_name();
558 558
 
559 559
 		foreach ( $tables as $meta_table ) {
560 560
 			$sql = "
@@ -572,13 +572,13 @@  discard block
 block discarded – undo
572 572
 		$tables = array();
573 573
 
574 574
 		if ( version_compare( \GravityView_GFFormsModel::get_database_version(), '2.3-dev-1', '>=' ) && method_exists( 'GFFormsModel', 'get_entry_notes_table_name' ) ) {
575
-			$tables[] = \GFFormsModel::get_entry_notes_table_name();
575
+			$tables[ ] = \GFFormsModel::get_entry_notes_table_name();
576 576
 		}
577 577
 
578
-		$tables[] = \GFFormsModel::get_lead_notes_table_name();
578
+		$tables[ ] = \GFFormsModel::get_lead_notes_table_name();
579 579
 
580
-		$disapproved = __('Disapproved the Entry for GravityView', 'gravityview');
581
-		$approved = __('Approved the Entry for GravityView', 'gravityview');
580
+		$disapproved = __( 'Disapproved the Entry for GravityView', 'gravityview' );
581
+		$approved = __( 'Approved the Entry for GravityView', 'gravityview' );
582 582
 
583 583
 		$suppress = $wpdb->suppress_errors();
584 584
 		foreach ( $tables as $notes_table ) {
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-other-entries.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 
26 26
 	public function __construct() {
27 27
 		$this->label = esc_html__( 'Other Entries', 'gravityview' );
28
-		$this->description = esc_html__('Display other entries created by the entry creator.', 'gravityview');
28
+		$this->description = esc_html__( 'Display other entries created by the entry creator.', 'gravityview' );
29 29
 		parent::__construct();
30 30
 	}
31 31
 
@@ -35,32 +35,32 @@  discard block
 block discarded – undo
35 35
 	 */
36 36
 	function field_options( $field_options, $template_id, $field_id, $context, $input_type ) {
37 37
 
38
-		if( 'edit' === $context ) {
38
+		if ( 'edit' === $context ) {
39 39
 			return $field_options;
40 40
 		}
41 41
 
42 42
 		// No "Link to single entry"; all the items will be links to entries!
43
-		unset( $field_options['show_as_link'] );
43
+		unset( $field_options[ 'show_as_link' ] );
44 44
 
45 45
 		$new_options = array();
46 46
 
47
-		$new_options['link_format'] = array(
47
+		$new_options[ 'link_format' ] = array(
48 48
 			'type'  => 'text',
49 49
 			'label' => __( 'Entry link text (required)', 'gravityview' ),
50
-			'value' => __('Entry #{entry_id}', 'gravityview'),
50
+			'value' => __( 'Entry #{entry_id}', 'gravityview' ),
51 51
 			'merge_tags' => 'force',
52 52
 		);
53 53
 
54
-		$new_options['after_link'] = array(
54
+		$new_options[ 'after_link' ] = array(
55 55
 			'type'  => 'textarea',
56 56
 			'label' => __( 'Text or HTML to display after the link (optional)', 'gravityview' ),
57
-			'desc'  => __('This content will be displayed below each entry link.', 'gravityview'),
57
+			'desc'  => __( 'This content will be displayed below each entry link.', 'gravityview' ),
58 58
 			'value' => '',
59 59
 			'merge_tags' => 'force',
60 60
 			'class' => 'widefat code',
61 61
 		);
62 62
 
63
-		$new_options['page_size'] = array(
63
+		$new_options[ 'page_size' ] = array(
64 64
 			'type'  => 'number',
65 65
 			'label' => __( 'Entries to Display', 'gravityview' ),
66 66
 			'desc'  => __( 'What is the maximum number of entries that should be shown?', 'gravityview' ),
@@ -68,14 +68,14 @@  discard block
 block discarded – undo
68 68
 			'merge_tags' => false,
69 69
 		);
70 70
 
71
-		$new_options['no_entries_hide'] = array(
71
+		$new_options[ 'no_entries_hide' ] = array(
72 72
 			'type'  => 'checkbox',
73 73
 			'label' => __( 'Hide if no entries', 'gravityview' ),
74 74
 			'desc'  => __( 'Don\'t display this field if the entry creator has no other entries', 'gravityview' ),
75 75
 			'value' => false,
76 76
 		);
77 77
 
78
-		$new_options['no_entries_text'] = array(
78
+		$new_options[ 'no_entries_text' ] = array(
79 79
 			'type'  => 'text',
80 80
 			'label' => __( 'No Entries Text', 'gravityview' ),
81 81
 			'desc'  => __( 'The text that is shown if the entry creator has no other entries (and "Hide if no entries" is disabled).', 'gravityview' ),
@@ -107,11 +107,11 @@  discard block
 block discarded – undo
107 107
 		foreach ( $filters as $filter ) {
108 108
 			foreach ( $wp_filter[ $filter ] as $priority => $callbacks ) {
109 109
 				foreach ( $callbacks as $id => $callback ) {
110
-					if ( ! is_array( $callback['function'] ) ) {
110
+					if ( ! is_array( $callback[ 'function' ] ) ) {
111 111
 						continue;
112 112
 					}
113
-					if ( $callback['function'][0] instanceof \GV\Widget ) {
114
-						$remove[] = array( $filter, $priority, $id );
113
+					if ( $callback[ 'function' ][ 0 ] instanceof \GV\Widget ) {
114
+						$remove[ ] = array( $filter, $priority, $id );
115 115
 					}
116 116
 				}
117 117
 			}
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 
120 120
 		foreach ( $remove as $r ) {
121 121
 			list( $filter, $priority, $id ) = $r;
122
-			$removed[] = array( $filter, $priority, $id, $wp_filter[ $filter ]->callbacks[ $priority ][ $id ] );
122
+			$removed[ ] = array( $filter, $priority, $id, $wp_filter[ $filter ]->callbacks[ $priority ][ $id ] );
123 123
 			unset( $wp_filter[ $filter ]->callbacks[ $priority ][ $id ] );
124 124
 		}
125 125
 
@@ -143,10 +143,10 @@  discard block
 block discarded – undo
143 143
 	public function filter_entries( $search_criteria, $form_id = null, $args = array(), $force_search_criteria = false ) {
144 144
 		$context = $this->context;
145 145
 
146
-		$created_by = $context->entry['created_by'];
146
+		$created_by = $context->entry[ 'created_by' ];
147 147
 
148 148
 		/** Filter entries by approved and created_by. */
149
-		$search_criteria['field_filters'][] = array(
149
+		$search_criteria[ 'field_filters' ][ ] = array(
150 150
 			'key' => 'created_by',
151 151
 			'value' => $created_by,
152 152
 			'operator' => 'is'
@@ -166,14 +166,14 @@  discard block
 block discarded – undo
166 166
 		$criteria = apply_filters( 'gravityview/field/other_entries/criteria', $search_criteria, $context->view->settings->as_atts(), $context->view->form->ID, $context );
167 167
 
168 168
 		/** Force mode all and filter out our own entry. */
169
-		$search_criteria['field_filters']['mode'] = 'all';
170
-		$search_criteria['field_filters'][] = array(
169
+		$search_criteria[ 'field_filters' ][ 'mode' ] = 'all';
170
+		$search_criteria[ 'field_filters' ][ ] = array(
171 171
 			'key' => 'id',
172 172
 			'value' => $context->entry->ID,
173 173
 			'operator' => 'isnot'
174 174
 		);
175 175
 
176
-		$search_criteria['paging']['page_size'] = $context->field->page_size ? : 10;
176
+		$search_criteria[ 'paging' ][ 'page_size' ] = $context->field->page_size ?: 10;
177 177
 
178 178
 		return $search_criteria;
179 179
 	}
Please login to merge, or discard this patch.
future/includes/rest/class-gv-rest-views-route.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 			'total' => wp_count_posts( 'gravityview' )->publish,
64 64
 		);
65 65
 		foreach ( $items as $item ) {
66
-			$data['views'][] = $this->prepare_view_for_response( $item, $request );
66
+			$data[ 'views' ][ ] = $this->prepare_view_for_response( $item, $request );
67 67
 		}
68 68
 
69 69
 		return new \WP_REST_Response( $data, 200 );
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 
83 83
 		$url = $request->get_url_params();
84 84
 
85
-		$view_id = intval( $url['id'] );
85
+		$view_id = intval( $url[ 'id' ] );
86 86
 
87 87
 		$item = get_post( $view_id );
88 88
 
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 		// Only output the fields that should be displayed.
115 115
 		$allowed = array();
116 116
 		foreach ( $view->fields->by_position( "{$context}_*" )->by_visible()->all() as $field ) {
117
-			$allowed[] = $field;
117
+			$allowed[ ] = $field;
118 118
 		}
119 119
 
120 120
 		/**
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 
134 134
 		// Tack on additional fields if needed
135 135
 		foreach ( array_diff( $allowed_field_ids, wp_list_pluck( $allowed, 'ID' ) ) as $field_id ) {
136
-			$allowed[] = is_numeric( $field_id ) ? \GV\GF_Field::by_id( $view->form, $field_id ) : \GV\Internal_Field::by_id( $field_id );
136
+			$allowed[ ] = is_numeric( $field_id ) ? \GV\GF_Field::by_id( $view->form, $field_id ) : \GV\Internal_Field::by_id( $field_id );
137 137
 		}
138 138
 
139 139
 		$r = new Request( $request );
@@ -201,10 +201,10 @@  discard block
 block discarded – undo
201 201
 	public function get_sub_items( $request ) {
202 202
 
203 203
 		$url     = $request->get_url_params();
204
-		$view_id = intval( $url['id'] );
204
+		$view_id = intval( $url[ 'id' ] );
205 205
 		$format  = \GV\Utils::get( $url, 'format', 'json' );
206 206
 
207
-		if( $post_id = $request->get_param('post_id') ) {
207
+		if ( $post_id = $request->get_param( 'post_id' ) ) {
208 208
 			global $post;
209 209
 
210 210
 			$post = get_post( $post_id );
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
 
303 303
 		$data = array( 'entries' => $entries->all(), 'total' => $entries->total() );
304 304
 
305
-		foreach ( $data['entries'] as &$entry ) {
305
+		foreach ( $data[ 'entries' ] as &$entry ) {
306 306
 			$entry = $this->prepare_entry_for_response( $view, $entry, $request, 'directory' );
307 307
 		}
308 308
 
@@ -321,8 +321,8 @@  discard block
 block discarded – undo
321 321
 	 */
322 322
 	public function get_sub_item( $request ) {
323 323
 		$url      = $request->get_url_params();
324
-		$view_id  = intval( $url['id'] );
325
-		$entry_id = intval( $url['s_id'] );
324
+		$view_id  = intval( $url[ 'id' ] );
325
+		$entry_id = intval( $url[ 's_id' ] );
326 326
 		$format   = \GV\Utils::get( $url, 'format', 'json' );
327 327
 
328 328
 		$view  = \GV\View::by_id( $view_id );
@@ -357,32 +357,32 @@  discard block
 block discarded – undo
357 357
 		// Add all the WP_Post data
358 358
 		$view_post = $view_post->to_array();
359 359
 
360
-		unset( $view_post['to_ping'], $view_post['ping_status'], $view_post['pinged'], $view_post['post_type'], $view_post['filter'], $view_post['post_category'], $view_post['tags_input'], $view_post['post_content'], $view_post['post_content_filtered'] );
360
+		unset( $view_post[ 'to_ping' ], $view_post[ 'ping_status' ], $view_post[ 'pinged' ], $view_post[ 'post_type' ], $view_post[ 'filter' ], $view_post[ 'post_category' ], $view_post[ 'tags_input' ], $view_post[ 'post_content' ], $view_post[ 'post_content_filtered' ] );
361 361
 
362 362
 		$return = wp_parse_args( $item, $view_post );
363 363
 
364
-		$return['title'] = $return['post_title'];
364
+		$return[ 'title' ] = $return[ 'post_title' ];
365 365
 
366
-		$return['settings'] = isset( $return['atts'] ) ? $return['atts'] : array();
367
-		unset( $return['atts'], $return['view_id'] );
366
+		$return[ 'settings' ] = isset( $return[ 'atts' ] ) ? $return[ 'atts' ] : array();
367
+		unset( $return[ 'atts' ], $return[ 'view_id' ] );
368 368
 
369
-		$return['search_criteria'] = array(
369
+		$return[ 'search_criteria' ] = array(
370 370
 			'page_size' => rgars( $return, 'settings/page_size' ),
371 371
 			'sort_field' => rgars( $return, 'settings/sort_field' ),
372 372
 			'sort_direction' => rgars( $return, 'settings/sort_direction' ),
373 373
 			'offset' => rgars( $return, 'settings/offset' ),
374 374
 		);
375 375
 
376
-		unset( $return['settings']['page_size'], $return['settings']['sort_field'], $return['settings']['sort_direction'] );
376
+		unset( $return[ 'settings' ][ 'page_size' ], $return[ 'settings' ][ 'sort_field' ], $return[ 'settings' ][ 'sort_direction' ] );
377 377
 
378 378
 		// Redact for non-logged ins
379 379
 		if ( ! \GVCommon::has_cap( 'edit_others_gravityviews' ) ) {
380
-			unset( $return['settings'] );
381
-			unset( $return['search_criteria'] );
380
+			unset( $return[ 'settings' ] );
381
+			unset( $return[ 'search_criteria' ] );
382 382
 		}
383 383
 		
384 384
 		if ( ! \GFCommon::current_user_can_any( 'gravityforms_edit_forms' ) ) {
385
-			unset( $return['form'] );
385
+			unset( $return[ 'form' ] );
386 386
 		}
387 387
 
388 388
 		return $return;
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
 			$view_id = func_get_arg( 1 ); // $view_id override
399 399
 		} else {
400 400
 			$url     = $request->get_url_params();
401
-			$view_id = intval( $url['id'] );
401
+			$view_id = intval( $url[ 'id' ] );
402 402
 		}
403 403
 
404 404
 		if ( ! $view = \GV\View::by_id( $view_id ) ) {
@@ -444,8 +444,8 @@  discard block
 block discarded – undo
444 444
 		}
445 445
 
446 446
 		$url     = $request->get_url_params();
447
-		$view_id = intval( $url['id'] );
448
-		$entry_id = intval( $url['s_id'] );
447
+		$view_id = intval( $url[ 'id' ] );
448
+		$entry_id = intval( $url[ 's_id' ] );
449 449
 
450 450
 		$view = \GV\View::by_id( $view_id );
451 451
 
@@ -453,11 +453,11 @@  discard block
 block discarded – undo
453 453
 			return new \WP_Error( 'rest_forbidden', 'You are not allowed to view this content.', 'gravityview' );
454 454
 		}
455 455
 
456
-		if ( $entry['form_id'] != $view->form->ID ) {
456
+		if ( $entry[ 'form_id' ] != $view->form->ID ) {
457 457
 			return new \WP_Error( 'rest_forbidden', 'You are not allowed to view this content.', 'gravityview' );
458 458
 		}
459 459
 
460
-		if ( $entry['status'] != 'active' ) {
460
+		if ( $entry[ 'status' ] != 'active' ) {
461 461
 			return new \WP_Error( 'rest_forbidden', 'You are not allowed to view this content.', 'gravityview' );
462 462
 		}
463 463
 
@@ -465,10 +465,10 @@  discard block
 block discarded – undo
465 465
 			return new \WP_Error( 'rest_forbidden', 'You are not allowed to view this content.', 'gravityview' );
466 466
 		}
467 467
 
468
-		$is_admin_and_can_view = $view->settings->get( 'admin_show_all_statuses' ) && \GVCommon::has_cap('gravityview_moderate_entries', $view->ID );
468
+		$is_admin_and_can_view = $view->settings->get( 'admin_show_all_statuses' ) && \GVCommon::has_cap( 'gravityview_moderate_entries', $view->ID );
469 469
 
470 470
 		if ( $view->settings->get( 'show_only_approved' ) && ! $is_admin_and_can_view ) {
471
-			if ( ! \GravityView_Entry_Approval_Status::is_approved( gform_get_meta( $entry->ID, \GravityView_Entry_Approval::meta_key ) )  ) {
471
+			if ( ! \GravityView_Entry_Approval_Status::is_approved( gform_get_meta( $entry->ID, \GravityView_Entry_Approval::meta_key ) ) ) {
472 472
 				return new \WP_Error( 'rest_forbidden', 'You are not allowed to view this content.', 'gravityview' );
473 473
 			}
474 474
 		}
Please login to merge, or discard this patch.
includes/admin/class-gravityview-support-port.php 2 patches
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 
14 14
 	/**
15 15
 	 * @var string The hash key used to generate secure message history
16
-     * @since 2.2.5
16
+	 * @since 2.2.5
17 17
 	 */
18 18
 	const beacon_key = 'lCXlwbQR707kipR+J0MCqcxrhGOHjGF0ldD6yNbGM0w=';
19 19
 
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 			'payment_id'       => '',
111 111
 			'customer_name'    => '',
112 112
 			'customer_email'   => '',
113
-            'price_id'         => '0',
113
+			'price_id'         => '0',
114 114
 		) );
115 115
 
116 116
 		// This is just HTML we don't need.
@@ -127,9 +127,9 @@  discard block
 block discarded – undo
127 127
 			case 3:
128 128
 				$package = 'All Access';
129 129
 				break;
130
-            case 4:
131
-                $package = 'Lifetime';
132
-                break;
130
+			case 4:
131
+				$package = 'Lifetime';
132
+				break;
133 133
 		}
134 134
 
135 135
 		$current_user = wp_get_current_user();
@@ -159,27 +159,27 @@  discard block
 block discarded – undo
159 159
 		// Help Scout length limit is 200 characters
160 160
 		foreach( $data as $key => $value ) {
161 161
 			if ( ! is_string( $value ) ) {
162
-                continue;
162
+				continue;
163 163
 			}
164
-		    $data[ $key ] = mb_substr( $value, 0, 200 );
165
-        }
164
+			$data[ $key ] = mb_substr( $value, 0, 200 );
165
+		}
166 166
 
167 167
 		$localization_data = array(
168 168
 			'contactEnabled' => (int)GVCommon::has_cap( 'gravityview_contact_support' ),
169 169
 			'data' => $data,
170 170
 			'translation' => $translation,
171
-            'suggest' => array(),
171
+			'suggest' => array(),
172 172
 		);
173 173
 
174 174
 		/**
175
-         * @filter `gravityview/support_port/localization_data` Filter data passed to the Support Port, before localize_script is run
175
+		 * @filter `gravityview/support_port/localization_data` Filter data passed to the Support Port, before localize_script is run
176 176
 		 * @since 2.0
177
-         * @param array $localization_data {
178
-         *   @type int $contactEnabled Can the user contact support?
179
-         *   @type array $data Support/license info
180
-         *   @type array $translation i18n strings
181
-         *   @type array $suggest Article IDs to recommend to the user (per page in the admin
182
-         * }
177
+		 * @param array $localization_data {
178
+		 *   @type int $contactEnabled Can the user contact support?
179
+		 *   @type array $data Support/license info
180
+		 *   @type array $translation i18n strings
181
+		 *   @type array $suggest Article IDs to recommend to the user (per page in the admin
182
+		 * }
183 183
 		 */
184 184
 		$localization_data = apply_filters( 'gravityview/support_port/localization_data', $localization_data );
185 185
 
@@ -193,11 +193,11 @@  discard block
 block discarded – undo
193 193
 	 *
194 194
 	 * If the user doesn't have the `gravityview_support_port` capability, returns false; then
195 195
 	 * If global setting is "hide", returns false; then
196
-     * If user preference is not set, return global setting; then
197
-     * If user preference is set, return that setting.
196
+	 * If user preference is not set, return global setting; then
197
+	 * If user preference is set, return that setting.
198 198
 	 *
199 199
 	 * @since 1.15
200
-     * @since 1.17.5 Changed behavior to respect global setting
200
+	 * @since 1.17.5 Changed behavior to respect global setting
201 201
 	 *
202 202
 	 * @param int $user Optional. ID of the user to check, defaults to 0 for current user.
203 203
 	 *
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 		$global_setting = gravityview()->plugin->settings->get( 'support_port' );
213 213
 
214 214
 		if ( empty( $global_setting ) ) {
215
-            return false;
215
+			return false;
216 216
 		}
217 217
 
218 218
 		// Get the per-user Support Port setting
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
 	 * Modifies the output of profile.php to add GravityView Support preference
249 249
 	 *
250 250
 	 * @since 1.15
251
-     * @since 1.17.5 Only show if global setting is active
251
+	 * @since 1.17.5 Only show if global setting is active
252 252
 	 *
253 253
 	 * @param WP_User $user Current user info
254 254
 	 *
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
 		$global_setting = gravityview()->plugin->settings->get( 'support_port' );
260 260
 
261 261
 		if ( empty( $global_setting ) ) {
262
-            return;
262
+			return;
263 263
 		}
264 264
 
265 265
 		/**
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -114,9 +114,9 @@  discard block
 block discarded – undo
114 114
 		) );
115 115
 
116 116
 		// This is just HTML we don't need.
117
-		unset( $response['message'] );
117
+		unset( $response[ 'message' ] );
118 118
 
119
-		switch ( intval( $response['price_id'] ) ) {
119
+		switch ( intval( $response[ 'price_id' ] ) ) {
120 120
 			default:
121 121
 			case 1:
122 122
 				$package = 'Core';
@@ -142,12 +142,12 @@  discard block
 block discarded – undo
142 142
 			'email'                 => $current_user->user_email,
143 143
 			'name'                  => mb_substr( $current_user->display_name, 0, 80 ),
144 144
 			'signature'             => hash_hmac( 'sha256', $current_user->user_email, self::beacon_key ),
145
-			'License Key'           => $response['license_key'] . ' (' . ucwords( $response['license'] ) . ')',
145
+			'License Key'           => $response[ 'license_key' ] . ' (' . ucwords( $response[ 'license' ] ) . ')',
146 146
 			'License Level'         => $package,
147 147
 			'Alt Emails'            => sprintf( "Admin: %s, GV Support: %s", get_bloginfo( 'admin_email' ), gravityview()->plugin->settings->get( 'support-email' ) ),
148
-			'Payment Details'       => $response['customer_name'] . ' ' . $response['customer_email'],
148
+			'Payment Details'       => $response[ 'customer_name' ] . ' ' . $response[ 'customer_email' ],
149 149
 			'WordPress Version'     => get_bloginfo( 'version', 'display' ),
150
-			'PHP Version'           => phpversion() . ' on ' . esc_html( $_SERVER['SERVER_SOFTWARE'] ),
150
+			'PHP Version'           => phpversion() . ' on ' . esc_html( $_SERVER[ 'SERVER_SOFTWARE' ] ),
151 151
 			'No-Conflict Mode'      => empty( $no_conflict_mode ) ? 'Disabled' : 'Enabled',
152 152
 			'GravityView Version'   => \GV\Plugin::$version,
153 153
 			'Gravity Forms Version' => GFForms::$version,
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 		ob_get_clean();
158 158
 
159 159
 		// Help Scout length limit is 200 characters
160
-		foreach( $data as $key => $value ) {
160
+		foreach ( $data as $key => $value ) {
161 161
 			if ( ! is_string( $value ) ) {
162 162
                 continue;
163 163
 			}
Please login to merge, or discard this patch.
includes/admin/class.render.settings.php 1 patch
Spacing   +74 added lines, -74 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 
28 28
 		$field_options = array();
29 29
 
30
-		if( 'field' === $field_type ) {
30
+		if ( 'field' === $field_type ) {
31 31
 
32 32
 			// Default options - fields
33 33
 			$field_options = array(
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 				'custom_class' => array(
46 46
 					'type' => 'text',
47 47
 					'label' => __( 'Custom CSS Class:', 'gravityview' ),
48
-					'desc' => __( 'This class will be added to the field container', 'gravityview'),
48
+					'desc' => __( 'This class will be added to the field container', 'gravityview' ),
49 49
 					'value' => '',
50 50
 					'merge_tags' => true,
51 51
 					'tooltip' => 'gv_css_merge_tags',
@@ -65,11 +65,11 @@  discard block
 block discarded – undo
65 65
 			);
66 66
 
67 67
 			// Match Table as well as DataTables
68
-			if( preg_match( '/table/ism', $template_id ) && 'directory' === $context ) {
69
-				$field_options['width'] = array(
68
+			if ( preg_match( '/table/ism', $template_id ) && 'directory' === $context ) {
69
+				$field_options[ 'width' ] = array(
70 70
 					'type' => 'number',
71
-					'label' => __('Percent Width', 'gravityview'),
72
-					'desc' => __( 'Leave blank for column width to be based on the field content.', 'gravityview'),
71
+					'label' => __( 'Percent Width', 'gravityview' ),
72
+					'desc' => __( 'Leave blank for column width to be based on the field content.', 'gravityview' ),
73 73
 					'class' => 'code widefat',
74 74
 					'value' => '',
75 75
 				);
@@ -122,8 +122,8 @@  discard block
 block discarded – undo
122 122
 			'manage_options' => __( 'Administrator', 'gravityview' ),
123 123
 		);
124 124
 
125
-		if( is_multisite() ) {
126
-			$select_cap_choices['manage_network'] = __('Multisite Super Admin', 'gravityview' );
125
+		if ( is_multisite() ) {
126
+			$select_cap_choices[ 'manage_network' ] = __( 'Multisite Super Admin', 'gravityview' );
127 127
 		}
128 128
 
129 129
 		/**
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 		 * @param  string $context     Optional. What context are we in? Example: `single` or `directory`
137 137
 		 * @param  string $input_type  Optional. (textarea, list, select, etc.)
138 138
 		 */
139
-		$select_cap_choices = apply_filters('gravityview_field_visibility_caps', $select_cap_choices, $template_id, $field_id, $context, $input_type );
139
+		$select_cap_choices = apply_filters( 'gravityview_field_visibility_caps', $select_cap_choices, $template_id, $field_id, $context, $input_type );
140 140
 
141 141
 		return $select_cap_choices;
142 142
 	}
@@ -164,27 +164,27 @@  discard block
 block discarded – undo
164 164
 	 */
165 165
 	public static function render_field_options( $form_id, $field_type, $template_id, $field_id, $field_label, $area, $input_type = NULL, $uniqid = '', $current = '', $context = 'single', $item = array() ) {
166 166
 
167
-		if( empty( $uniqid ) ) {
167
+		if ( empty( $uniqid ) ) {
168 168
 			//generate a unique field id
169
-			$uniqid = uniqid('', false);
169
+			$uniqid = uniqid( '', false );
170 170
 		}
171 171
 
172 172
 		// get field/widget options
173 173
 		$options = self::get_default_field_options( $field_type, $template_id, $field_id, $context, $input_type );
174 174
 
175 175
 		// two different post arrays, depending of the field type
176
-		$name_prefix = $field_type .'s' .'['. $area .']['. $uniqid .']';
176
+		$name_prefix = $field_type . 's' . '[' . $area . '][' . $uniqid . ']';
177 177
 
178 178
 		// build output
179 179
 		$output = '';
180
-		$output .= '<input type="hidden" class="field-key" name="'. $name_prefix .'[id]" value="'. esc_attr( $field_id ) .'">';
181
-		$output .= '<input type="hidden" class="field-label" name="'. $name_prefix .'[label]" value="'. esc_attr( $field_label ) .'">';
180
+		$output .= '<input type="hidden" class="field-key" name="' . $name_prefix . '[id]" value="' . esc_attr( $field_id ) . '">';
181
+		$output .= '<input type="hidden" class="field-label" name="' . $name_prefix . '[label]" value="' . esc_attr( $field_label ) . '">';
182 182
 		if ( $form_id ) {
183
-			$output .= '<input type="hidden" class="field-form-id" name="'. $name_prefix .'[form_id]" value="'. esc_attr( $form_id ) .'">';
183
+			$output .= '<input type="hidden" class="field-form-id" name="' . $name_prefix . '[form_id]" value="' . esc_attr( $form_id ) . '">';
184 184
 		}
185 185
 
186 186
 		// If there are no options, return what we got.
187
-		if(empty($options)) {
187
+		if ( empty( $options ) ) {
188 188
 
189 189
 			// This is here for checking if the output is empty in render_label()
190 190
 			$output .= '<!-- No Options -->';
@@ -192,33 +192,33 @@  discard block
 block discarded – undo
192 192
 			return $output;
193 193
 		}
194 194
 
195
-		$output .= '<div class="gv-dialog-options" title="'. esc_attr( sprintf( __( 'Options: %s', 'gravityview' ) , strip_tags( html_entity_decode( $field_label ) ) ) ) .'">';
195
+		$output .= '<div class="gv-dialog-options" title="' . esc_attr( sprintf( __( 'Options: %s', 'gravityview' ), strip_tags( html_entity_decode( $field_label ) ) ) ) . '">';
196 196
 
197 197
 		/**
198 198
 		 * @since 1.8
199 199
 		 */
200
-		if( !empty( $item['subtitle'] ) ) {
201
-			$output .= '<div class="subtitle">' . $item['subtitle'] . '</div>';
200
+		if ( ! empty( $item[ 'subtitle' ] ) ) {
201
+			$output .= '<div class="subtitle">' . $item[ 'subtitle' ] . '</div>';
202 202
 		}
203 203
 
204
-		foreach( $options as $key => $option ) {
204
+		foreach ( $options as $key => $option ) {
205 205
 
206 206
 			$value = isset( $current[ $key ] ) ? $current[ $key ] : NULL;
207 207
 
208
-			$field_output = self::render_field_option( $name_prefix . '['. $key .']' , $option, $value);
208
+			$field_output = self::render_field_option( $name_prefix . '[' . $key . ']', $option, $value );
209 209
 
210 210
 			// The setting is empty
211
-			if( empty( $field_output ) ) {
211
+			if ( empty( $field_output ) ) {
212 212
 				continue;
213 213
 			}
214 214
 
215
-			switch( $option['type'] ) {
215
+			switch ( $option[ 'type' ] ) {
216 216
 				// Hide hidden fields
217 217
 				case 'hidden':
218
-					$output .= '<div class="gv-setting-container gv-setting-container-'. esc_attr( $key ) . ' screen-reader-text">'. $field_output . '</div>';
218
+					$output .= '<div class="gv-setting-container gv-setting-container-' . esc_attr( $key ) . ' screen-reader-text">' . $field_output . '</div>';
219 219
 					break;
220 220
 				default:
221
-					$output .= '<div class="gv-setting-container gv-setting-container-'. esc_attr( $key ) . '">'. $field_output .'</div>';
221
+					$output .= '<div class="gv-setting-container gv-setting-container-' . esc_attr( $key ) . '">' . $field_output . '</div>';
222 222
 			}
223 223
 		}
224 224
 
@@ -247,17 +247,17 @@  discard block
 block discarded – undo
247 247
 		 * @deprecated setting index 'default' was replaced by 'value'
248 248
 		 * @see GravityView_FieldType::get_field_defaults
249 249
 		 */
250
-		if( !empty( $option['default'] ) && empty( $option['value'] ) ) {
251
-			$option['value'] = $option['default'];
252
-			_deprecated_function( 'GravityView_FieldType::get_field_defaults', '1.1.7', '[value] instead of [default] when defining the setting '. $name .' details' );
250
+		if ( ! empty( $option[ 'default' ] ) && empty( $option[ 'value' ] ) ) {
251
+			$option[ 'value' ] = $option[ 'default' ];
252
+			_deprecated_function( 'GravityView_FieldType::get_field_defaults', '1.1.7', '[value] instead of [default] when defining the setting ' . $name . ' details' );
253 253
 		}
254 254
 
255 255
 		// prepare to render option field type
256
-		if( isset( $option['type'] ) ) {
256
+		if ( isset( $option[ 'type' ] ) ) {
257 257
 
258 258
 			$type_class = self::load_type_class( $option );
259 259
 
260
-			if( class_exists( $type_class ) ) {
260
+			if ( class_exists( $type_class ) ) {
261 261
 
262 262
 				/** @var GravityView_FieldType $render_type */
263 263
 				$render_type = new $type_class( $name, $option, $curr_value );
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
 				 * @param[in,out] string $output field class name
275 275
 				 * @param[in] array $option  option field data
276 276
 				 */
277
-				$output = apply_filters( "gravityview/option/output/{$option['type']}" , $output, $option );
277
+				$output = apply_filters( "gravityview/option/output/{$option[ 'type' ]}", $output, $option );
278 278
 			}
279 279
 
280 280
 		} // isset option[type]
@@ -309,27 +309,27 @@  discard block
 block discarded – undo
309 309
 		 * @deprecated setting index 'name' was replaced by 'label'
310 310
 		 * @see GravityView_FieldType::get_field_defaults
311 311
 		 */
312
-		if( isset( $setting['name'] ) && empty( $setting['label'] ) ) {
313
-			$setting['label'] = $setting['name'];
314
-			_deprecated_function( 'GravityView_FieldType::get_field_defaults', '1.1.7', '[label] instead of [name] when defining the setting '. $key .' details' );
312
+		if ( isset( $setting[ 'name' ] ) && empty( $setting[ 'label' ] ) ) {
313
+			$setting[ 'label' ] = $setting[ 'name' ];
314
+			_deprecated_function( 'GravityView_FieldType::get_field_defaults', '1.1.7', '[label] instead of [name] when defining the setting ' . $key . ' details' );
315 315
 		}
316 316
 
317 317
 		$name = esc_attr( sprintf( $name, $key ) );
318
-		$setting['id'] = esc_attr( sprintf( $id, $key ) );
319
-		$setting['tooltip'] = 'gv_' . $key;
318
+		$setting[ 'id' ] = esc_attr( sprintf( $id, $key ) );
319
+		$setting[ 'tooltip' ] = 'gv_' . $key;
320 320
 
321 321
 		// Use default if current setting isn't set.
322
-		$curr_value = isset( $current_settings[ $key ] ) ? $current_settings[ $key ] : $setting['value'];
322
+		$curr_value = isset( $current_settings[ $key ] ) ? $current_settings[ $key ] : $setting[ 'value' ];
323 323
 
324 324
 		// default setting type = text
325
-		$setting['type'] = empty( $setting['type'] ) ? 'text' : $setting['type'];
325
+		$setting[ 'type' ] = empty( $setting[ 'type' ] ) ? 'text' : $setting[ 'type' ];
326 326
 
327 327
 		// merge tags
328
-		if( !isset( $setting['merge_tags'] ) ) {
329
-			if( $setting['type'] === 'text' ) {
330
-				$setting['merge_tags'] = true;
328
+		if ( ! isset( $setting[ 'merge_tags' ] ) ) {
329
+			if ( $setting[ 'type' ] === 'text' ) {
330
+				$setting[ 'merge_tags' ] = true;
331 331
 			} else {
332
-				$setting['merge_tags'] = false;
332
+				$setting[ 'merge_tags' ] = false;
333 333
 			}
334 334
 		}
335 335
 
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
 
338 338
 		// render the setting
339 339
 		$type_class = self::load_type_class( $setting );
340
-		if( class_exists( $type_class ) ) {
340
+		if ( class_exists( $type_class ) ) {
341 341
 			/** @var GravityView_FieldType $render_type */
342 342
 			$render_type = new $type_class( $name, $setting, $curr_value );
343 343
 			ob_start();
@@ -346,25 +346,25 @@  discard block
 block discarded – undo
346 346
 		}
347 347
 
348 348
 		// Check if setting is specific for a template
349
-		if( !empty( $setting['show_in_template'] ) ) {
350
-			if( !is_array( $setting['show_in_template'] ) ) {
351
-				$setting['show_in_template'] = array( $setting['show_in_template'] );
349
+		if ( ! empty( $setting[ 'show_in_template' ] ) ) {
350
+			if ( ! is_array( $setting[ 'show_in_template' ] ) ) {
351
+				$setting[ 'show_in_template' ] = array( $setting[ 'show_in_template' ] );
352 352
 			}
353
-			$show_if = ' data-show-if="'. implode( ' ', $setting['show_in_template'] ).'"';
353
+			$show_if = ' data-show-if="' . implode( ' ', $setting[ 'show_in_template' ] ) . '"';
354 354
 		} else {
355 355
 			$show_if = '';
356 356
 		}
357 357
 
358
-		if( ! empty( $setting['requires'] ) ) {
359
-			$show_if .= sprintf( ' data-requires="%s"', $setting['requires'] );
358
+		if ( ! empty( $setting[ 'requires' ] ) ) {
359
+			$show_if .= sprintf( ' data-requires="%s"', $setting[ 'requires' ] );
360 360
 		}
361 361
 
362
-		if( ! empty( $setting['requires_not'] ) ) {
363
-			$show_if .= sprintf( ' data-requires-not="%s"', $setting['requires_not'] );
362
+		if ( ! empty( $setting[ 'requires_not' ] ) ) {
363
+			$show_if .= sprintf( ' data-requires-not="%s"', $setting[ 'requires_not' ] );
364 364
 		}
365 365
 
366 366
 		// output
367
-		echo '<tr valign="top" '. $show_if .'>' . $output . '</tr>';
367
+		echo '<tr valign="top" ' . $show_if . '>' . $output . '</tr>';
368 368
 
369 369
 	}
370 370
 
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
 	 */
377 377
 	public static function load_type_class( $field = NULL ) {
378 378
 
379
-		if( empty( $field['type'] ) ) {
379
+		if ( empty( $field[ 'type' ] ) ) {
380 380
 			return NULL;
381 381
 		}
382 382
 
@@ -385,19 +385,19 @@  discard block
 block discarded – undo
385 385
 		 * @param string $class_suffix  field class suffix; `GravityView_FieldType_{$class_suffix}`
386 386
 		 * @param array $field   field data
387 387
 		 */
388
-		$type_class = apply_filters( "gravityview/setting/class/{$field['type']}", 'GravityView_FieldType_' . $field['type'], $field );
388
+		$type_class = apply_filters( "gravityview/setting/class/{$field[ 'type' ]}", 'GravityView_FieldType_' . $field[ 'type' ], $field );
389 389
 
390
-		if( !class_exists( $type_class ) ) {
390
+		if ( ! class_exists( $type_class ) ) {
391 391
 
392 392
 			/**
393 393
 			 * @filter `gravityview/setting/class_file/{field_type}`
394 394
 			 * @param string  $field_type_include_path field class file path
395 395
 			 * @param array $field  field data
396 396
 			 */
397
-			$class_file = apply_filters( "gravityview/setting/class_file/{$field['type']}", GRAVITYVIEW_DIR . "includes/admin/field-types/type_{$field['type']}.php", $field );
397
+			$class_file = apply_filters( "gravityview/setting/class_file/{$field[ 'type' ]}", GRAVITYVIEW_DIR . "includes/admin/field-types/type_{$field[ 'type' ]}.php", $field );
398 398
 
399
-			if( $class_file ) {
400
-				if( file_exists( $class_file ) ) {
399
+			if ( $class_file ) {
400
+				if ( file_exists( $class_file ) ) {
401 401
 					require_once( $class_file );
402 402
 				}
403 403
 			}
@@ -422,8 +422,8 @@  discard block
 block discarded – undo
422 422
 
423 423
 		_deprecated_function( __METHOD__, '1.2', 'GravityView_FieldType_checkbox::render_input' );
424 424
 
425
-		$output  = '<input name="'. esc_attr( $name ) .'" type="hidden" value="0">';
426
-		$output .= '<input name="'. esc_attr( $name ) .'" id="'. esc_attr( $id ) .'" type="checkbox" value="1" '. checked( $current, '1', false ) .' >';
425
+		$output  = '<input name="' . esc_attr( $name ) . '" type="hidden" value="0">';
426
+		$output .= '<input name="' . esc_attr( $name ) . '" id="' . esc_attr( $id ) . '" type="checkbox" value="1" ' . checked( $current, '1', false ) . ' >';
427 427
 
428 428
 		return $output;
429 429
 	}
@@ -443,22 +443,22 @@  discard block
 block discarded – undo
443 443
 		_deprecated_function( __METHOD__, '1.2', 'GravityView_FieldType_text::render_input' );
444 444
 
445 445
 		// Show the merge tags if the field is a list view
446
-		$is_list = ( preg_match( '/_list-/ism', $name ));
446
+		$is_list = ( preg_match( '/_list-/ism', $name ) );
447 447
 
448 448
 		// Or is a single entry view
449
-		$is_single = ( preg_match( '/single_/ism', $name ));
449
+		$is_single = ( preg_match( '/single_/ism', $name ) );
450 450
 		$show = ( $is_single || $is_list );
451 451
 
452 452
 		$class = '';
453 453
 		// and $add_merge_tags is not false
454
-		if( $show && $add_merge_tags !== false || $add_merge_tags === 'force' ) {
454
+		if ( $show && $add_merge_tags !== false || $add_merge_tags === 'force' ) {
455 455
 			$class = 'merge-tag-support mt-position-right mt-hide_all_fields ';
456 456
 		}
457 457
 
458
-		$class .= !empty( $args['class'] ) ? $args['class'] : 'widefat';
459
-		$type = !empty( $args['type'] ) ? $args['type'] : 'text';
458
+		$class .= ! empty( $args[ 'class' ] ) ? $args[ 'class' ] : 'widefat';
459
+		$type = ! empty( $args[ 'type' ] ) ? $args[ 'type' ] : 'text';
460 460
 
461
-		return '<input name="'. esc_attr( $name ) .'" id="'. esc_attr( $id ) .'" type="'.esc_attr($type).'" value="'. esc_attr( $current ) .'" class="'.esc_attr( $class ).'">';
461
+		return '<input name="' . esc_attr( $name ) . '" id="' . esc_attr( $id ) . '" type="' . esc_attr( $type ) . '" value="' . esc_attr( $current ) . '" class="' . esc_attr( $class ) . '">';
462 462
 	}
463 463
 
464 464
 	/**
@@ -475,21 +475,21 @@  discard block
 block discarded – undo
475 475
 		_deprecated_function( __METHOD__, '1.2', 'GravityView_FieldType_textarea::render_input' );
476 476
 
477 477
 		// Show the merge tags if the field is a list view
478
-		$is_list = ( preg_match( '/_list-/ism', $name ));
478
+		$is_list = ( preg_match( '/_list-/ism', $name ) );
479 479
 
480 480
 		// Or is a single entry view
481
-		$is_single = ( preg_match( '/single_/ism', $name ));
481
+		$is_single = ( preg_match( '/single_/ism', $name ) );
482 482
 		$show = ( $is_single || $is_list );
483 483
 
484 484
 		$class = '';
485 485
 		// and $add_merge_tags is not false
486
-		if( $show && $add_merge_tags !== false || $add_merge_tags === 'force' ) {
486
+		if ( $show && $add_merge_tags !== false || $add_merge_tags === 'force' ) {
487 487
 			$class = 'merge-tag-support mt-position-right mt-hide_all_fields ';
488 488
 		}
489 489
 
490
-		$class .= !empty( $args['class'] ) ? 'widefat '.$args['class'] : 'widefat';
490
+		$class .= ! empty( $args[ 'class' ] ) ? 'widefat ' . $args[ 'class' ] : 'widefat';
491 491
 
492
-		return '<textarea name="'. esc_attr( $name ) .'" id="'. esc_attr( $id ) .'" class="'.esc_attr( $class ).'">'. esc_textarea( $current ) .'</textarea>';
492
+		return '<textarea name="' . esc_attr( $name ) . '" id="' . esc_attr( $id ) . '" class="' . esc_attr( $class ) . '">' . esc_textarea( $current ) . '</textarea>';
493 493
 	}
494 494
 
495 495
 	/**
@@ -505,9 +505,9 @@  discard block
 block discarded – undo
505 505
 
506 506
 		_deprecated_function( __METHOD__, '1.2', 'GravityView_FieldType_select::render_input' );
507 507
 
508
-		$output = '<select name="'. $name .'" id="'. $id .'">';
509
-		foreach( $choices as $value => $label ) {
510
-			$output .= '<option value="'. esc_attr( $value ) .'" '. selected( $value, $current, false ) .'>'. esc_html( $label ) .'</option>';
508
+		$output = '<select name="' . $name . '" id="' . $id . '">';
509
+		foreach ( $choices as $value => $label ) {
510
+			$output .= '<option value="' . esc_attr( $value ) . '" ' . selected( $value, $current, false ) . '>' . esc_html( $label ) . '</option>';
511 511
 		}
512 512
 		$output .= '</select>';
513 513
 
Please login to merge, or discard this patch.
includes/admin/metaboxes/views/sort-filter.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -28,18 +28,18 @@
 block discarded – undo
28 28
 
29 29
 	$sort_fields_input = '<select name="template_settings[sort_field][]" class="gravityview_sort_field" id="gravityview_sort_field_%d">%s</select>';
30 30
 
31
-	if ( is_array( $current_settings['sort_field'] ) ) {
32
-		$primary_sort_fields = gravityview_get_sortable_fields( $curr_form, $current_settings['sort_field'][0] );
33
-		$secondary_sort_fields = gravityview_get_sortable_fields( $curr_form, $current_settings['sort_field'][1] );
31
+	if ( is_array( $current_settings[ 'sort_field' ] ) ) {
32
+		$primary_sort_fields = gravityview_get_sortable_fields( $curr_form, $current_settings[ 'sort_field' ][ 0 ] );
33
+		$secondary_sort_fields = gravityview_get_sortable_fields( $curr_form, $current_settings[ 'sort_field' ][ 1 ] );
34 34
 	} else {
35
-		$primary_sort_fields = $secondary_sort_fields = gravityview_get_sortable_fields( $curr_form, $current_settings['sort_field'] );
35
+		$primary_sort_fields = $secondary_sort_fields = gravityview_get_sortable_fields( $curr_form, $current_settings[ 'sort_field' ] );
36 36
 	}
37 37
 
38 38
 	// Splice the sort direction
39 39
 	$_directions = array();
40 40
 	foreach ( (array)\GV\Utils::get( $current_settings, 'sort_direction', array() ) as $i => $direction ) {
41 41
 		if ( ! $i ) {
42
-			$_directions['sort_direction'] = $direction;
42
+			$_directions[ 'sort_direction' ] = $direction;
43 43
 		} else {
44 44
 			$_directions[ sprintf( 'sort_direction_%d', $i + 1 ) ] = $direction;
45 45
 		}
Please login to merge, or discard this patch.