Completed
Push — master ( 022e44...5d3455 )
by Zack
08:11 queued 31s
created
includes/class-gravityview-roles-capabilities.php 1 patch
Spacing   +14 added lines, -14 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
 
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
 		$all = $administrator;
305 305
 
306 306
 		// If role is set, return caps_to_check for just that role.
307
-		if( $single_role ) {
307
+		if ( $single_role ) {
308 308
 			$caps = isset( ${$single_role} ) ? ${$single_role} : false;
309 309
 			return $flat_array ? $caps : array( $single_role => $caps );
310 310
 		}
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
 
335 335
 		$has_cap = false;
336 336
 
337
-		if( empty( $caps_to_check ) ) {
337
+		if ( empty( $caps_to_check ) ) {
338 338
 			return $has_cap;
339 339
 		}
340 340
 
@@ -342,13 +342,13 @@  discard block
 block discarded – undo
342 342
 		$caps_to_check = self::maybe_add_full_access_caps( $caps_to_check );
343 343
 
344 344
 		foreach ( $caps_to_check as $cap ) {
345
-			if( ! is_null( $object_id ) ) {
345
+			if ( ! is_null( $object_id ) ) {
346 346
 				$has_cap = $user_id ? user_can( $user_id, $cap, $object_id ) : current_user_can( $cap, $object_id );
347 347
 			} else {
348 348
 				$has_cap = $user_id ? user_can( $user_id, $cap ) : current_user_can( $cap );
349 349
 			}
350 350
 			// At the first successful response, stop checking
351
-			if( $has_cap ) {
351
+			if ( $has_cap ) {
352 352
 				break;
353 353
 			}
354 354
 		}
@@ -372,15 +372,15 @@  discard block
 block discarded – undo
372 372
 		$all_gravityview_caps = self::all_caps();
373 373
 
374 374
 		// Are there any $caps_to_check that are from GravityView?
375
-		if( $has_gravityview_caps = array_intersect( $caps_to_check, $all_gravityview_caps ) ) {
376
-			$caps_to_check[] = 'gravityview_full_access';
375
+		if ( $has_gravityview_caps = array_intersect( $caps_to_check, $all_gravityview_caps ) ) {
376
+			$caps_to_check[ ] = 'gravityview_full_access';
377 377
 		}
378 378
 
379 379
 		$all_gravity_forms_caps = class_exists( 'GFCommon' ) ? GFCommon::all_caps() : array();
380 380
 
381 381
 		// Are there any $caps_to_check that are from Gravity Forms?
382
-		if( $all_gravity_forms_caps = array_intersect( $caps_to_check, $all_gravity_forms_caps ) ) {
383
-			$caps_to_check[] = 'gform_full_access';
382
+		if ( $all_gravity_forms_caps = array_intersect( $caps_to_check, $all_gravity_forms_caps ) ) {
383
+			$caps_to_check[ ] = 'gform_full_access';
384 384
 		}
385 385
 
386 386
 		return array_unique( $caps_to_check );
@@ -402,7 +402,7 @@  discard block
 block discarded – undo
402 402
 			$capabilities = self::all_caps();
403 403
 
404 404
 			// Loop through each role and remove GV caps_to_check
405
-			foreach( $wp_roles->get_names() as $role_slug => $role_name ) {
405
+			foreach ( $wp_roles->get_names() as $role_slug => $role_name ) {
406 406
 				foreach ( $capabilities as $cap ) {
407 407
 					$wp_roles->remove_cap( $role_slug, $cap );
408 408
 				}
Please login to merge, or discard this patch.
includes/class-gv-license-handler.php 1 patch
Spacing   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 	 * @return GV_License_Handler
35 35
 	 */
36 36
 	public static function get_instance( GravityView_Settings $GFAddOn ) {
37
-		if( empty( self::$instance ) ) {
37
+		if ( empty( self::$instance ) ) {
38 38
 			self::$instance = new self( $GFAddOn );
39 39
 		}
40 40
 		return self::$instance;
@@ -60,37 +60,37 @@  discard block
 block discarded – undo
60 60
 		$status = trim( $this->Addon->get_app_setting( 'license_key_status' ) );
61 61
 		$key = trim( $this->Addon->get_app_setting( 'license_key' ) );
62 62
 
63
-		if( !empty( $key ) ) {
63
+		if ( ! empty( $key ) ) {
64 64
 			$response = $this->Addon->get_app_setting( 'license_key_response' );
65
-			$response = is_array( $response ) ? (object) $response : json_decode( $response );
65
+			$response = is_array( $response ) ? (object)$response : json_decode( $response );
66 66
 		} else {
67 67
 			$response = array();
68 68
 		}
69 69
 
70 70
 		wp_localize_script( 'gv-admin-edd-license', 'GVGlobals', array(
71 71
 			'license_box' => $this->get_license_message( $response )
72
-		));
72
+		) );
73 73
 
74 74
 
75 75
 		$fields = array(
76 76
 			array(
77 77
 				'name'  => 'edd-activate',
78
-				'value' => __('Activate License', 'gravityview'),
79
-				'data-pending_text' => __('Verifying license…', 'gravityview'),
78
+				'value' => __( 'Activate License', 'gravityview' ),
79
+				'data-pending_text' => __( 'Verifying license…', 'gravityview' ),
80 80
 				'data-edd_action' => 'activate_license',
81 81
 				'class' => 'button-primary',
82 82
 			),
83 83
 			array(
84 84
 				'name'  => 'edd-deactivate',
85
-				'value' => __('Deactivate License', 'gravityview'),
86
-				'data-pending_text' => __('Deactivating license…', 'gravityview'),
85
+				'value' => __( 'Deactivate License', 'gravityview' ),
86
+				'data-pending_text' => __( 'Deactivating license…', 'gravityview' ),
87 87
 				'data-edd_action' => 'deactivate_license',
88 88
 				'class' => ( empty( $status ) ? 'button-primary hide' : 'button-primary' ),
89 89
 			),
90 90
 			array(
91 91
 				'name'  => 'edd-check',
92
-				'value' => __('Check License', 'gravityview'),
93
-				'data-pending_text' => __('Verifying license…', 'gravityview'),
92
+				'value' => __( 'Check License', 'gravityview' ),
93
+				'data-pending_text' => __( 'Verifying license…', 'gravityview' ),
94 94
 				'title' => 'Check the license before saving it',
95 95
 				'data-edd_action' => 'check_license',
96 96
 				'class' => 'button-secondary',
@@ -100,17 +100,17 @@  discard block
 block discarded – undo
100 100
 
101 101
 		$class = 'button gv-edd-action';
102 102
 
103
-		$class .= ( !empty( $key ) && $status !== 'valid' ) ? '' : ' hide';
103
+		$class .= ( ! empty( $key ) && $status !== 'valid' ) ? '' : ' hide';
104 104
 
105 105
 		$disabled_attribute = GVCommon::has_cap( 'gravityview_edit_settings' ) ? false : 'disabled';
106 106
 
107 107
 		$submit = '<div class="gv-edd-button-wrapper">';
108 108
 		foreach ( $fields as $field ) {
109
-			$field['type'] = 'button';
110
-			$field['class'] = isset( $field['class'] ) ? $field['class'] . ' '. $class : $class;
111
-			$field['style'] = 'margin-left: 10px;';
112
-			if( $disabled_attribute ) {
113
-				$field['disabled'] = $disabled_attribute;
109
+			$field[ 'type' ] = 'button';
110
+			$field[ 'class' ] = isset( $field[ 'class' ] ) ? $field[ 'class' ] . ' ' . $class : $class;
111
+			$field[ 'style' ] = 'margin-left: 10px;';
112
+			if ( $disabled_attribute ) {
113
+				$field[ 'disabled' ] = $disabled_attribute;
114 114
 			}
115 115
 			$submit .= $this->Addon->settings_submit( $field, $echo );
116 116
 		}
@@ -126,8 +126,8 @@  discard block
 block discarded – undo
126 126
 	 */
127 127
 	private function setup_edd() {
128 128
 
129
-		if( !class_exists('EDD_SL_Plugin_Updater') ) {
130
-			require_once( GRAVITYVIEW_DIR . 'includes/lib/EDD_SL_Plugin_Updater.php');
129
+		if ( ! class_exists( 'EDD_SL_Plugin_Updater' ) ) {
130
+			require_once( GRAVITYVIEW_DIR . 'includes/lib/EDD_SL_Plugin_Updater.php' );
131 131
 		}
132 132
 
133 133
 		// setup the updater
@@ -163,8 +163,8 @@  discard block
 block discarded – undo
163 163
 			'url'       => home_url(),
164 164
 		);
165 165
 
166
-		if( !empty( $action ) ) {
167
-			$settings['edd_action'] = esc_attr( $action );
166
+		if ( ! empty( $action ) ) {
167
+			$settings[ 'edd_action' ] = esc_attr( $action );
168 168
 		}
169 169
 
170 170
 		$settings = array_map( 'urlencode', $settings );
@@ -178,14 +178,14 @@  discard block
 block discarded – undo
178 178
 	 */
179 179
 	private function _license_get_remote_response( $data, $license = '' ) {
180 180
 
181
-		$api_params = $this->_get_edd_settings( $data['edd_action'], $license );
181
+		$api_params = $this->_get_edd_settings( $data[ 'edd_action' ], $license );
182 182
 
183 183
 		$url = add_query_arg( $api_params, self::url );
184 184
 
185 185
 		$response = wp_remote_get( $url, array(
186 186
 			'timeout'   => 15,
187 187
 			'sslverify' => false,
188
-		));
188
+		) );
189 189
 
190 190
 		if ( is_wp_error( $response ) ) {
191 191
 			return array();
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 		// Not JSON
197 197
 		if ( empty( $license_data ) ) {
198 198
 
199
-			delete_transient( 'gravityview_' . esc_attr( $data['field_id'] ) . '_valid' );
199
+			delete_transient( 'gravityview_' . esc_attr( $data[ 'field_id' ] ) . '_valid' );
200 200
 
201 201
 			// Change status
202 202
 			return array();
@@ -218,12 +218,12 @@  discard block
 block discarded – undo
218 218
 	 */
219 219
 	function get_license_message( $license_data ) {
220 220
 
221
-		if( empty( $license_data ) ) {
221
+		if ( empty( $license_data ) ) {
222 222
 			$class = 'hide';
223 223
 			$message = '';
224 224
 		} else {
225 225
 
226
-			if( ! empty( $license_data->error ) ) {
226
+			if ( ! empty( $license_data->error ) ) {
227 227
 				$class = 'error';
228 228
 				$string_key = $license_data->license;
229 229
 			} else {
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
 				$string_key = $license_data->license;
232 232
 			}
233 233
 
234
-			$message = sprintf( '<p><strong>%s: %s</strong></p>', $this->strings('status'), $this->strings( $string_key, $license_data ) );
234
+			$message = sprintf( '<p><strong>%s: %s</strong></p>', $this->strings( 'status' ), $this->strings( $string_key, $license_data ) );
235 235
 		}
236 236
 
237 237
 		return $this->generate_license_box( $message, $class );
@@ -272,16 +272,16 @@  discard block
 block discarded – undo
272 272
 	 */
273 273
 	public function license_call( $array = array() ) {
274 274
 
275
-		$is_ajax = ( defined('DOING_AJAX') && DOING_AJAX );
276
-		$data = empty( $array ) ? $_POST['data'] : $array;
275
+		$is_ajax = ( defined( 'DOING_AJAX' ) && DOING_AJAX );
276
+		$data = empty( $array ) ? $_POST[ 'data' ] : $array;
277 277
 		$has_cap = GVCommon::has_cap( 'gravityview_edit_settings' );
278 278
 
279
-		if ( $is_ajax && empty( $data['license'] ) ) {
280
-			die( - 1 );
279
+		if ( $is_ajax && empty( $data[ 'license' ] ) ) {
280
+			die( -1 );
281 281
 		}
282 282
 
283 283
 		// If the user isn't allowed to edit settings, show an error message
284
-		if( ! $has_cap ) {
284
+		if ( ! $has_cap ) {
285 285
 			$license_data = new stdClass();
286 286
 			$license_data->error = 'capability';
287 287
 			$license_data->message = $this->get_license_message( $license_data );
@@ -304,9 +304,9 @@  discard block
 block discarded – undo
304 304
 
305 305
 			$json = json_encode( $license_data );
306 306
 
307
-			$update_license = ( ! isset( $data['update'] ) || ! empty( $data['update'] ) );
307
+			$update_license = ( ! isset( $data[ 'update' ] ) || ! empty( $data[ 'update' ] ) );
308 308
 
309
-			$is_check_action_button = ( 'check_license' === $data['edd_action'] && defined( 'DOING_AJAX' ) && DOING_AJAX );
309
+			$is_check_action_button = ( 'check_license' === $data[ 'edd_action' ] && defined( 'DOING_AJAX' ) && DOING_AJAX );
310 310
 
311 311
 			// Failed is the response from trying to de-activate a license and it didn't work.
312 312
 			// This likely happened because people entered in a different key and clicked "Deactivate",
@@ -314,8 +314,8 @@  discard block
 block discarded – undo
314 314
 			// most likely a mistake.
315 315
 			if ( $license_data->license !== 'failed' && ! $is_check_action_button && $update_license ) {
316 316
 
317
-				if ( ! empty( $data['field_id'] ) ) {
318
-					set_transient( 'gravityview_' . esc_attr( $data['field_id'] ) . '_valid', $license_data, DAY_IN_SECONDS );
317
+				if ( ! empty( $data[ 'field_id' ] ) ) {
318
+					set_transient( 'gravityview_' . esc_attr( $data[ 'field_id' ] ) . '_valid', $license_data, DAY_IN_SECONDS );
319 319
 				}
320 320
 
321 321
 				$this->license_call_update_settings( $license_data, $data );
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
 		if ( $is_ajax ) {
327 327
 			exit( $json );
328 328
 		} else { // Non-ajax call
329
-			return ( rgget('format', $data ) === 'object' ) ? $license_data : $json;
329
+			return ( rgget( 'format', $data ) === 'object' ) ? $license_data : $json;
330 330
 		}
331 331
 	}
332 332
 
@@ -340,9 +340,9 @@  discard block
 block discarded – undo
340 340
 		// Update option with passed data license
341 341
 		$settings = $this->Addon->get_app_settings();
342 342
 
343
-        $settings['license_key'] = $license_data->license_key = trim( $data['license'] );
344
-		$settings['license_key_status'] = $license_data->license;
345
-		$settings['license_key_response'] = (array)$license_data;
343
+        $settings[ 'license_key' ] = $license_data->license_key = trim( $data[ 'license' ] );
344
+		$settings[ 'license_key_status' ] = $license_data->license;
345
+		$settings[ 'license_key_response' ] = (array)$license_data;
346 346
 
347 347
 		$this->Addon->update_app_settings( $settings );
348 348
 	}
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
 	 * @return string Renewal or account URL
355 355
 	 */
356 356
 	private function get_license_renewal_url( $license_data ) {
357
-		$renew_license_url = ( ! empty( $license_data ) && !empty( $license_data->license_key ) ) ? sprintf( 'https://gravityview.co/checkout/?download_id=17&edd_license_key=%s&utm_source=admin_notice&utm_medium=admin&utm_content=expired&utm_campaign=Activation', $license_data->license_key ) : 'https://gravityview.co/account/';
357
+		$renew_license_url = ( ! empty( $license_data ) && ! empty( $license_data->license_key ) ) ? sprintf( 'https://gravityview.co/checkout/?download_id=17&edd_license_key=%s&utm_source=admin_notice&utm_medium=admin&utm_content=expired&utm_campaign=Activation', $license_data->license_key ) : 'https://gravityview.co/account/';
358 358
 		return $renew_license_url;
359 359
 	}
360 360
 
@@ -368,30 +368,30 @@  discard block
 block discarded – undo
368 368
 
369 369
 
370 370
 		$strings = array(
371
-			'status' => esc_html__('Status', 'gravityview'),
372
-			'error' => esc_html__('There was an error processing the request.', 'gravityview'),
373
-			'failed'  => esc_html__('Could not deactivate the license. The license key you attempted to deactivate may not be active or valid.', 'gravityview'),
374
-			'site_inactive' => esc_html__('The license key is valid, but it has not been activated for this site.', 'gravityview'),
375
-			'no_activations_left' => esc_html__('Invalid: this license has reached its activation limit.', 'gravityview') . ' ' . sprintf( esc_html__('You can manage license activations %son your GravityView account page%s.', 'gravityview'), '<a href="https://gravityview.co/account/#licenses">', '</a>' ),
376
-			'deactivated' => esc_html__('The license has been deactivated.', 'gravityview'),
377
-			'valid' => esc_html__('The license key is valid and active.', 'gravityview'),
378
-			'invalid' => esc_html__('The license key entered is invalid.', 'gravityview'),
379
-			'missing' => esc_html__('The license key was not defined.', 'gravityview'),
380
-			'revoked' => esc_html__('This license key has been revoked.', 'gravityview'),
381
-			'expired' => sprintf( esc_html__('This license key has expired. %sRenew your license on the GravityView website%s to receive updates and support.', 'gravityview'), '<a href="'. esc_url( $this->get_license_renewal_url( $license_data ) ) .'">', '</a>' ),
371
+			'status' => esc_html__( 'Status', 'gravityview' ),
372
+			'error' => esc_html__( 'There was an error processing the request.', 'gravityview' ),
373
+			'failed'  => esc_html__( 'Could not deactivate the license. The license key you attempted to deactivate may not be active or valid.', 'gravityview' ),
374
+			'site_inactive' => esc_html__( 'The license key is valid, but it has not been activated for this site.', 'gravityview' ),
375
+			'no_activations_left' => esc_html__( 'Invalid: this license has reached its activation limit.', 'gravityview' ) . ' ' . sprintf( esc_html__( 'You can manage license activations %son your GravityView account page%s.', 'gravityview' ), '<a href="https://gravityview.co/account/#licenses">', '</a>' ),
376
+			'deactivated' => esc_html__( 'The license has been deactivated.', 'gravityview' ),
377
+			'valid' => esc_html__( 'The license key is valid and active.', 'gravityview' ),
378
+			'invalid' => esc_html__( 'The license key entered is invalid.', 'gravityview' ),
379
+			'missing' => esc_html__( 'The license key was not defined.', 'gravityview' ),
380
+			'revoked' => esc_html__( 'This license key has been revoked.', 'gravityview' ),
381
+			'expired' => sprintf( esc_html__( 'This license key has expired. %sRenew your license on the GravityView website%s to receive updates and support.', 'gravityview' ), '<a href="' . esc_url( $this->get_license_renewal_url( $license_data ) ) . '">', '</a>' ),
382 382
 			'capability' => esc_html__( 'You don\'t have the ability to edit plugin settings.', 'gravityview' ),
383 383
 
384
-			'verifying_license' => esc_html__('Verifying license&hellip;', 'gravityview'),
385
-			'activate_license' => esc_html__('Activate License', 'gravityview'),
386
-			'deactivate_license' => esc_html__('Deactivate License', 'gravityview'),
387
-			'check_license' => esc_html__('Verify License', 'gravityview'),
384
+			'verifying_license' => esc_html__( 'Verifying license&hellip;', 'gravityview' ),
385
+			'activate_license' => esc_html__( 'Activate License', 'gravityview' ),
386
+			'deactivate_license' => esc_html__( 'Deactivate License', 'gravityview' ),
387
+			'check_license' => esc_html__( 'Verify License', 'gravityview' ),
388 388
 		);
389 389
 
390
-		if( empty( $status ) ) {
390
+		if ( empty( $status ) ) {
391 391
 			return $strings;
392 392
 		}
393 393
 
394
-		if( isset( $strings[ $status ] ) ) {
394
+		if ( isset( $strings[ $status ] ) ) {
395 395
 			return $strings[ $status ];
396 396
 		}
397 397
 
@@ -401,19 +401,19 @@  discard block
 block discarded – undo
401 401
 	public function validate_license_key( $value, $field ) {
402 402
 
403 403
 		// No license? No status.
404
-		if( empty( $value ) ) {
404
+		if ( empty( $value ) ) {
405 405
 			return NULL;
406 406
 		}
407 407
 
408
-		$response = $this->license_call(array(
408
+		$response = $this->license_call( array(
409 409
 			'license' => $this->Addon->get_app_setting( 'license_key' ),
410 410
 			'edd_action' => 'check_license',
411
-			'field_id' => $field['name'],
412
-		));
411
+			'field_id' => $field[ 'name' ],
412
+		) );
413 413
 
414 414
 		$response = is_string( $response ) ? json_decode( $response, true ) : $response;
415 415
 
416
-		switch( $response['license'] ) {
416
+		switch ( $response[ 'license' ] ) {
417 417
 			case 'valid':
418 418
 				$return = true;
419 419
 				break;
Please login to merge, or discard this patch.
includes/class-gravityview-admin-bar.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 			$wp_admin_bar->add_menu( array(
63 63
 				'id' => 'edit-entry',
64 64
 				'title' => __( 'Edit Entry', 'gravityview' ),
65
-				'href' => esc_url_raw( admin_url( sprintf( 'admin.php?page=gf_entries&amp;screen_mode=edit&amp;view=entry&amp;id=%d&lid=%d', $entry['form_id'], $entry['id'] ) ) ),
65
+				'href' => esc_url_raw( admin_url( sprintf( 'admin.php?page=gf_entries&amp;screen_mode=edit&amp;view=entry&amp;id=%d&lid=%d', $entry[ 'form_id' ], $entry[ 'id' ] ) ) ),
66 66
 			) );
67 67
 
68 68
 		}
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 		/** @var WP_Admin_Bar $wp_admin_bar */
79 79
 		global $wp_admin_bar;
80 80
 
81
-		if( GVCommon::has_cap('edit_gravityviews') ) {
81
+		if ( GVCommon::has_cap( 'edit_gravityviews' ) ) {
82 82
 
83 83
 			$view_data = GravityView_View_Data::getInstance();
84 84
 
@@ -89,11 +89,11 @@  discard block
 block discarded – undo
89 89
 			if ( ! $this->gravityview_view->isGravityviewPostType() && ! empty( $views ) && ! $view_data->has_multiple_views() ) {
90 90
 				$view = reset( $views );
91 91
 
92
-				if( GVCommon::has_cap( 'edit_gravityview', $view['id'] ) ) {
92
+				if ( GVCommon::has_cap( 'edit_gravityview', $view[ 'id' ] ) ) {
93 93
 					$wp_admin_bar->add_menu( array(
94 94
 						'id'    => 'edit-view',
95 95
 						'title' => __( 'Edit View', 'gravityview' ),
96
-						'href'  => esc_url_raw( admin_url( sprintf( 'post.php?post=%d&action=edit', $view['id'] ) ) ),
96
+						'href'  => esc_url_raw( admin_url( sprintf( 'post.php?post=%d&action=edit', $view[ 'id' ] ) ) ),
97 97
 					) );
98 98
 				}
99 99
 			}
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 
111 111
 		add_filter( 'gravityview/sortable/field_blacklist', array( $this, '_filter_sortable_fields' ), 1 );
112 112
 
113
-		if( $this->_custom_merge_tag ) {
113
+		if ( $this->_custom_merge_tag ) {
114 114
 			add_filter( 'gform_custom_merge_tags', array( $this, '_filter_gform_custom_merge_tags' ), 10, 4 );
115 115
 			add_filter( 'gform_replace_merge_tags', array( $this, '_filter_gform_replace_merge_tags' ), 10, 7 );
116 116
 		}
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 	 *
133 133
 	 * @return string Original text if {_custom_merge_tag} isn't found. Otherwise, replaced text.
134 134
 	 */
135
-	public function _filter_gform_replace_merge_tags( $text, $form = array(), $entry = array(), $url_encode = false, $esc_html = false  ) {
135
+	public function _filter_gform_replace_merge_tags( $text, $form = array(), $entry = array(), $url_encode = false, $esc_html = false ) {
136 136
 
137 137
 		/**
138 138
 		 * This prevents the gform_replace_merge_tags filter from being called twice, as defined in:
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 		 * @see GFCommon::replace_variables_prepopulate()
141 141
 		 * @todo Remove eventually: Gravity Forms fixed this issue in 1.9.14
142 142
 		 */
143
-		if( false === $form ) {
143
+		if ( false === $form ) {
144 144
 			return $text;
145 145
 		}
146 146
 
@@ -173,19 +173,19 @@  discard block
 block discarded – undo
173 173
 	 */
174 174
 	public function replace_merge_tag( $matches = array(), $text = '', $form = array(), $entry = array(), $url_encode = false, $esc_html = false ) {
175 175
 
176
-		foreach( $matches as $match ) {
176
+		foreach ( $matches as $match ) {
177 177
 
178
-			$full_tag = $match[0];
178
+			$full_tag = $match[ 0 ];
179 179
 
180 180
 			// Strip the Merge Tags
181
-			$tag = str_replace( array( '{', '}'), '', $full_tag );
181
+			$tag = str_replace( array( '{', '}' ), '', $full_tag );
182 182
 
183 183
 			// Replace the value from the entry, if exists
184
-			if( isset( $entry[ $tag ] ) ) {
184
+			if ( isset( $entry[ $tag ] ) ) {
185 185
 
186 186
 				$value = $entry[ $tag ];
187 187
 
188
-				if( is_callable( array( $this, 'get_content') ) ) {
188
+				if ( is_callable( array( $this, 'get_content' ) ) ) {
189 189
 					$value = $this->get_content( $value );
190 190
 				}
191 191
 
@@ -258,8 +258,8 @@  discard block
 block discarded – undo
258 258
 	 */
259 259
 	public function _filter_sortable_fields( $not_sortable ) {
260 260
 
261
-		if( ! $this->is_sortable ) {
262
-			$not_sortable[] = $this->name;
261
+		if ( ! $this->is_sortable ) {
262
+			$not_sortable[ ] = $this->name;
263 263
 		}
264 264
 
265 265
 		return $not_sortable;
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
 			'date_display' => array(
289 289
 				'type' => 'text',
290 290
 				'label' => __( 'Override Date Format', 'gravityview' ),
291
-				'desc' => sprintf( __( 'Define how the date is displayed (using %sthe PHP date format%s)', 'gravityview'), '<a href="https://codex.wordpress.org/Formatting_Date_and_Time">', '</a>' ),
291
+				'desc' => sprintf( __( 'Define how the date is displayed (using %sthe PHP date format%s)', 'gravityview' ), '<a href="https://codex.wordpress.org/Formatting_Date_and_Time">', '</a>' ),
292 292
 				/**
293 293
 				 * @filter `gravityview_date_format` Override the date format with a [PHP date format](https://codex.wordpress.org/Formatting_Date_and_Time)
294 294
 				 * @param[in,out] null|string $date_format Date Format (default: null)
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
 
314 314
 		$options = $this->field_support_options();
315 315
 
316
-		if( isset( $options[ $key ] ) ) {
316
+		if ( isset( $options[ $key ] ) ) {
317 317
 			$field_options[ $key ] = $options[ $key ];
318 318
 		}
319 319
 
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-radio.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
 
10 10
 	var $name = 'radio';
11 11
 
12
-	var $search_operators = array( 'is', 'in', 'not in', 'isnot', 'contains');
12
+	var $search_operators = array( 'is', 'in', 'not in', 'isnot', 'contains' );
13 13
 
14 14
 	var $_gf_field_class_name = 'GF_Field_Radio';
15 15
 
Please login to merge, or discard this patch.
includes/presets/default-edit/class-gravityview-default-template-edit.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -24,9 +24,9 @@  discard block
 block discarded – undo
24 24
 			'slug' => 'edit',
25 25
 			'type' => 'internal',
26 26
 			'label' =>  __( 'Edit Table', 'gravityview' ),
27
-			'description' => __('Display items in a table view.', 'gravityview'),
28
-			'logo' => plugins_url('includes/presets/default-table/logo-default-table.png', GRAVITYVIEW_FILE),
29
-			'css_source' => plugins_url('templates/css/table-view.css', GRAVITYVIEW_FILE),
27
+			'description' => __( 'Display items in a table view.', 'gravityview' ),
28
+			'logo' => plugins_url( 'includes/presets/default-table/logo-default-table.png', GRAVITYVIEW_FILE ),
29
+			'css_source' => plugins_url( 'templates/css/table-view.css', GRAVITYVIEW_FILE ),
30 30
 		);
31 31
 
32 32
 		$settings = wp_parse_args( $settings, $edit_settings );
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 				'1-1' => array(
43 43
 					array(
44 44
 						'areaid' => 'edit-fields',
45
-						'title' => __('Visible Edit Fields', 'gravityview' )
45
+						'title' => __( 'Visible Edit Fields', 'gravityview' )
46 46
 					)
47 47
 				)
48 48
 			)
Please login to merge, or discard this patch.
includes/admin/field-types/type_radio.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -12,19 +12,19 @@
 block discarded – undo
12 12
 		</div>
13 13
 		<?php
14 14
 			echo $this->get_tooltip();
15
-			echo $this->get_field_desc().'&nbsp;';
15
+			echo $this->get_field_desc() . '&nbsp;';
16 16
 
17 17
 			$this->render_input();
18 18
 
19 19
 	}
20 20
 
21 21
 	function render_input( $override_input = null ) {
22
-		if( isset( $override_input ) ) {
22
+		if ( isset( $override_input ) ) {
23 23
 			echo $override_input;
24 24
 			return;
25 25
 		}
26 26
 
27
-		foreach( $this->field['options'] as $value => $label ) : ?>
27
+		foreach ( $this->field[ 'options' ] as $value => $label ) : ?>
28 28
 		<label class="<?php echo $this->get_label_class(); ?>">
29 29
 			<input name="<?php echo esc_attr( $this->name ); ?>" id="<?php echo $this->get_field_id(); ?>-<?php echo esc_attr( $value ); ?>" type="radio" value="<?php echo esc_attr( $value ); ?>" <?php checked( $value, $this->value, true ); ?> />&nbsp;<?php echo esc_html( $label ); ?>
30 30
 		</label>
Please login to merge, or discard this patch.
includes/class-admin.php 2 patches
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
 
267 267
 		// Dequeue other jQuery styles even if no-conflict is off.
268 268
 		// Terrible-looking tabs help no one.
269
-		if( !empty( $wp_styles->registered ) )  {
269
+		if( !empty( $wp_styles->registered ) ) {
270 270
 			foreach ($wp_styles->registered as $key => $style) {
271 271
 				if( preg_match( '/^(?:wp\-)?jquery/ism', $key ) ) {
272 272
 					wp_dequeue_style( $key );
@@ -337,8 +337,8 @@  discard block
 block discarded – undo
337 337
 
338 338
         //unregistering scripts
339 339
         $registered = array();
340
-        foreach( $wp_objects->registered as $handle => $script_registration ){
341
-            if( in_array( $handle, $required_objects ) ){
340
+        foreach( $wp_objects->registered as $handle => $script_registration ) {
341
+            if( in_array( $handle, $required_objects ) ) {
342 342
                 $registered[ $handle ] = $script_registration;
343 343
             }
344 344
         }
Please login to merge, or discard this patch.
Spacing   +74 added lines, -74 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
 
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 		require_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-migrate.php' );
26 26
 
27 27
 		// Don't load tooltips if on Gravity Forms, otherwise it overrides translations
28
-		if( class_exists( 'GFCommon' ) && class_exists( 'GFForms' ) && !GFForms::is_gravity_page() ) {
28
+		if ( class_exists( 'GFCommon' ) && class_exists( 'GFForms' ) && ! GFForms::is_gravity_page() ) {
29 29
 			require_once( GFCommon::get_base_path() . '/tooltips.php' );
30 30
 		}
31 31
 
@@ -50,18 +50,18 @@  discard block
 block discarded – undo
50 50
 		add_filter( 'post_updated_messages', array( $this, 'post_updated_messages' ) );
51 51
 		add_filter( 'bulk_post_updated_messages', array( $this, 'post_updated_messages' ) );
52 52
 
53
-		add_filter( 'plugin_action_links_'. plugin_basename( GRAVITYVIEW_FILE ) , array( $this, 'plugin_action_links' ) );
53
+		add_filter( 'plugin_action_links_' . plugin_basename( GRAVITYVIEW_FILE ), array( $this, 'plugin_action_links' ) );
54 54
 
55 55
 		add_action( 'plugins_loaded', array( $this, 'backend_actions' ), 100 );
56 56
 
57 57
 		//Hooks for no-conflict functionality
58
-		add_action( 'wp_print_scripts', array( $this, 'no_conflict_scripts' ), 1000);
59
-		add_action( 'admin_print_footer_scripts', array( $this, 'no_conflict_scripts' ), 9);
58
+		add_action( 'wp_print_scripts', array( $this, 'no_conflict_scripts' ), 1000 );
59
+		add_action( 'admin_print_footer_scripts', array( $this, 'no_conflict_scripts' ), 9 );
60 60
 
61
-		add_action( 'wp_print_styles', array( $this, 'no_conflict_styles' ), 1000);
62
-		add_action( 'admin_print_styles', array( $this, 'no_conflict_styles' ), 11);
63
-		add_action( 'admin_print_footer_scripts', array( $this, 'no_conflict_styles' ), 1);
64
-		add_action( 'admin_footer', array( $this, 'no_conflict_styles' ), 1);
61
+		add_action( 'wp_print_styles', array( $this, 'no_conflict_styles' ), 1000 );
62
+		add_action( 'admin_print_styles', array( $this, 'no_conflict_styles' ), 11 );
63
+		add_action( 'admin_print_footer_scripts', array( $this, 'no_conflict_styles' ), 1 );
64
+		add_action( 'admin_footer', array( $this, 'no_conflict_styles' ), 1 );
65 65
 
66 66
 	}
67 67
 
@@ -74,20 +74,20 @@  discard block
 block discarded – undo
74 74
 	public function backend_actions() {
75 75
 
76 76
 		/** @define "GRAVITYVIEW_DIR" "../" */
77
-		include_once( GRAVITYVIEW_DIR .'includes/admin/class.field.type.php' );
78
-		include_once( GRAVITYVIEW_DIR .'includes/admin/class.render.settings.php' );
79
-		include_once( GRAVITYVIEW_DIR .'includes/class-admin-label.php' );
80
-		include_once( GRAVITYVIEW_DIR .'includes/class-admin-views.php' );
81
-		include_once( GRAVITYVIEW_DIR .'includes/class-admin-welcome.php' );
82
-		include_once( GRAVITYVIEW_DIR .'includes/class-admin-add-shortcode.php' );
83
-		include_once( GRAVITYVIEW_DIR .'includes/class-admin-approve-entries.php' );
77
+		include_once( GRAVITYVIEW_DIR . 'includes/admin/class.field.type.php' );
78
+		include_once( GRAVITYVIEW_DIR . 'includes/admin/class.render.settings.php' );
79
+		include_once( GRAVITYVIEW_DIR . 'includes/class-admin-label.php' );
80
+		include_once( GRAVITYVIEW_DIR . 'includes/class-admin-views.php' );
81
+		include_once( GRAVITYVIEW_DIR . 'includes/class-admin-welcome.php' );
82
+		include_once( GRAVITYVIEW_DIR . 'includes/class-admin-add-shortcode.php' );
83
+		include_once( GRAVITYVIEW_DIR . 'includes/class-admin-approve-entries.php' );
84 84
 
85 85
 		/**
86 86
 		 * @action `gravityview_include_backend_actions` Triggered after all GravityView admin files are loaded
87 87
 		 *
88 88
 		 * Nice place to insert extensions' backend stuff
89 89
 		 */
90
-		do_action('gravityview_include_backend_actions');
90
+		do_action( 'gravityview_include_backend_actions' );
91 91
 	}
92 92
 
93 93
 	/**
@@ -103,12 +103,12 @@  discard block
 block discarded – undo
103 103
 
104 104
 		$actions = array();
105 105
 
106
-		if( GVCommon::has_cap( 'gravityview_view_settings' ) ) {
107
-			$actions[] = sprintf( '<a href="%s">%s</a>', admin_url( 'edit.php?post_type=gravityview&page=gravityview_settings' ), esc_html__( 'Settings', 'gravityview' ) );
106
+		if ( GVCommon::has_cap( 'gravityview_view_settings' ) ) {
107
+			$actions[ ] = sprintf( '<a href="%s">%s</a>', admin_url( 'edit.php?post_type=gravityview&page=gravityview_settings' ), esc_html__( 'Settings', 'gravityview' ) );
108 108
 		}
109 109
 
110
-		if( GVCommon::has_cap( 'gravityview_support_port' ) ) {
111
-			$actions[] = '<a href="http://docs.gravityview.co">' . esc_html__( 'Support', 'gravityview' ) . '</a>';
110
+		if ( GVCommon::has_cap( 'gravityview_support_port' ) ) {
111
+			$actions[ ] = '<a href="http://docs.gravityview.co">' . esc_html__( 'Support', 'gravityview' ) . '</a>';
112 112
 		}
113 113
 
114 114
 		return array_merge( $actions, $links );
@@ -131,12 +131,12 @@  discard block
 block discarded – undo
131 131
 	function post_updated_messages( $messages, $bulk_counts = NULL ) {
132 132
 		global $post;
133 133
 
134
-		$post_id = isset($_GET['post']) ? intval($_GET['post']) : ( is_object( $post ) && isset( $post->ID ) ? $post->ID : NULL );
134
+		$post_id = isset( $_GET[ 'post' ] ) ? intval( $_GET[ 'post' ] ) : ( is_object( $post ) && isset( $post->ID ) ? $post->ID : NULL );
135 135
 
136 136
 		// By default, there will only be one item being modified.
137 137
 		// When in the `bulk_post_updated_messages` filter, there will be passed a number
138 138
 		// of modified items that will override this array.
139
-		$bulk_counts = is_null( $bulk_counts ) ? array( 'updated' => 1 , 'locked' => 1 , 'deleted' => 1 , 'trashed' => 1, 'untrashed' => 1 ) : $bulk_counts;
139
+		$bulk_counts = is_null( $bulk_counts ) ? array( 'updated' => 1, 'locked' => 1, 'deleted' => 1, 'trashed' => 1, 'untrashed' => 1 ) : $bulk_counts;
140 140
 
141 141
 
142 142
 		// If we're starting fresh, a new form was created.
@@ -145,60 +145,60 @@  discard block
 block discarded – undo
145 145
 
146 146
 		$new_form_text = '';
147 147
 
148
-		if( !empty( $start_fresh ) ) {
148
+		if ( ! empty( $start_fresh ) ) {
149 149
 
150 150
 			// Get the form that was created
151 151
 			$connected_form = gravityview_get_form_id( $post_id );
152 152
 
153
-			if( !empty( $connected_form ) ) {
153
+			if ( ! empty( $connected_form ) ) {
154 154
 				$form = gravityview_get_form( $connected_form );
155
-				$form_name = esc_attr( $form['title'] );
155
+				$form_name = esc_attr( $form[ 'title' ] );
156 156
 				$image = self::get_floaty();
157
-				$new_form_text .= '<h3>'.$image.sprintf( __( 'A new form was created for this View: "%s"', 'gravityview' ), $form_name ).'</h3>';
158
-				$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
157
+				$new_form_text .= '<h3>' . $image . sprintf( __( 'A new form was created for this View: "%s"', 'gravityview' ), $form_name ) . '</h3>';
158
+				$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
159 159
 
160 160
 					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.
161
-					', '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>');
161
+					', '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>' );
162 162
 				$new_form_text = wpautop( $new_form_text );
163 163
 
164 164
 				delete_post_meta( $post_id, '_gravityview_start_fresh' );
165 165
 			}
166 166
 		}
167 167
 
168
-		$messages['gravityview'] = array(
168
+		$messages[ 'gravityview' ] = array(
169 169
 			0  => '', // Unused. Messages start at index 1.
170 170
 			/* translators: %s and %s are HTML tags linking to the View on the website */
171
-			1  => sprintf(__( 'View updated. %sView on website.%s', 'gravityview' ), '<a href="'.get_permalink( $post_id ).'">', '</a>'),
171
+			1  => sprintf( __( 'View updated. %sView on website.%s', 'gravityview' ), '<a href="' . get_permalink( $post_id ) . '">', '</a>' ),
172 172
 			/* translators: %s and %s are HTML tags linking to the View on the website */
173
-			2  => sprintf(__( 'View updated. %sView on website.%s', 'gravityview' ), '<a href="'.get_permalink( $post_id ).'">', '</a>'),
173
+			2  => sprintf( __( 'View updated. %sView on website.%s', 'gravityview' ), '<a href="' . get_permalink( $post_id ) . '">', '</a>' ),
174 174
 			3  => __( 'View deleted.', 'gravityview' ),
175 175
 			/* translators: %s and %s are HTML tags linking to the View on the website */
176
-			4  => sprintf(__( 'View updated. %sView on website.%s', 'gravityview' ), '<a href="'.get_permalink( $post_id ).'">', '</a>'),
176
+			4  => sprintf( __( 'View updated. %sView on website.%s', 'gravityview' ), '<a href="' . get_permalink( $post_id ) . '">', '</a>' ),
177 177
 			/* translators: %s: date and time of the revision */
178
-			5  => isset( $_GET['revision'] ) ? sprintf( __( 'View restored to revision from %s', 'gravityview' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
178
+			5  => isset( $_GET[ 'revision' ] ) ? sprintf( __( 'View restored to revision from %s', 'gravityview' ), wp_post_revision_title( (int)$_GET[ 'revision' ], false ) ) : false,
179 179
 			/* translators: %s and %s are HTML tags linking to the View on the website */
180
-			6  => sprintf(__( 'View published. %sView on website.%s', 'gravityview' ), '<a href="'.get_permalink( $post_id ).'">', '</a>') . $new_form_text,
180
+			6  => sprintf( __( 'View published. %sView on website.%s', 'gravityview' ), '<a href="' . get_permalink( $post_id ) . '">', '</a>' ) . $new_form_text,
181 181
 			/* translators: %s and %s are HTML tags linking to the View on the website */
182
-			7  => sprintf(__( 'View saved. %sView on website.%s', 'gravityview' ), '<a href="'.get_permalink( $post_id ).'">', '</a>') . $new_form_text,
182
+			7  => sprintf( __( 'View saved. %sView on website.%s', 'gravityview' ), '<a href="' . get_permalink( $post_id ) . '">', '</a>' ) . $new_form_text,
183 183
 			8  => __( 'View submitted.', 'gravityview' ),
184 184
 			9  => sprintf(
185 185
 		        /* translators: Date and time the View is scheduled to be published */
186 186
 				__( 'View scheduled for: %1$s.', 'gravityview' ),
187 187
 				// translators: Publish box date format, see http://php.net/date
188
-				date_i18n( __( 'M j, Y @ G:i', 'gravityview' ), strtotime( ( isset( $post->post_date ) ? $post->post_date : NULL )  ) )
188
+				date_i18n( __( 'M j, Y @ G:i', 'gravityview' ), strtotime( ( isset( $post->post_date ) ? $post->post_date : NULL ) ) )
189 189
 			) . $new_form_text,
190 190
 			/* translators: %s and %s are HTML tags linking to the View on the website */
191
-			10  => sprintf(__( 'View draft updated. %sView on website.%s', 'gravityview' ), '<a href="'.get_permalink( $post_id ).'">', '</a>'),
191
+			10  => sprintf( __( 'View draft updated. %sView on website.%s', 'gravityview' ), '<a href="' . get_permalink( $post_id ) . '">', '</a>' ),
192 192
 
193 193
 			/**
194 194
 			 * These apply to `bulk_post_updated_messages`
195 195
 			 * @file wp-admin/edit.php
196 196
 			 */
197
-			'updated'   => _n( '%s View updated.', '%s Views updated.', $bulk_counts['updated'], 'gravityview' ),
198
-			'locked'    => _n( '%s View not updated, somebody is editing it.', '%s Views not updated, somebody is editing them.', $bulk_counts['locked'], 'gravityview' ),
199
-			'deleted'   => _n( '%s View permanently deleted.', '%s Views permanently deleted.', $bulk_counts['deleted'], 'gravityview' ),
200
-			'trashed'   => _n( '%s View moved to the Trash.', '%s Views moved to the Trash.', $bulk_counts['trashed'], 'gravityview' ),
201
-			'untrashed' => _n( '%s View restored from the Trash.', '%s Views restored from the Trash.', $bulk_counts['untrashed'], 'gravityview' ),
197
+			'updated'   => _n( '%s View updated.', '%s Views updated.', $bulk_counts[ 'updated' ], 'gravityview' ),
198
+			'locked'    => _n( '%s View not updated, somebody is editing it.', '%s Views not updated, somebody is editing them.', $bulk_counts[ 'locked' ], 'gravityview' ),
199
+			'deleted'   => _n( '%s View permanently deleted.', '%s Views permanently deleted.', $bulk_counts[ 'deleted' ], 'gravityview' ),
200
+			'trashed'   => _n( '%s View moved to the Trash.', '%s Views moved to the Trash.', $bulk_counts[ 'trashed' ], 'gravityview' ),
201
+			'untrashed' => _n( '%s View restored from the Trash.', '%s Views restored from the Trash.', $bulk_counts[ 'untrashed' ], 'gravityview' ),
202 202
 		);
203 203
 
204 204
 		return $messages;
@@ -211,13 +211,13 @@  discard block
 block discarded – undo
211 211
 	function no_conflict_scripts() {
212 212
 		global $wp_scripts;
213 213
 
214
-		if( ! gravityview_is_admin_page() ) {
214
+		if ( ! gravityview_is_admin_page() ) {
215 215
 			return;
216 216
 		}
217 217
 
218
-		$no_conflict_mode = GravityView_Settings::getSetting('no-conflict-mode');
218
+		$no_conflict_mode = GravityView_Settings::getSetting( 'no-conflict-mode' );
219 219
 
220
-		if( empty( $no_conflict_mode ) ) {
220
+		if ( empty( $no_conflict_mode ) ) {
221 221
 			return;
222 222
 		}
223 223
 
@@ -267,24 +267,24 @@  discard block
 block discarded – undo
267 267
 	function no_conflict_styles() {
268 268
 		global $wp_styles;
269 269
 
270
-		if( ! gravityview_is_admin_page() ) {
270
+		if ( ! gravityview_is_admin_page() ) {
271 271
 			return;
272 272
 		}
273 273
 
274 274
 		// Dequeue other jQuery styles even if no-conflict is off.
275 275
 		// Terrible-looking tabs help no one.
276
-		if( !empty( $wp_styles->registered ) )  {
277
-			foreach ($wp_styles->registered as $key => $style) {
278
-				if( preg_match( '/^(?:wp\-)?jquery/ism', $key ) ) {
276
+		if ( ! empty( $wp_styles->registered ) ) {
277
+			foreach ( $wp_styles->registered as $key => $style ) {
278
+				if ( preg_match( '/^(?:wp\-)?jquery/ism', $key ) ) {
279 279
 					wp_dequeue_style( $key );
280 280
 				}
281 281
 			}
282 282
 		}
283 283
 
284
-		$no_conflict_mode = GravityView_Settings::getSetting('no-conflict-mode');
284
+		$no_conflict_mode = GravityView_Settings::getSetting( 'no-conflict-mode' );
285 285
 
286 286
 		// If no conflict is off, jQuery will suffice.
287
-		if( empty( $no_conflict_mode ) ) {
287
+		if ( empty( $no_conflict_mode ) ) {
288 288
 			return;
289 289
 		}
290 290
 
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
 		/**
312 312
 		 * @action `gravityview_remove_conflicts_after` Runs after no-conflict styles are removed. You can re-add styles here.
313 313
 		 */
314
-		do_action('gravityview_remove_conflicts_after');
314
+		do_action( 'gravityview_remove_conflicts_after' );
315 315
 	}
316 316
 
317 317
 	/**
@@ -333,9 +333,9 @@  discard block
 block discarded – undo
333 333
 
334 334
         //reset queue
335 335
         $queue = array();
336
-        foreach( $wp_objects->queue as $object ) {
337
-	        if( in_array( $object, $required_objects ) || preg_match('/gravityview|gf_|gravityforms/ism', $object ) ) {
338
-                $queue[] = $object;
336
+        foreach ( $wp_objects->queue as $object ) {
337
+	        if ( in_array( $object, $required_objects ) || preg_match( '/gravityview|gf_|gravityforms/ism', $object ) ) {
338
+                $queue[ ] = $object;
339 339
             }
340 340
         }
341 341
         $wp_objects->queue = $queue;
@@ -344,8 +344,8 @@  discard block
 block discarded – undo
344 344
 
345 345
         //unregistering scripts
346 346
         $registered = array();
347
-        foreach( $wp_objects->registered as $handle => $script_registration ){
348
-            if( in_array( $handle, $required_objects ) ){
347
+        foreach ( $wp_objects->registered as $handle => $script_registration ) {
348
+            if ( in_array( $handle, $required_objects ) ) {
349 349
                 $registered[ $handle ] = $script_registration;
350 350
             }
351 351
         }
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
 	 * @param [type] $registered [description]
359 359
 	 * @param [type] $scripts    [description]
360 360
 	 */
361
-	private function add_script_dependencies($registered, $scripts) {
361
+	private function add_script_dependencies( $registered, $scripts ) {
362 362
 
363 363
 		//gets all dependent scripts linked to the $scripts array passed
364 364
 		do {
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
 				$deps = isset( $registered[ $script ] ) && is_array( $registered[ $script ]->deps ) ? $registered[ $script ]->deps : array();
368 368
 				foreach ( $deps as $dep ) {
369 369
 					if ( ! in_array( $dep, $scripts ) && ! in_array( $dep, $dependents ) ) {
370
-						$dependents[] = $dep;
370
+						$dependents[ ] = $dep;
371 371
 					}
372 372
 				}
373 373
 			}
@@ -431,29 +431,29 @@  discard block
 block discarded – undo
431 431
 	static function is_admin_page( $hook = '', $page = NULL ) {
432 432
 		global $current_screen, $plugin_page, $pagenow, $post;
433 433
 
434
-		if( ! is_admin() ) { return false; }
434
+		if ( ! is_admin() ) { return false; }
435 435
 
436 436
 		$is_page = false;
437 437
 
438
-		$is_gv_screen = (!empty($current_screen) && isset($current_screen->post_type) && $current_screen->post_type === 'gravityview');
438
+		$is_gv_screen = ( ! empty( $current_screen ) && isset( $current_screen->post_type ) && $current_screen->post_type === 'gravityview' );
439 439
 
440
-		$is_gv_post_type_get = (isset($_GET['post_type']) && $_GET['post_type'] === 'gravityview');
440
+		$is_gv_post_type_get = ( isset( $_GET[ 'post_type' ] ) && $_GET[ 'post_type' ] === 'gravityview' );
441 441
 
442
-		$is_gv_settings_get = isset( $_GET['page'] ) && $_GET['page'] === 'gravityview_settings';
442
+		$is_gv_settings_get = isset( $_GET[ 'page' ] ) && $_GET[ 'page' ] === 'gravityview_settings';
443 443
 
444
-		if( empty( $post ) && $pagenow === 'post.php' && !empty( $_GET['post'] ) ) {
445
-			$gv_post = get_post( intval( $_GET['post'] ) );
446
-			$is_gv_post_type = (!empty($gv_post) && !empty($gv_post->post_type) && $gv_post->post_type === 'gravityview');
444
+		if ( empty( $post ) && $pagenow === 'post.php' && ! empty( $_GET[ 'post' ] ) ) {
445
+			$gv_post = get_post( intval( $_GET[ 'post' ] ) );
446
+			$is_gv_post_type = ( ! empty( $gv_post ) && ! empty( $gv_post->post_type ) && $gv_post->post_type === 'gravityview' );
447 447
 		} else {
448
-			$is_gv_post_type = (!empty($post) && !empty($post->post_type) && $post->post_type === 'gravityview');
448
+			$is_gv_post_type = ( ! empty( $post ) && ! empty( $post->post_type ) && $post->post_type === 'gravityview' );
449 449
 		}
450 450
 
451
-		if( $is_gv_screen || $is_gv_post_type || $is_gv_post_type || $is_gv_post_type_get || $is_gv_settings_get ) {
451
+		if ( $is_gv_screen || $is_gv_post_type || $is_gv_post_type || $is_gv_post_type_get || $is_gv_settings_get ) {
452 452
 
453 453
 			// $_GET `post_type` variable
454
-			if(in_array($pagenow, array( 'post.php' , 'post-new.php' )) ) {
454
+			if ( in_array( $pagenow, array( 'post.php', 'post-new.php' ) ) ) {
455 455
 				$is_page = 'single';
456
-			} else if ( in_array( $plugin_page, array( 'gravityview_settings', 'gravityview_page_gravityview_settings' ) ) || ( !empty( $_GET['page'] ) && $_GET['page'] === 'gravityview_settings' ) ) {
456
+			} else if ( in_array( $plugin_page, array( 'gravityview_settings', 'gravityview_page_gravityview_settings' ) ) || ( ! empty( $_GET[ 'page' ] ) && $_GET[ 'page' ] === 'gravityview_settings' ) ) {
457 457
 				$is_page = 'settings';
458 458
 			} else {
459 459
 				$is_page = 'views';
@@ -468,7 +468,7 @@  discard block
 block discarded – undo
468 468
 		$is_page = apply_filters( 'gravityview_is_admin_page', $is_page, $hook );
469 469
 
470 470
 		// If the current page is the same as the compared page
471
-		if( !empty( $page ) ) {
471
+		if ( ! empty( $page ) ) {
472 472
 			return $is_page === $page;
473 473
 		}
474 474
 
@@ -489,6 +489,6 @@  discard block
 block discarded – undo
489 489
  *
490 490
  * @return bool|string|void 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`)
491 491
  */
492
-function gravityview_is_admin_page($hook = '', $page = NULL) {
492
+function gravityview_is_admin_page( $hook = '', $page = NULL ) {
493 493
 	return GravityView_Admin::is_admin_page( $hook, $page );
494 494
 }
Please login to merge, or discard this patch.
includes/class-gravityview-merge-tags.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 	 * @param  bool       $esc_html     Pass return value through `esc_html()`
42 42
 	 * @return string                  Text with variables maybe replaced
43 43
 	 */
44
-	public static function replace_variables($text, $form = array(), $entry = array(), $url_encode = false, $esc_html = true ) {
44
+	public static function replace_variables( $text, $form = array(), $entry = array(), $url_encode = false, $esc_html = true ) {
45 45
 
46 46
 		/**
47 47
 		 * @filter `gravityview_do_replace_variables` Turn off merge tag variable replacements.\n
@@ -64,9 +64,9 @@  discard block
 block discarded – undo
64 64
 		 *
65 65
 		 * @internal Reported to GF Support on 12/3
66 66
 		 */
67
-		$form['title']  = isset( $form['title'] ) ? $form['title'] : '';
68
-		$form['id']     = isset( $form['id'] ) ? $form['id'] : '';
69
-		$form['fields'] = isset( $form['fields'] ) ? $form['fields'] : array();
67
+		$form[ 'title' ]  = isset( $form[ 'title' ] ) ? $form[ 'title' ] : '';
68
+		$form[ 'id' ]     = isset( $form[ 'id' ] ) ? $form[ 'id' ] : '';
69
+		$form[ 'fields' ] = isset( $form[ 'fields' ] ) ? $form[ 'fields' ] : array();
70 70
 
71 71
 		return GFCommon::replace_variables( $text, $form, $entry, $url_encode, $esc_html );
72 72
 	}
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 	 *
87 87
 	 * @return mixed
88 88
 	 */
89
-	public static function replace_gv_merge_tags(  $text, $form = array(), $entry = array(), $url_encode = false, $esc_html = false ) {
89
+	public static function replace_gv_merge_tags( $text, $form = array(), $entry = array(), $url_encode = false, $esc_html = false ) {
90 90
 
91 91
 		/**
92 92
 		 * This prevents the gform_replace_merge_tags filter from being called twice, as defined in:
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 		 * @see GFCommon::replace_variables_prepopulate()
95 95
 		 * @todo Remove eventually: Gravity Forms fixed this issue in 1.9.14
96 96
 		 */
97
-		if( false === $form ) {
97
+		if ( false === $form ) {
98 98
 			return $text;
99 99
 		}
100 100
 
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 			'diff' => in_array( 'diff', $exploded ), // {date_created:diff}
127 127
 			'raw' => in_array( 'raw', $exploded ), // {date_created:raw}
128 128
 			'timestamp' => in_array( 'timestamp', $exploded ), // {date_created:timestamp}
129
-			'time' => in_array( 'time', $exploded ),  // {date_created:time}
129
+			'time' => in_array( 'time', $exploded ), // {date_created:time}
130 130
 		);
131 131
 
132 132
 		$formatted_date = GVCommon::format_date( $date_created, $atts );
@@ -189,14 +189,14 @@  discard block
 block discarded – undo
189 189
 		preg_match_all( "/{get:(.*?)}/ism", $text, $matches, PREG_SET_ORDER );
190 190
 
191 191
 		// If there are no matches OR the Entry `created_by` isn't set or is 0 (no user)
192
-		if( empty( $matches ) ) {
192
+		if ( empty( $matches ) ) {
193 193
 			return $text;
194 194
 		}
195 195
 
196 196
 		foreach ( $matches as $match ) {
197 197
 
198
-			$full_tag = $match[0];
199
-			$property = $match[1];
198
+			$full_tag = $match[ 0 ];
199
+			$property = $match[ 1 ];
200 200
 
201 201
 			$value = stripslashes_deep( rgget( $property ) );
202 202
 
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 			 * @since 1.15
221 221
 			 * @param bool $esc_html Whether to esc_html() the value. Default: `true`
222 222
 			 */
223
-			$esc_html = apply_filters('gravityview/merge_tags/get/esc_html/' . $property, true );
223
+			$esc_html = apply_filters( 'gravityview/merge_tags/get/esc_html/' . $property, true );
224 224
 
225 225
 			$value = $esc_html ? esc_html( $value ) : $value;
226 226
 
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
 			 * @param[in] array $form Gravity Forms form array
232 232
 			 * @param[in] array $entry Entry array
233 233
 			 */
234
-			$value = apply_filters('gravityview/merge_tags/get/value/' . $property, $value, $text, $form, $entry );
234
+			$value = apply_filters( 'gravityview/merge_tags/get/value/' . $property, $value, $text, $form, $entry );
235 235
 
236 236
 			$text = str_replace( $full_tag, $value, $text );
237 237
 		}
Please login to merge, or discard this patch.