Completed
Push — develop ( f631c3...e2f243 )
by Zack
18:00
created
includes/fields/class-gravityview-field-id.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
 		}
34 34
 
35 35
 		if ( 'single' === $context ) {
36
-			unset( $field_options['new_window'] );
36
+			unset( $field_options[ 'new_window' ] );
37 37
 		}
38 38
 
39 39
 		return $field_options;
Please login to merge, or discard this patch.
includes/widgets/class-gravityview-widget-custom-content.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 
20 20
 	function __construct() {
21 21
 
22
-		$this->widget_description = __('Insert custom text or HTML as a widget', 'gravityview' );
22
+		$this->widget_description = __( 'Insert custom text or HTML as a widget', 'gravityview' );
23 23
 
24 24
 		$default_values = array(
25 25
 			'header' => 1,
@@ -44,39 +44,39 @@  discard block
 block discarded – undo
44 44
 			),
45 45
 		);
46 46
 
47
-		parent::__construct( __( 'Custom Content', 'gravityview' ) , 'custom_content', $default_values, $settings );
47
+		parent::__construct( __( 'Custom Content', 'gravityview' ), 'custom_content', $default_values, $settings );
48 48
 	}
49 49
 
50
-	public function render_frontend( $widget_args, $content = '', $context = '') {
50
+	public function render_frontend( $widget_args, $content = '', $context = '' ) {
51 51
 
52
-		if( !$this->pre_render_frontend() ) {
52
+		if ( ! $this->pre_render_frontend() ) {
53 53
 			return;
54 54
 		}
55 55
 
56
-		if( !empty( $widget_args['title'] ) ) {
57
-			echo $widget_args['title'];
56
+		if ( ! empty( $widget_args[ 'title' ] ) ) {
57
+			echo $widget_args[ 'title' ];
58 58
 		}
59 59
 
60 60
 
61 61
 		// Make sure the class is loaded in DataTables
62
-		if( !class_exists( 'GFFormDisplay' ) ) {
62
+		if ( ! class_exists( 'GFFormDisplay' ) ) {
63 63
 			include_once( GFCommon::get_base_path() . '/form_display.php' );
64 64
 		}
65 65
 
66
-		$widget_args['content'] = trim( rtrim( \GV\Utils::get( $widget_args, 'content' ) ) );
66
+		$widget_args[ 'content' ] = trim( rtrim( \GV\Utils::get( $widget_args, 'content' ) ) );
67 67
 
68 68
 		// No custom content
69
-		if( empty( $widget_args['content'] ) ) {
69
+		if ( empty( $widget_args[ 'content' ] ) ) {
70 70
 			gravityview()->log->debug( 'No content.' );
71 71
 			return;
72 72
 		}
73 73
 
74 74
 		// Add paragraphs?
75
-		if( !empty( $widget_args['wpautop'] ) ) {
76
-			$widget_args['content'] = wpautop( $widget_args['content'] );
75
+		if ( ! empty( $widget_args[ 'wpautop' ] ) ) {
76
+			$widget_args[ 'content' ] = wpautop( $widget_args[ 'content' ] );
77 77
 		}
78 78
 
79
-		$content = $widget_args['content'];
79
+		$content = $widget_args[ 'content' ];
80 80
 
81 81
 		$content = GravityView_Merge_Tags::replace_variables( $content, array(), array(), false, true, false );
82 82
 
@@ -86,10 +86,10 @@  discard block
 block discarded – undo
86 86
 
87 87
 
88 88
 		// Add custom class
89
-		$class = !empty( $widget_args['custom_class'] ) ? $widget_args['custom_class'] : '';
89
+		$class = ! empty( $widget_args[ 'custom_class' ] ) ? $widget_args[ 'custom_class' ] : '';
90 90
 		$class = gravityview_sanitize_html_class( $class );
91 91
 
92
-		echo '<div class="gv-widget-custom-content '.$class.'">'. $content .'</div>';
92
+		echo '<div class="gv-widget-custom-content ' . $class . '">' . $content . '</div>';
93 93
 
94 94
 	}
95 95
 
Please login to merge, or discard this patch.
includes/widgets/register-gravityview-widgets.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -16,17 +16,17 @@
 block discarded – undo
16 16
  */
17 17
 function gravityview_register_gravityview_widgets() {
18 18
 
19
-	include_once( GRAVITYVIEW_DIR .'includes/widgets/class-gravityview-widget.php' );
19
+	include_once( GRAVITYVIEW_DIR . 'includes/widgets/class-gravityview-widget.php' );
20 20
 
21
-	include_once( GRAVITYVIEW_DIR .'includes/widgets/search-widget/class-search-widget.php' );
22
-	include_once( GRAVITYVIEW_DIR .'includes/widgets/class-gravityview-widget-custom-content.php' );
23
-	include_once( GRAVITYVIEW_DIR .'includes/widgets/class-gravityview-widget-gravityforms.php' );
24
-	include_once( GRAVITYVIEW_DIR .'includes/widgets/class-gravityview-widget-page-size.php' );
25
-	include_once( GRAVITYVIEW_DIR .'includes/widgets/class-gravityview-widget-pagination-info.php' );
26
-	include_once( GRAVITYVIEW_DIR .'includes/widgets/class-gravityview-widget-page-links.php' );
21
+	include_once( GRAVITYVIEW_DIR . 'includes/widgets/search-widget/class-search-widget.php' );
22
+	include_once( GRAVITYVIEW_DIR . 'includes/widgets/class-gravityview-widget-custom-content.php' );
23
+	include_once( GRAVITYVIEW_DIR . 'includes/widgets/class-gravityview-widget-gravityforms.php' );
24
+	include_once( GRAVITYVIEW_DIR . 'includes/widgets/class-gravityview-widget-page-size.php' );
25
+	include_once( GRAVITYVIEW_DIR . 'includes/widgets/class-gravityview-widget-pagination-info.php' );
26
+	include_once( GRAVITYVIEW_DIR . 'includes/widgets/class-gravityview-widget-page-links.php' );
27 27
 
28
-	if( class_exists('GFPolls') ) {
29
-		include_once( GRAVITYVIEW_DIR .'includes/widgets/poll/class-gravityview-widget-poll.php' );
28
+	if ( class_exists( 'GFPolls' ) ) {
29
+		include_once( GRAVITYVIEW_DIR . 'includes/widgets/poll/class-gravityview-widget-poll.php' );
30 30
 	}
31 31
 
32 32
 }
Please login to merge, or discard this patch.
includes/admin/class-gravityview-admin-view-item.php 1 patch
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -44,12 +44,12 @@  discard block
 block discarded – undo
44 44
 	 */
45 45
 	protected $form_id;
46 46
 
47
-	function __construct( $title = '', $item_id = '', $item = array(), $settings = array(), $form_id = null) {
47
+	function __construct( $title = '', $item_id = '', $item = array(), $settings = array(), $form_id = null ) {
48 48
 
49 49
 		// Backward compat
50
-		if ( ! empty( $item['type'] ) ) {
51
-			$item['input_type'] = $item['type'];
52
-			unset( $item['type'] );
50
+		if ( ! empty( $item[ 'type' ] ) ) {
51
+			$item[ 'input_type' ] = $item[ 'type' ];
52
+			unset( $item[ 'type' ] );
53 53
 		}
54 54
 
55 55
 		if ( $admin_label = \GV\Utils::get( $settings, 'admin_label' ) ) {
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 		$this->id         = $item_id;
77 77
 		$this->form_id    = $form_id;
78 78
 		$this->settings   = $settings;
79
-		$this->label_type = $item['label_type'];
79
+		$this->label_type = $item[ 'label_type' ];
80 80
 	}
81 81
 
82 82
 	/**
@@ -120,14 +120,14 @@  discard block
 block discarded – undo
120 120
 
121 121
 			foreach ( $field_info_items as $item ) {
122 122
 
123
-				if( \GV\Utils::get( $item, 'hide_in_picker', false ) ) {
123
+				if ( \GV\Utils::get( $item, 'hide_in_picker', false ) ) {
124 124
 					continue;
125 125
 				}
126 126
 
127
-				$class = isset( $item['class'] ) ? sanitize_html_class( $item['class'] ) . ' description' : 'description';
127
+				$class = isset( $item[ 'class' ] ) ? sanitize_html_class( $item[ 'class' ] ) . ' description' : 'description';
128 128
 				// Add the title in case the value's long, in which case, it'll be truncated by CSS.
129 129
 				$output .= '<span class="' . $class . '">';
130
-				$output .= esc_html( $item['value'] );
130
+				$output .= esc_html( $item[ 'value' ] );
131 131
 				$output .= '</span>';
132 132
 			}
133 133
 
@@ -156,46 +156,46 @@  discard block
 block discarded – undo
156 156
 
157 157
 		// $settings_html will just be hidden inputs if empty. Otherwise, it'll have an <ul>. Ugly hack, I know.
158 158
 		// TODO: Un-hack this
159
-		$hide_settings_link_class = ( empty( $this->item['settings_html'] ) || strpos( $this->item['settings_html'], '<!-- No Options -->' ) > 0 ) ? 'hide-if-js' : '';
160
-		$settings_link      = sprintf( '<button class="gv-field-settings %2$s" title="%1$s" aria-label="%1$s"><span class="dashicons-admin-generic dashicons"></span></button>', esc_attr( $settings_title ), $hide_settings_link_class );
159
+		$hide_settings_link_class = ( empty( $this->item[ 'settings_html' ] ) || strpos( $this->item[ 'settings_html' ], '<!-- No Options -->' ) > 0 ) ? 'hide-if-js' : '';
160
+		$settings_link = sprintf( '<button class="gv-field-settings %2$s" title="%1$s" aria-label="%1$s"><span class="dashicons-admin-generic dashicons"></span></button>', esc_attr( $settings_title ), $hide_settings_link_class );
161 161
 
162 162
 		// When a field label is empty, use the Field ID
163 163
 		$label = empty( $this->title ) ? sprintf( _x( 'Field #%s (No Label)', 'Label in field picker for empty label', 'gravityview' ), $this->id ) : $this->title;
164 164
 
165 165
 		// If there's a custom label, and show label is checked, use that as the field heading
166
-		if ( ! empty( $this->settings['custom_label'] ) && ! empty( $this->settings['show_label'] ) ) {
167
-			$label = $this->settings['custom_label'];
168
-		} else if ( ! empty( $this->item['customLabel'] ) ) {
169
-			$label = $this->item['customLabel'];
166
+		if ( ! empty( $this->settings[ 'custom_label' ] ) && ! empty( $this->settings[ 'show_label' ] ) ) {
167
+			$label = $this->settings[ 'custom_label' ];
168
+		} else if ( ! empty( $this->item[ 'customLabel' ] ) ) {
169
+			$label = $this->item[ 'customLabel' ];
170 170
 		}
171 171
 		$label = esc_attr( $label );
172 172
 
173 173
 		$field_icon = '';
174 174
 
175 175
 		$form = ! empty( $this->form_id ) ? GVCommon::get_form( $this->form_id ) : false;
176
-		$nonexistent_form_field = $form && $this->id && preg_match('/^\d+\.\d+$|^\d+$/', $this->id) && ! gravityview_get_field( $form, $this->id );
176
+		$nonexistent_form_field = $form && $this->id && preg_match( '/^\d+\.\d+$|^\d+$/', $this->id ) && ! gravityview_get_field( $form, $this->id );
177 177
 
178
-		if ( $this->item['icon'] && ! \GV\Utils::get( $this->item, 'parent' ) ) {
178
+		if ( $this->item[ 'icon' ] && ! \GV\Utils::get( $this->item, 'parent' ) ) {
179 179
 
180
-			$has_gf_icon = ( false !== strpos( $this->item['icon'], 'gform-icon' ) );
181
-			$has_dashicon = ( false !== strpos( $this->item['icon'], 'dashicons' ) );
180
+			$has_gf_icon = ( false !== strpos( $this->item[ 'icon' ], 'gform-icon' ) );
181
+			$has_dashicon = ( false !== strpos( $this->item[ 'icon' ], 'dashicons' ) );
182 182
 
183
-			if ( 0 === strpos( $this->item['icon'], 'data:' ) ) {
183
+			if ( 0 === strpos( $this->item[ 'icon' ], 'data:' ) ) {
184 184
 				// Inline icon SVG
185
-				$field_icon = '<i class="dashicons background-icon" style="background-image: url(\'' . esc_attr( $this->item['icon'] ) . '\');"></i>';
186
-			} elseif( $has_gf_icon && gravityview()->plugin->is_GF_25() ) {
185
+				$field_icon = '<i class="dashicons background-icon" style="background-image: url(\'' . esc_attr( $this->item[ 'icon' ] ) . '\');"></i>';
186
+			} elseif ( $has_gf_icon && gravityview()->plugin->is_GF_25() ) {
187 187
 				// Gravity Forms icon font
188
-				$field_icon = '<i class="gform-icon ' . esc_attr( $this->item['icon'] ) . '"></i>';
189
-			} elseif( $has_dashicon ) {
188
+				$field_icon = '<i class="gform-icon ' . esc_attr( $this->item[ 'icon' ] ) . '"></i>';
189
+			} elseif ( $has_dashicon ) {
190 190
 				// Dashicon; prefix with "dashicons"
191
-				$field_icon = '<i class="dashicons ' . esc_attr( $this->item['icon'] ) . '"></i>';
191
+				$field_icon = '<i class="dashicons ' . esc_attr( $this->item[ 'icon' ] ) . '"></i>';
192 192
 			} else {
193 193
 				// Not dashicon icon
194
-				$field_icon = '<i class="' . esc_attr( $this->item['icon'] ) . '"></i>';
194
+				$field_icon = '<i class="' . esc_attr( $this->item[ 'icon' ] ) . '"></i>';
195 195
 			}
196 196
 
197 197
 			$field_icon = $field_icon . ' ';
198
-		} elseif( \GV\Utils::get( $this->item, 'parent' ) ) {
198
+		} elseif ( \GV\Utils::get( $this->item, 'parent' ) ) {
199 199
 			$field_icon = '<i class="gv-icon gv-icon-level-down"></i>' . ' ';
200 200
 		}
201 201
 
@@ -222,19 +222,19 @@  discard block
 block discarded – undo
222 222
 
223 223
 		$output .= '</h5>';
224 224
 
225
-		$container_class = ! empty( $this->item['parent'] ) ? ' gv-child-field' : '';
225
+		$container_class = ! empty( $this->item[ 'parent' ] ) ? ' gv-child-field' : '';
226 226
 
227 227
 		$container_class .= $nonexistent_form_field ? ' gv-nonexistent-form-field' : '';
228 228
 
229
-		$container_class .= empty( $this->settings['show_as_link'] ) ? '' : ' has-single-entry-link';
229
+		$container_class .= empty( $this->settings[ 'show_as_link' ] ) ? '' : ' has-single-entry-link';
230 230
 
231
-		$container_class .= empty( $this->settings['only_loggedin'] ) ? '' : ' has-custom-visibility';
231
+		$container_class .= empty( $this->settings[ 'only_loggedin' ] ) ? '' : ' has-custom-visibility';
232 232
 
233
-		$data_form_id   = $form ? ' data-formid="' . esc_attr( $this->form_id ) . '"' : '';
233
+		$data_form_id = $form ? ' data-formid="' . esc_attr( $this->form_id ) . '"' : '';
234 234
 
235
-		$data_parent_label = ! empty( $this->item['parent'] ) ? ' data-parent-label="' . esc_attr( $this->item['parent']['label'] ) . '"' : '';
235
+		$data_parent_label = ! empty( $this->item[ 'parent' ] ) ? ' data-parent-label="' . esc_attr( $this->item[ 'parent' ][ 'label' ] ) . '"' : '';
236 236
 
237
-		$output = '<div data-fieldid="' . esc_attr( $this->id ) . '" ' . $data_form_id . $data_parent_label . ' data-inputtype="' . esc_attr( $this->item['input_type'] ) . '" class="gv-fields' . $container_class . '">' . $output . $this->item['settings_html'] . '</div>';
237
+		$output = '<div data-fieldid="' . esc_attr( $this->id ) . '" ' . $data_form_id . $data_parent_label . ' data-inputtype="' . esc_attr( $this->item[ 'input_type' ] ) . '" class="gv-fields' . $container_class . '">' . $output . $this->item[ 'settings_html' ] . '</div>';
238 238
 
239 239
 		return $output;
240 240
 	}
@@ -252,12 +252,12 @@  discard block
 block discarded – undo
252 252
 
253 253
 		$icons = array(
254 254
 			'show_as_link' => array(
255
-				'visible' => ( ! empty( $this->settings['show_as_link'] ) ),
255
+				'visible' => ( ! empty( $this->settings[ 'show_as_link' ] ) ),
256 256
 				'title' => __( 'This field links to the Single Entry', 'gravityview' ),
257 257
 				'css_class' => 'dashicons dashicons-media-default icon-link-to-single-entry',
258 258
 			),
259 259
 			'only_loggedin' => array(
260
-				'visible' => ( \GV\Utils::get( $this->settings, 'only_loggedin' ) || isset( $this->settings['allow_edit_cap'] ) && 'read' !== $this->settings['allow_edit_cap'] ),
260
+				'visible' => ( \GV\Utils::get( $this->settings, 'only_loggedin' ) || isset( $this->settings[ 'allow_edit_cap' ] ) && 'read' !== $this->settings[ 'allow_edit_cap' ] ),
261 261
 				'title' => __( 'This field has modified visibility', 'gravityview' ),
262 262
 				'css_class' => 'dashicons dashicons-lock icon-custom-visibility',
263 263
 			),
@@ -271,21 +271,21 @@  discard block
 block discarded – undo
271 271
 		 * @param array $icons Array of icons to be shown, with `visible`, `title`, `css_class` keys.
272 272
 		 * @param array $item_settings Settings for the current item (widget or field)
273 273
 		 */
274
-		$icons = (array) apply_filters( 'gravityview/admin/indicator_icons', $icons, $this->settings );
274
+		$icons = (array)apply_filters( 'gravityview/admin/indicator_icons', $icons, $this->settings );
275 275
 
276 276
 		foreach ( $icons as $icon ) {
277 277
 
278
-			if ( empty( $icon['css_class'] ) || empty( $icon['title'] ) ) {
278
+			if ( empty( $icon[ 'css_class' ] ) || empty( $icon[ 'title' ] ) ) {
279 279
 				continue;
280 280
 			}
281 281
 
282
-			$css_class = trim( $icon['css_class'] );
282
+			$css_class = trim( $icon[ 'css_class' ] );
283 283
 
284
-			if ( empty( $icon['visible'] ) ) {
284
+			if ( empty( $icon[ 'visible' ] ) ) {
285 285
 				$css_class .= ' hide-if-js';
286 286
 			}
287 287
 
288
-			$output .= '<span class="' . gravityview_sanitize_html_class( $css_class ) . '" title="' . esc_attr( $icon['title'] ) . '"></span>';
288
+			$output .= '<span class="' . gravityview_sanitize_html_class( $css_class ) . '" title="' . esc_attr( $icon[ 'title' ] ) . '"></span>';
289 289
 		}
290 290
 
291 291
 		return $output;
Please login to merge, or discard this patch.
plugin-and-theme-hooks/class-gravityview-plugin-hooks-gravityformsquiz.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -50,26 +50,26 @@
 block discarded – undo
50 50
 
51 51
 		if ( ! empty( $quiz_fields ) ) {
52 52
 
53
-			$fields['gquiz_score']   = array(
53
+			$fields[ 'gquiz_score' ] = array(
54 54
 				'label' => __( 'Quiz Score Total', 'gravityview' ),
55 55
 				'type'  => 'quiz_score',
56 56
 				'desc'  => __( 'Displays the number of correct Quiz answers the user submitted.', 'gravityview' ),
57 57
 				'icon'  => 'dashicons-forms',
58 58
 			);
59
-			$fields['gquiz_percent'] = array(
59
+			$fields[ 'gquiz_percent' ] = array(
60 60
 				'label' => __( 'Quiz Percentage Grade', 'gravityview' ),
61 61
 				'type'  => 'quiz_percent',
62 62
 				'desc'  => __( 'Displays the percentage of correct Quiz answers the user submitted.', 'gravityview' ),
63 63
 				'icon'  => 'dashicons-forms',
64 64
 			);
65
-			$fields['gquiz_grade']   = array(
65
+			$fields[ 'gquiz_grade' ] = array(
66 66
 				/* translators: This is a field type used by the Gravity Forms Quiz Addon. "A" is 100-90, "B" is 89-80, "C" is 79-70, etc.  */
67 67
 				'label' => __( 'Quiz Letter Grade', 'gravityview' ),
68 68
 				'type'  => 'quiz_grade',
69 69
 				'desc'  => __( 'Displays the Grade the user achieved based on Letter Grading configured in the Quiz Settings.', 'gravityview' ),
70 70
 				'icon'  => 'dashicons-forms',
71 71
 			);
72
-			$fields['gquiz_is_pass'] = array(
72
+			$fields[ 'gquiz_is_pass' ] = array(
73 73
 				'label' => __( 'Quiz Pass/Fail', 'gravityview' ),
74 74
 				'type'  => 'quiz_is_pass',
75 75
 				'desc'  => __( 'Displays either Passed or Failed based on the Pass/Fail settings configured in the Quiz Settings.', 'gravityview' ),
Please login to merge, or discard this patch.
future/includes/class-gv-shortcode-gvlogic.php 2 patches
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -61,8 +61,8 @@  discard block
 block discarded – undo
61 61
 		$value    = $this->get_value( $atts );
62 62
 
63 63
 		if ( false === $operator && is_null( $value ) ) {
64
-			if ( false !== $atts['if'] ) { // Only-if test
65
-				$match = $authed && ! in_array( strtolower( $atts['if'] ), array( '', '0', 'false', 'no' ) );
64
+			if ( false !== $atts[ 'if' ] ) { // Only-if test
65
+				$match = $authed && ! in_array( strtolower( $atts[ 'if' ] ), array( '', '0', 'false', 'no' ) );
66 66
 			} else {
67 67
 				$match = $authed; // Just login test
68 68
 			}
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 
82 82
 				// Need to match all AND
83 83
 				foreach ( $and_values as $and_value ) {
84
-					$match = $authed && \GVCommon::matches_operation( $atts['if'], $and_value, $operator );
84
+					$match = $authed && \GVCommon::matches_operation( $atts[ 'if' ], $and_value, $operator );
85 85
 					if ( ! $match ) {
86 86
 						break;
87 87
 					}
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 				// Only need to match a single OR
93 93
 				foreach ( $or_values as $or_value ) {
94 94
 
95
-					$match = \GVCommon::matches_operation( $atts['if'], $or_value, $operator );
95
+					$match = \GVCommon::matches_operation( $atts[ 'if' ], $or_value, $operator );
96 96
 
97 97
 					// Negate the negative operators
98 98
 					if ( ( $authed && $match ) || ( $authed && ( ! $match && in_array( $operator, array( 'isnot', 'not_contains', 'not_in' ) ) ) ) ) {
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 				}
102 102
 
103 103
 			} else {
104
-				$match = $authed && \GVCommon::matches_operation( $atts['if'], $value, $operator );
104
+				$match = $authed && \GVCommon::matches_operation( $atts[ 'if' ], $value, $operator );
105 105
 			}
106 106
 
107 107
 			$output = $this->get_output( $match, $atts, $output );
@@ -189,8 +189,8 @@  discard block
 block discarded – undo
189 189
 	 * @return string The output.
190 190
 	 */
191 191
 	private function get_output( $match, $atts, $content ) {
192
-		if ( ! $match && ! empty( $atts['else'] ) ) {
193
-			return $atts['else']; // Attributized else is easy :)
192
+		if ( ! $match && ! empty( $atts[ 'else' ] ) ) {
193
+			return $atts[ 'else' ]; // Attributized else is easy :)
194 194
 		}
195 195
 
196 196
 		$if = '';
@@ -317,18 +317,18 @@  discard block
 block discarded – undo
317 317
 		$atts = array_intersect_key( $supplied_atts, $atts );
318 318
 
319 319
 		// Strip whitespace if it's not default false
320
-		if ( isset( $atts['if'] ) && is_string( $atts['if'] ) ) {
321
-			$atts['if'] = trim( $atts['if'] );
320
+		if ( isset( $atts[ 'if' ] ) && is_string( $atts[ 'if' ] ) ) {
321
+			$atts[ 'if' ] = trim( $atts[ 'if' ] );
322 322
 		} else {
323
-			$atts['if'] = false;
323
+			$atts[ 'if' ] = false;
324 324
 		}
325 325
 
326
-		if ( isset( $atts['logged_in'] ) ) {
326
+		if ( isset( $atts[ 'logged_in' ] ) ) {
327 327
 			// Truthy
328
-			if ( in_array( strtolower( $atts['logged_in'] ), array( '0', 'false', 'no' ) ) ) {
329
-				$atts['logged_in'] = false;
328
+			if ( in_array( strtolower( $atts[ 'logged_in' ] ), array( '0', 'false', 'no' ) ) ) {
329
+				$atts[ 'logged_in' ] = false;
330 330
 			} else {
331
-				$atts['logged_in'] = true;
331
+				$atts[ 'logged_in' ] = true;
332 332
 			}
333 333
 		}
334 334
 
Please login to merge, or discard this patch.
Braces   +18 added lines, -9 removed lines patch added patch discarded remove patch
@@ -61,14 +61,16 @@  discard block
 block discarded – undo
61 61
 		$value    = $this->get_value( $atts );
62 62
 
63 63
 		if ( false === $operator && is_null( $value ) ) {
64
-			if ( false !== $atts['if'] ) { // Only-if test
64
+			if ( false !== $atts['if'] ) {
65
+// Only-if test
65 66
 				$match = $authed && ! in_array( strtolower( $atts['if'] ), array( '', '0', 'false', 'no' ) );
66 67
 			} else {
67 68
 				$match = $authed; // Just login test
68 69
 			}
69 70
 
70 71
 			$output = $this->get_output( $match, $atts, $content );
71
-		} else { // Regular test
72
+		} else {
73
+// Regular test
72 74
 
73 75
 			$output = $content;
74 76
 
@@ -199,12 +201,15 @@  discard block
 block discarded – undo
199 201
 		$opens = 0; // inner opens
200 202
 		$found = false; // found split position
201 203
 
202
-		while ( $content ) { // scan
204
+		while ( $content ) {
205
+// scan
203 206
 
204 207
 			if ( ! preg_match( '#(.*?)(\[\/?(gvlogic|else).*?])(.*)#s', $content, $matches ) ) {
205
-				if ( ! $found ) { // We're still iffing.
208
+				if ( ! $found ) {
209
+// We're still iffing.
206 210
 					$if .= $content;
207
-				} else { // We are elsing
211
+				} else {
212
+// We are elsing
208 213
 					$else .= $content;
209 214
 				}
210 215
 				break; // No more shortcodes
@@ -212,9 +217,11 @@  discard block
 block discarded – undo
212 217
 
213 218
 			list( $_, $before_shortcode, $shortcode, $_, $after_shortcode ) = $matches;
214 219
 
215
-			if ( ! $found ) { // We're still iffing.
220
+			if ( ! $found ) {
221
+// We're still iffing.
216 222
 				$if .= $before_shortcode;
217
-			} else { // We are elsing
223
+			} else {
224
+// We are elsing
218 225
 				$else .= $before_shortcode;
219 226
 			}
220 227
 
@@ -238,9 +245,11 @@  discard block
 block discarded – undo
238 245
 				}
239 246
 
240 247
 				// Tack on the shortcode
241
-				if ( ! $found ) { // We're still iffing.
248
+				if ( ! $found ) {
249
+// We're still iffing.
242 250
 					$if .= $shortcode;
243
-				} else { // We are elsing
251
+				} else {
252
+// We are elsing
244 253
 					$else .= $shortcode;
245 254
 				}
246 255
 			}
Please login to merge, or discard this patch.
includes/extensions/lightbox/class-gravityview-lightbox-provider.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,8 +23,8 @@  discard block
 block discarded – undo
23 23
 		add_filter( 'gravityview/fields/fileupload/link_atts', array( $this, 'fileupload_link_atts' ), 10, 4 );
24 24
 		add_filter( 'gravityview/get_link/allowed_atts', array( $this, 'allowed_atts' ) );
25 25
 
26
-		add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts') );
27
-		add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles') );
26
+		add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
27
+		add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles' ) );
28 28
 
29 29
 		add_action( 'gravityview/template/after', array( $this, 'print_scripts' ) );
30 30
 
@@ -92,8 +92,8 @@  discard block
 block discarded – undo
92 92
 		remove_filter( 'gravityview/fields/fileupload/link_atts', array( $this, 'fileupload_link_atts' ), 10 );
93 93
 		remove_filter( 'gravityview/get_link/allowed_atts', array( $this, 'allowed_atts' ) );
94 94
 
95
-		remove_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts') );
96
-		remove_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles') );
95
+		remove_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
96
+		remove_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles' ) );
97 97
 
98 98
 		remove_action( 'wp_footer', array( $this, 'output_footer' ) );
99 99
 	}
Please login to merge, or discard this patch.
includes/admin/entry-list.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 		add_action( 'gform_entries_first_column_actions', array( $this, 'add_edit_link' ), 10, 5 );
12 12
 
13 13
 		// Add script to enable edit link
14
-		add_action( 'admin_head', array( $this, 'add_edit_script') );
14
+		add_action( 'admin_head', array( $this, 'add_edit_script' ) );
15 15
 	}
16 16
 
17 17
 	/**
@@ -60,14 +60,14 @@  discard block
 block discarded – undo
60 60
 			'page' => 'gf_entries',
61 61
 			'view' => 'entry',
62 62
 			'id'	=> (int)$form_id,
63
-			'lid'	=>	(int)$lead["id"],
63
+			'lid'	=>	(int)$lead[ "id" ],
64 64
 			'screen_mode'	=> 'edit',
65 65
 		);
66 66
 		?>
67 67
 
68 68
 		<span class="edit edit_entry">
69 69
 			|
70
-		    <a title="<?php esc_attr_e( 'Edit this entry', 'gravityview'); ?>" href="<?php echo esc_url( add_query_arg( $params, admin_url( 'admin.php?page='.$query_string ) ) ); ?>"><?php esc_html_e( 'Edit', 'gravityview' ); ?></a>
70
+		    <a title="<?php esc_attr_e( 'Edit this entry', 'gravityview' ); ?>" href="<?php echo esc_url( add_query_arg( $params, admin_url( 'admin.php?page=' . $query_string ) ) ); ?>"><?php esc_html_e( 'Edit', 'gravityview' ); ?></a>
71 71
 		</span>
72 72
 		<?php
73 73
 	}
Please login to merge, or discard this patch.
includes/presets/register-default-templates.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -59,8 +59,8 @@  discard block
 block discarded – undo
59 59
 		'GravityView_DataTables_Template' => array(
60 60
 			'slug' => 'dt_placeholder',
61 61
 			'label' =>  __( 'DataTables Table', 'gv-datatables', 'gravityview' ),
62
-			'description' => __('Display items in a dynamic table powered by DataTables.', 'gravityview'),
63
-			'logo' => plugins_url('assets/images/templates/logo-datatables.png', GRAVITYVIEW_FILE ),
62
+			'description' => __( 'Display items in a dynamic table powered by DataTables.', 'gravityview' ),
63
+			'logo' => plugins_url( 'assets/images/templates/logo-datatables.png', GRAVITYVIEW_FILE ),
64 64
 			'buy_source' => 'https://gravityview.co/pricing/?utm_source=plugin&utm_medium=buy_now&utm_campaign=view_type&utm_term=datatables',
65 65
 			'preview' => 'https://try.gravityview.co/demo/view/datatables/?utm_source=plugin&utm_medium=try_demo&utm_campaign=view_type&utm_term=datatables',
66 66
 			'license' => esc_html__( 'All Access', 'gravityview' ),
@@ -102,13 +102,13 @@  discard block
 block discarded – undo
102 102
 				continue;
103 103
 			}
104 104
 
105
-			$license_price_id = (int) \GV\Utils::get( $license, 'price_id', 0 );
106
-			$placeholder_price_id = (int) \GV\Utils::get( $placeholder, 'price_id' );
105
+			$license_price_id = (int)\GV\Utils::get( $license, 'price_id', 0 );
106
+			$placeholder_price_id = (int)\GV\Utils::get( $placeholder, 'price_id' );
107 107
 
108
-			$placeholder['type']     = 'custom';
109
-			$placeholder['included'] = ( $license_price_id >= $placeholder_price_id );
108
+			$placeholder[ 'type' ]     = 'custom';
109
+			$placeholder[ 'included' ] = ( $license_price_id >= $placeholder_price_id );
110 110
 
111
-			new GravityView_Placeholder_Template( $placeholder['slug'], $placeholder );
111
+			new GravityView_Placeholder_Template( $placeholder[ 'slug' ], $placeholder );
112 112
 		}
113 113
 
114 114
 	} catch ( Exception $exception ) {
Please login to merge, or discard this patch.