Completed
Push — master ( 2cfa6f...8927a4 )
by Zack
10:00 queued 06:05
created
includes/admin/metaboxes/views/data-source.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 wp_nonce_field( 'gravityview_select_form', 'gravityview_select_form_nonce' );
12 12
 
13 13
 //current value
14
-$current_form = (int) rgar( (array) $_GET, 'form_id', gravityview_get_form_id( $post->ID ) );
14
+$current_form = (int)rgar( (array)$_GET, 'form_id', gravityview_get_form_id( $post->ID ) );
15 15
 
16 16
 // check for available gravity forms
17 17
 $forms = gravityview_get_forms();
@@ -26,24 +26,24 @@  discard block
 block discarded – undo
26 26
 		?>
27 27
 		<a class="button button-primary" href="#gv_start_fresh" title="<?php esc_attr_e( 'Start Fresh', 'gravityview' ); ?>"><?php esc_html_e( 'Start Fresh', 'gravityview' ); ?></a>
28 28
 
29
-		<?php if( !empty( $forms ) ) { ?>
29
+		<?php if ( ! empty( $forms ) ) { ?>
30 30
 			<span>&nbsp;<?php esc_html_e( 'or use an existing form', 'gravityview' ); ?>&nbsp;</span>
31 31
 		<?php }
32 32
 	}
33 33
 
34 34
 	// If there are no forms to select, show no forms.
35
-	if( !empty( $forms ) ) { ?>
35
+	if ( ! empty( $forms ) ) { ?>
36 36
 		<select name="gravityview_form_id" id="gravityview_form_id">
37 37
 			<option value="" <?php selected( '', $current_form, true ); ?>>&mdash; <?php esc_html_e( 'list of forms', 'gravityview' ); ?> &mdash;</option>
38
-			<?php foreach( $forms as $form ) { ?>
39
-				<option value="<?php echo $form['id']; ?>" <?php selected( $form['id'], $current_form, true ); ?>><?php echo esc_html( $form['title'] ); ?></option>
38
+			<?php foreach ( $forms as $form ) { ?>
39
+				<option value="<?php echo $form[ 'id' ]; ?>" <?php selected( $form[ 'id' ], $current_form, true ); ?>><?php echo esc_html( $form[ 'title' ] ); ?></option>
40 40
 			<?php } ?>
41 41
 		</select>
42 42
 	<?php } else { ?>
43 43
 		<select name="gravityview_form_id" id="gravityview_form_id" class="hidden"><option selected="selected" value=""></option></select>
44 44
 	<?php } ?>
45 45
 
46
-	&nbsp;<a class="button button-primary" <?php if( empty( $current_form ) ) { echo 'style="display:none;"'; } ?> id="gv_switch_view_button" href="#gv_switch_view" title="<?php esc_attr_e( 'Switch View', 'gravityview' ); ?>"><?php esc_html_e( 'Switch View Type', 'gravityview' ); ?></a>
46
+	&nbsp;<a class="button button-primary" <?php if ( empty( $current_form ) ) { echo 'style="display:none;"'; } ?> id="gv_switch_view_button" href="#gv_switch_view" title="<?php esc_attr_e( 'Switch View', 'gravityview' ); ?>"><?php esc_html_e( 'Switch View Type', 'gravityview' ); ?></a>
47 47
 </p>
48 48
 
49 49
 <?php // confirm dialog box ?>
Please login to merge, or discard this patch.
includes/class-gravityview-change-entry-creator.php 1 patch
Spacing   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -10,17 +10,17 @@  discard block
 block discarded – undo
10 10
     	/**
11 11
     	 * @since  1.5.1
12 12
     	 */
13
-    	add_action('gform_user_registered', array( $this, 'assign_new_user_to_lead'), 10, 4 );
13
+    	add_action( 'gform_user_registered', array( $this, 'assign_new_user_to_lead' ), 10, 4 );
14 14
 
15 15
     	// ONLY ADMIN FROM HERE ON.
16
-    	if( !is_admin() ) { return; }
16
+    	if ( ! is_admin() ) { return; }
17 17
 
18 18
 	    /**
19 19
          * @filter `gravityview_disable_change_entry_creator` Disable the Change Entry Creator functionality
20 20
 	     * @since 1.7.4
21 21
 	     * @param boolean $disable Disable the Change Entry Creator functionality. Default: false.
22 22
 	     */
23
-	    if( apply_filters('gravityview_disable_change_entry_creator', false ) ) {
23
+	    if ( apply_filters( 'gravityview_disable_change_entry_creator', false ) ) {
24 24
 		    return;
25 25
 	    }
26 26
 
@@ -28,9 +28,9 @@  discard block
 block discarded – undo
28 28
          * Use `init` to fix bbPress warning
29 29
          * @see https://bbpress.trac.wordpress.org/ticket/2309
30 30
          */
31
-    	add_action('init', array( $this, 'load'), 100 );
31
+    	add_action( 'init', array( $this, 'load' ), 100 );
32 32
 
33
-    	add_action('plugins_loaded', array( $this, 'prevent_conflicts') );
33
+    	add_action( 'plugins_loaded', array( $this, 'prevent_conflicts' ) );
34 34
 
35 35
     }
36 36
 
@@ -56,24 +56,24 @@  discard block
 block discarded – undo
56 56
     	$assign_to_lead = apply_filters( 'gravityview_assign_new_user_to_entry', true, $user_id, $config, $entry );
57 57
 
58 58
     	// If filter returns false, do not process
59
-    	if( empty( $assign_to_lead ) ) {
59
+    	if ( empty( $assign_to_lead ) ) {
60 60
     		return;
61 61
     	}
62 62
 
63 63
     	// Update the entry. The `false` prevents checking Akismet; `true` disables the user updated hook from firing
64
-    	$result = RGFormsModel::update_lead_property( $entry['id'], 'created_by', $user_id, false, true );
64
+    	$result = RGFormsModel::update_lead_property( $entry[ 'id' ], 'created_by', $user_id, false, true );
65 65
 
66
-    	if( empty( $result ) ) {
67
-    		$status = __('Error', 'gravityview');
66
+    	if ( empty( $result ) ) {
67
+    		$status = __( 'Error', 'gravityview' );
68 68
     	} else {
69
-    		$status = __('Success', 'gravityview');
69
+    		$status = __( 'Success', 'gravityview' );
70 70
     	}
71 71
 
72
-    	$note = sprintf( _x('%s: Assigned User ID #%d as the entry creator.', 'First parameter: Success or error of the action. Second: User ID number', 'gravityview'), $status, $user_id );
72
+    	$note = sprintf( _x( '%s: Assigned User ID #%d as the entry creator.', 'First parameter: Success or error of the action. Second: User ID number', 'gravityview' ), $status, $user_id );
73 73
 
74
-    	do_action( 'gravityview_log_debug', 'GravityView_Change_Entry_Creator[assign_new_user_to_lead] - '.$note );
74
+    	do_action( 'gravityview_log_debug', 'GravityView_Change_Entry_Creator[assign_new_user_to_lead] - ' . $note );
75 75
 
76
-        GravityView_Entry_Notes::add_note( $entry['id'], -1, 'GravityView', $note, 'gravityview' );
76
+        GravityView_Entry_Notes::add_note( $entry[ 'id' ], -1, 'GravityView', $note, 'gravityview' );
77 77
 
78 78
     }
79 79
 
@@ -85,20 +85,20 @@  discard block
 block discarded – undo
85 85
 
86 86
     	// Plugin that was provided here:
87 87
     	// @link https://gravityview.co/support/documentation/201991205/
88
-    	remove_action("gform_entry_info", 'gravityview_change_entry_creator_form', 10 );
89
-    	remove_action("gform_after_update_entry", 'gravityview_update_entry_creator', 10 );
88
+    	remove_action( "gform_entry_info", 'gravityview_change_entry_creator_form', 10 );
89
+    	remove_action( "gform_after_update_entry", 'gravityview_update_entry_creator', 10 );
90 90
 
91 91
     	// Disable for Gravity Forms Add-ons 3.6.2 and lower
92
-    	if( class_exists( 'KWS_GF_Change_Lead_Creator' ) ) {
92
+    	if ( class_exists( 'KWS_GF_Change_Lead_Creator' ) ) {
93 93
 
94 94
     		$Old_Lead_Creator = new KWS_GF_Change_Lead_Creator;
95 95
 
96 96
     		// Now, no validation is required in the methods; let's hook in.
97
-    		remove_action('admin_init', array( $Old_Lead_Creator, 'set_screen_mode' ) );
97
+    		remove_action( 'admin_init', array( $Old_Lead_Creator, 'set_screen_mode' ) );
98 98
 
99
-    		remove_action("gform_entry_info", array( $Old_Lead_Creator, 'add_select' ), 10 );
99
+    		remove_action( "gform_entry_info", array( $Old_Lead_Creator, 'add_select' ), 10 );
100 100
 
101
-    		remove_action("gform_after_update_entry", array( $Old_Lead_Creator, 'update_entry_creator' ), 10 );
101
+    		remove_action( "gform_after_update_entry", array( $Old_Lead_Creator, 'update_entry_creator' ), 10 );
102 102
     	}
103 103
 
104 104
     }
@@ -110,26 +110,26 @@  discard block
 block discarded – undo
110 110
     function load() {
111 111
 
112 112
     	// Does GF exist?
113
-        if( !class_exists('GFCommon') ) {
113
+        if ( ! class_exists( 'GFCommon' ) ) {
114 114
             return;
115 115
         }
116 116
 
117 117
         // Can the user edit entries?
118
-        if( ! GVCommon::has_cap( array( 'gravityforms_edit_entries', 'gravityview_edit_entries' ) ) ) {
118
+        if ( ! GVCommon::has_cap( array( 'gravityforms_edit_entries', 'gravityview_edit_entries' ) ) ) {
119 119
             return;
120 120
         }
121 121
 
122 122
         // If screen mode isn't set, then we're in the wrong place.
123
-        if( empty( $_REQUEST['screen_mode'] ) ) {
123
+        if ( empty( $_REQUEST[ 'screen_mode' ] ) ) {
124 124
             return;
125 125
         }
126 126
 
127 127
         // Now, no validation is required in the methods; let's hook in.
128
-        add_action('admin_init', array( &$this, 'set_screen_mode' ) );
128
+        add_action( 'admin_init', array( &$this, 'set_screen_mode' ) );
129 129
 
130
-        add_action("gform_entry_info", array( &$this, 'add_select' ), 10, 2);
130
+        add_action( "gform_entry_info", array( &$this, 'add_select' ), 10, 2 );
131 131
 
132
-        add_action("gform_after_update_entry", array( &$this, 'update_entry_creator' ), 10, 2);
132
+        add_action( "gform_after_update_entry", array( &$this, 'update_entry_creator' ), 10, 2 );
133 133
 
134 134
     }
135 135
 
@@ -140,8 +140,8 @@  discard block
 block discarded – undo
140 140
     function set_screen_mode() {
141 141
 
142 142
     	// If $_GET['screen_mode'] is set to edit, set $_POST value
143
-        if( rgget('screen_mode') === 'edit' ) {
144
-            $_POST["screen_mode"] = 'edit';
143
+        if ( rgget( 'screen_mode' ) === 'edit' ) {
144
+            $_POST[ "screen_mode" ] = 'edit';
145 145
         }
146 146
 
147 147
     }
@@ -152,42 +152,42 @@  discard block
 block discarded – undo
152 152
      * @param  int $entry_id Entry ID
153 153
      * @return void
154 154
      */
155
-    function update_entry_creator($form, $entry_id) {
155
+    function update_entry_creator( $form, $entry_id ) {
156 156
             global $current_user;
157 157
 
158 158
         // Update the entry
159
-        $created_by = absint( rgpost('created_by') );
159
+        $created_by = absint( rgpost( 'created_by' ) );
160 160
 
161 161
         RGFormsModel::update_lead_property( $entry_id, 'created_by', $created_by );
162 162
 
163 163
         // If the creator has changed, let's add a note about who it used to be.
164
-        $originally_created_by = rgpost('originally_created_by');
164
+        $originally_created_by = rgpost( 'originally_created_by' );
165 165
 
166 166
         // If there's no owner and there didn't used to be, keep going
167
-        if( empty( $originally_created_by ) && empty( $created_by ) ) {
167
+        if ( empty( $originally_created_by ) && empty( $created_by ) ) {
168 168
             return;
169 169
         }
170 170
 
171 171
         // If the values have changed
172
-        if( absint( $originally_created_by ) !== absint( $created_by ) ) {
172
+        if ( absint( $originally_created_by ) !== absint( $created_by ) ) {
173 173
 
174
-            $user_data = get_userdata($current_user->ID);
174
+            $user_data = get_userdata( $current_user->ID );
175 175
 
176
-            $user_format = _x('%s (ID #%d)', 'The name and the ID of users who initiated changes to entry ownership', 'gravityview');
176
+            $user_format = _x( '%s (ID #%d)', 'The name and the ID of users who initiated changes to entry ownership', 'gravityview' );
177 177
 
178
-            $original_name = $created_by_name = esc_attr_x( 'No User', 'To show that the entry was unassigned from an actual user to no user.', 'gravityview');
178
+            $original_name = $created_by_name = esc_attr_x( 'No User', 'To show that the entry was unassigned from an actual user to no user.', 'gravityview' );
179 179
 
180
-            if( !empty( $originally_created_by ) ) {
181
-                $originally_created_by_user_data = get_userdata($originally_created_by);
180
+            if ( ! empty( $originally_created_by ) ) {
181
+                $originally_created_by_user_data = get_userdata( $originally_created_by );
182 182
                 $original_name = sprintf( $user_format, $originally_created_by_user_data->display_name, $originally_created_by_user_data->ID );
183 183
             }
184 184
 
185
-            if( !empty( $created_by ) ) {
186
-                $created_by_user_data =  get_userdata($created_by);
185
+            if ( ! empty( $created_by ) ) {
186
+                $created_by_user_data = get_userdata( $created_by );
187 187
                 $created_by_name = sprintf( $user_format, $created_by_user_data->display_name, $created_by_user_data->ID );
188 188
             }
189 189
 
190
-            GravityView_Entry_Notes::add_note( $entry_id, $current_user->ID, $user_data->display_name, sprintf( __('Changed entry creator from %s to %s', 'gravityview'), $original_name, $created_by_name ), 'note' );
190
+            GravityView_Entry_Notes::add_note( $entry_id, $current_user->ID, $user_data->display_name, sprintf( __( 'Changed entry creator from %s to %s', 'gravityview' ), $original_name, $created_by_name ), 'note' );
191 191
         }
192 192
 
193 193
     }
@@ -198,24 +198,24 @@  discard block
 block discarded – undo
198 198
      * @param array $entry    GF entry array
199 199
      * @return void
200 200
      */
201
-    function add_select($form_id, $entry ) {
201
+    function add_select( $form_id, $entry ) {
202 202
 
203
-        if( rgpost('screen_mode') !== 'edit' ) {
203
+        if ( rgpost( 'screen_mode' ) !== 'edit' ) {
204 204
             return;
205 205
         }
206 206
 
207 207
         $users = GVCommon::get_users( 'change_entry_creator' );
208 208
 
209 209
         $output = '<label for="change_created_by">';
210
-        $output .= esc_html__('Change Entry Creator:', 'gravityview');
210
+        $output .= esc_html__( 'Change Entry Creator:', 'gravityview' );
211 211
         $output .= '</label>
212 212
         <select name="created_by" id="change_created_by" class="widefat">';
213
-        $output .= '<option value=""> &mdash; '.esc_attr_x( 'No User', 'No user assigned to the entry', 'gravityview').' &mdash; </option>';
214
-        foreach($users as $user) {
215
-            $output .= '<option value="'. $user->ID .'"'. selected( $entry['created_by'], $user->ID, false ).'>'.esc_attr( $user->display_name.' ('.$user->user_nicename.')' ).'</option>';
213
+        $output .= '<option value=""> &mdash; ' . esc_attr_x( 'No User', 'No user assigned to the entry', 'gravityview' ) . ' &mdash; </option>';
214
+        foreach ( $users as $user ) {
215
+            $output .= '<option value="' . $user->ID . '"' . selected( $entry[ 'created_by' ], $user->ID, false ) . '>' . esc_attr( $user->display_name . ' (' . $user->user_nicename . ')' ) . '</option>';
216 216
         }
217 217
         $output .= '</select>';
218
-        $output .= '<input name="originally_created_by" value="'.esc_attr( $entry['created_by'] ).'" type="hidden" />';
218
+        $output .= '<input name="originally_created_by" value="' . esc_attr( $entry[ 'created_by' ] ) . '" type="hidden" />';
219 219
         echo $output;
220 220
 
221 221
     }
Please login to merge, or discard this patch.
includes/class-gv-license-handler.php 1 patch
Spacing   +77 added lines, -77 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 	 * @return GV_License_Handler
41 41
 	 */
42 42
 	public static function get_instance( GravityView_Settings $GFAddOn ) {
43
-		if( empty( self::$instance ) ) {
43
+		if ( empty( self::$instance ) ) {
44 44
 			self::$instance = new self( $GFAddOn );
45 45
 		}
46 46
 		return self::$instance;
@@ -70,12 +70,12 @@  discard block
 block discarded – undo
70 70
 	public function refresh_license_status() {
71 71
 
72 72
 		// Only perform on GravityView pages
73
-		if( ! gravityview_is_admin_page() ) {
73
+		if ( ! gravityview_is_admin_page() ) {
74 74
 			return;
75 75
 		}
76 76
 
77 77
 		// The transient is fresh; don't fetch.
78
-		if( $status = get_transient( self::status_transient_key ) ) {
78
+		if ( $status = get_transient( self::status_transient_key ) ) {
79 79
 			return;
80 80
 		}
81 81
 
@@ -101,37 +101,37 @@  discard block
 block discarded – undo
101 101
 		$status = trim( $this->Addon->get_app_setting( 'license_key_status' ) );
102 102
 		$key = trim( $this->Addon->get_app_setting( 'license_key' ) );
103 103
 
104
-		if( !empty( $key ) ) {
104
+		if ( ! empty( $key ) ) {
105 105
 			$response = $this->Addon->get_app_setting( 'license_key_response' );
106
-			$response = is_array( $response ) ? (object) $response : json_decode( $response );
106
+			$response = is_array( $response ) ? (object)$response : json_decode( $response );
107 107
 		} else {
108 108
 			$response = array();
109 109
 		}
110 110
 
111 111
 		wp_localize_script( 'gv-admin-edd-license', 'GVGlobals', array(
112 112
 			'license_box' => $this->get_license_message( $response )
113
-		));
113
+		) );
114 114
 
115 115
 
116 116
 		$fields = array(
117 117
 			array(
118 118
 				'name'  => 'edd-activate',
119
-				'value' => __('Activate License', 'gravityview'),
120
-				'data-pending_text' => __('Verifying license&hellip;', 'gravityview'),
119
+				'value' => __( 'Activate License', 'gravityview' ),
120
+				'data-pending_text' => __( 'Verifying license&hellip;', 'gravityview' ),
121 121
 				'data-edd_action' => 'activate_license',
122 122
 				'class' => 'button-primary',
123 123
 			),
124 124
 			array(
125 125
 				'name'  => 'edd-deactivate',
126
-				'value' => __('Deactivate License', 'gravityview'),
127
-				'data-pending_text' => __('Deactivating license&hellip;', 'gravityview'),
126
+				'value' => __( 'Deactivate License', 'gravityview' ),
127
+				'data-pending_text' => __( 'Deactivating license&hellip;', 'gravityview' ),
128 128
 				'data-edd_action' => 'deactivate_license',
129 129
 				'class' => ( empty( $status ) ? 'button-primary hide' : 'button-primary' ),
130 130
 			),
131 131
 			array(
132 132
 				'name'  => 'edd-check',
133
-				'value' => __('Check License', 'gravityview'),
134
-				'data-pending_text' => __('Verifying license&hellip;', 'gravityview'),
133
+				'value' => __( 'Check License', 'gravityview' ),
134
+				'data-pending_text' => __( 'Verifying license&hellip;', 'gravityview' ),
135 135
 				'title' => 'Check the license before saving it',
136 136
 				'data-edd_action' => 'check_license',
137 137
 				'class' => 'button-secondary',
@@ -141,17 +141,17 @@  discard block
 block discarded – undo
141 141
 
142 142
 		$class = 'button gv-edd-action';
143 143
 
144
-		$class .= ( !empty( $key ) && $status !== 'valid' ) ? '' : ' hide';
144
+		$class .= ( ! empty( $key ) && $status !== 'valid' ) ? '' : ' hide';
145 145
 
146 146
 		$disabled_attribute = GVCommon::has_cap( 'gravityview_edit_settings' ) ? false : 'disabled';
147 147
 
148 148
 		$submit = '<div class="gv-edd-button-wrapper">';
149 149
 		foreach ( $fields as $field ) {
150
-			$field['type'] = 'button';
151
-			$field['class'] = isset( $field['class'] ) ? $field['class'] . ' '. $class : $class;
152
-			$field['style'] = 'margin-left: 10px;';
153
-			if( $disabled_attribute ) {
154
-				$field['disabled'] = $disabled_attribute;
150
+			$field[ 'type' ] = 'button';
151
+			$field[ 'class' ] = isset( $field[ 'class' ] ) ? $field[ 'class' ] . ' ' . $class : $class;
152
+			$field[ 'style' ] = 'margin-left: 10px;';
153
+			if ( $disabled_attribute ) {
154
+				$field[ 'disabled' ] = $disabled_attribute;
155 155
 			}
156 156
 			$submit .= $this->Addon->settings_submit( $field, $echo );
157 157
 		}
@@ -167,8 +167,8 @@  discard block
 block discarded – undo
167 167
 	 */
168 168
 	private function setup_edd() {
169 169
 
170
-		if( !class_exists('EDD_SL_Plugin_Updater') ) {
171
-			require_once( GRAVITYVIEW_DIR . 'includes/lib/EDD_SL_Plugin_Updater.php');
170
+		if ( ! class_exists( 'EDD_SL_Plugin_Updater' ) ) {
171
+			require_once( GRAVITYVIEW_DIR . 'includes/lib/EDD_SL_Plugin_Updater.php' );
172 172
 		}
173 173
 
174 174
 		// setup the updater
@@ -205,8 +205,8 @@  discard block
 block discarded – undo
205 205
 			'url'       => home_url(),
206 206
 		);
207 207
 
208
-		if( !empty( $action ) ) {
209
-			$settings['edd_action'] = esc_attr( $action );
208
+		if ( ! empty( $action ) ) {
209
+			$settings[ 'edd_action' ] = esc_attr( $action );
210 210
 		}
211 211
 
212 212
 		$settings = array_map( 'urlencode', $settings );
@@ -220,14 +220,14 @@  discard block
 block discarded – undo
220 220
 	 */
221 221
 	private function _license_get_remote_response( $data, $license = '' ) {
222 222
 
223
-		$api_params = $this->_get_edd_settings( $data['edd_action'], $license );
223
+		$api_params = $this->_get_edd_settings( $data[ 'edd_action' ], $license );
224 224
 
225 225
 		$url = add_query_arg( $api_params, self::url );
226 226
 
227 227
 		$response = wp_remote_get( $url, array(
228 228
 			'timeout'   => 15,
229 229
 			'sslverify' => false,
230
-		));
230
+		) );
231 231
 
232 232
 		if ( is_wp_error( $response ) ) {
233 233
 			return array();
@@ -260,11 +260,11 @@  discard block
 block discarded – undo
260 260
 	 */
261 261
 	function get_license_message( $license_data ) {
262 262
 
263
-		if( empty( $license_data ) ) {
263
+		if ( empty( $license_data ) ) {
264 264
 			$message = '';
265 265
 		} else {
266 266
 
267
-			if( ! empty( $license_data->error ) ) {
267
+			if ( ! empty( $license_data->error ) ) {
268 268
 				$class = 'error';
269 269
 				$string_key = $license_data->error;
270 270
 			} else {
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 				$string_key = $license_data->license;
273 273
 			}
274 274
 
275
-			$message = sprintf( '<p><strong>%s: %s</strong></p>', $this->strings('status'), $this->strings( $string_key, $license_data ) );
275
+			$message = sprintf( '<p><strong>%s: %s</strong></p>', $this->strings( 'status' ), $this->strings( $string_key, $license_data ) );
276 276
 
277 277
 			$message = $this->generate_license_box( $message, $class );
278 278
 		}
@@ -309,18 +309,18 @@  discard block
 block discarded – undo
309 309
 	 */
310 310
 	public function license_details( $response = array() ) {
311 311
 
312
-		$response = (array) $response;
312
+		$response = (array)$response;
313 313
 
314 314
 		$return = '';
315 315
 		$wrapper = '<span class="gv-license-details" aria-live="polite" aria-busy="false">%s</span>';
316 316
 
317
-		if( ! empty( $response['license_key'] ) ) {
317
+		if ( ! empty( $response[ 'license_key' ] ) ) {
318 318
 
319 319
 			$return .= '<h3>' . esc_html__( 'License Details:', 'gravityview' ) . '</h3>';
320 320
 
321 321
 			if ( in_array( rgar( $response, 'license' ), array( 'invalid', 'deactivated' ) ) ) {
322
-				$return .= $this->strings( $response['license'], $response );
323
-			} elseif ( ! empty( $response['license_name'] ) ) {
322
+				$return .= $this->strings( $response[ 'license' ], $response );
323
+			} elseif ( ! empty( $response[ 'license_name' ] ) ) {
324 324
 
325 325
 				$response_keys = array(
326 326
 					'license_name'   => '',
@@ -335,19 +335,19 @@  discard block
 block discarded – undo
335 335
 				// Make sure all the keys are set
336 336
 				$response = wp_parse_args( $response, $response_keys );
337 337
 
338
-				$login_link = sprintf( '<a href="%s" class="howto" rel="external">%s</a>', esc_url( sprintf( 'https://gravityview.co/wp-login.php?username=%s', $response['customer_email'] ) ), esc_html__( 'Access your GravityView account', 'gravityview' ) );
339
-				$local_text = ( ! empty( $response['is_local'] ) ? '<span class="howto">' . __( 'This development site does not count toward license activation limits', 'gravityview' ) . '</span>' : '' );
338
+				$login_link = sprintf( '<a href="%s" class="howto" rel="external">%s</a>', esc_url( sprintf( 'https://gravityview.co/wp-login.php?username=%s', $response[ 'customer_email' ] ) ), esc_html__( 'Access your GravityView account', 'gravityview' ) );
339
+				$local_text = ( ! empty( $response[ 'is_local' ] ) ? '<span class="howto">' . __( 'This development site does not count toward license activation limits', 'gravityview' ) . '</span>' : '' );
340 340
 				$details    = array(
341
-					'license'     => sprintf( esc_html__( 'License level: %s', 'gravityview' ), esc_html( $response['license_name'] ), esc_html( $response['license_limit'] ) ),
342
-					'licensed_to' => sprintf( esc_html_x( 'Licensed to: %1$s (%2$s)', '1: Customer name; 2: Customer email', 'gravityview' ), esc_html__( $response['customer_name'], 'gravityview' ), esc_html__( $response['customer_email'], 'gravityview' ) ) . $login_link,
343
-					'activations' => sprintf( esc_html__( 'Activations: %d of %s sites', 'gravityview' ), intval( $response['site_count'] ), esc_html( $response['license_limit'] ) ) . $local_text,
344
-					'expires'     => sprintf( esc_html__( 'Renew on: %s', 'gravityview' ), date_i18n( get_option( 'date_format' ), strtotime( $response['expires'] ) - DAY_IN_SECONDS ) ),
345
-					'upgrade'     => $this->get_upgrade_html( $response['upgrades'] ),
341
+					'license'     => sprintf( esc_html__( 'License level: %s', 'gravityview' ), esc_html( $response[ 'license_name' ] ), esc_html( $response[ 'license_limit' ] ) ),
342
+					'licensed_to' => sprintf( esc_html_x( 'Licensed to: %1$s (%2$s)', '1: Customer name; 2: Customer email', 'gravityview' ), esc_html__( $response[ 'customer_name' ], 'gravityview' ), esc_html__( $response[ 'customer_email' ], 'gravityview' ) ) . $login_link,
343
+					'activations' => sprintf( esc_html__( 'Activations: %d of %s sites', 'gravityview' ), intval( $response[ 'site_count' ] ), esc_html( $response[ 'license_limit' ] ) ) . $local_text,
344
+					'expires'     => sprintf( esc_html__( 'Renew on: %s', 'gravityview' ), date_i18n( get_option( 'date_format' ), strtotime( $response[ 'expires' ] ) - DAY_IN_SECONDS ) ),
345
+					'upgrade'     => $this->get_upgrade_html( $response[ 'upgrades' ] ),
346 346
 				);
347 347
 
348
-				if ( ! empty( $response['error'] ) && 'expired' === $response['error'] ) {
349
-					unset( $details['upgrade'] );
350
-					$details['expires'] = '<div class="error inline"><p>' . $this->strings( 'expired', $response ) . '</p></div>';
348
+				if ( ! empty( $response[ 'error' ] ) && 'expired' === $response[ 'error' ] ) {
349
+					unset( $details[ 'upgrade' ] );
350
+					$details[ 'expires' ] = '<div class="error inline"><p>' . $this->strings( 'expired', $response ) . '</p></div>';
351 351
 				}
352 352
 
353 353
 				$return .= '<ul><li>' . implode( '</li><li>', array_filter( $details ) ) . '</li></ul>';
@@ -370,11 +370,11 @@  discard block
 block discarded – undo
370 370
 
371 371
 		$output = '';
372 372
 
373
-		if( ! empty( $upgrades ) ) {
373
+		if ( ! empty( $upgrades ) ) {
374 374
 
375 375
 			$locale_parts = explode( '_', get_locale() );
376 376
 
377
-			$is_english = ( 'en' === $locale_parts[0] );
377
+			$is_english = ( 'en' === $locale_parts[ 0 ] );
378 378
 
379 379
 			$output .= '<h4>' . esc_html__( 'Upgrades available:', 'gravityview' ) . '</h4>';
380 380
 
@@ -382,14 +382,14 @@  discard block
 block discarded – undo
382 382
 
383 383
 			foreach ( $upgrades as $upgrade_id => $upgrade ) {
384 384
 
385
-				$upgrade = (object) $upgrade;
385
+				$upgrade = (object)$upgrade;
386 386
 
387 387
 				$anchor_text = sprintf( esc_html_x( 'Upgrade to %1$s for %2$s', '1: GravityView upgrade name, 2: Cost of upgrade', 'gravityview' ), esc_attr( $upgrade->name ), esc_attr( $upgrade->price ) );
388 388
 
389
-				if( $is_english && isset( $upgrade->description ) ) {
389
+				if ( $is_english && isset( $upgrade->description ) ) {
390 390
 					$message = esc_html( $upgrade->description );
391 391
 				} else {
392
-					switch( $upgrade->price_id ) {
392
+					switch ( $upgrade->price_id ) {
393 393
 						// Interstellar
394 394
 						case 1:
395 395
 						default:
@@ -427,16 +427,16 @@  discard block
 block discarded – undo
427 427
 	 */
428 428
 	public function license_call( $array = array() ) {
429 429
 
430
-		$is_ajax = ( defined('DOING_AJAX') && DOING_AJAX );
431
-		$data = empty( $array ) ? $_POST['data'] : $array;
430
+		$is_ajax = ( defined( 'DOING_AJAX' ) && DOING_AJAX );
431
+		$data = empty( $array ) ? $_POST[ 'data' ] : $array;
432 432
 		$has_cap = GVCommon::has_cap( 'gravityview_edit_settings' );
433 433
 
434
-		if ( $is_ajax && empty( $data['license'] ) ) {
435
-			die( - 1 );
434
+		if ( $is_ajax && empty( $data[ 'license' ] ) ) {
435
+			die( -1 );
436 436
 		}
437 437
 
438 438
 		// If the user isn't allowed to edit settings, show an error message
439
-		if( ! $has_cap ) {
439
+		if ( ! $has_cap ) {
440 440
 			$license_data = new stdClass();
441 441
 			$license_data->error = 'capability';
442 442
 			$license_data->message = $this->get_license_message( $license_data );
@@ -460,9 +460,9 @@  discard block
 block discarded – undo
460 460
 
461 461
 			$json = json_encode( $license_data );
462 462
 
463
-			$update_license = ( ! isset( $data['update'] ) || ! empty( $data['update'] ) );
463
+			$update_license = ( ! isset( $data[ 'update' ] ) || ! empty( $data[ 'update' ] ) );
464 464
 
465
-			$is_check_action_button = ( 'check_license' === $data['edd_action'] && defined( 'DOING_AJAX' ) && DOING_AJAX );
465
+			$is_check_action_button = ( 'check_license' === $data[ 'edd_action' ] && defined( 'DOING_AJAX' ) && DOING_AJAX );
466 466
 
467 467
 			// Failed is the response from trying to de-activate a license and it didn't work.
468 468
 			// This likely happened because people entered in a different key and clicked "Deactivate",
@@ -470,7 +470,7 @@  discard block
 block discarded – undo
470 470
 			// most likely a mistake.
471 471
 			if ( $license_data->license !== 'failed' && ! $is_check_action_button && $update_license ) {
472 472
 
473
-				if ( ! empty( $data['field_id'] ) ) {
473
+				if ( ! empty( $data[ 'field_id' ] ) ) {
474 474
 					set_transient( self::status_transient_key, $license_data, DAY_IN_SECONDS );
475 475
 				}
476 476
 
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
 		if ( $is_ajax ) {
482 482
 			exit( $json );
483 483
 		} else { // Non-ajax call
484
-			return ( rgget('format', $data ) === 'object' ) ? $license_data : $json;
484
+			return ( rgget( 'format', $data ) === 'object' ) ? $license_data : $json;
485 485
 		}
486 486
 	}
487 487
 
@@ -495,9 +495,9 @@  discard block
 block discarded – undo
495 495
 		// Update option with passed data license
496 496
 		$settings = $this->Addon->get_app_settings();
497 497
 
498
-        $settings['license_key'] = $license_data->license_key = trim( $data['license'] );
499
-		$settings['license_key_status'] = $license_data->license;
500
-		$settings['license_key_response'] = (array)$license_data;
498
+        $settings[ 'license_key' ] = $license_data->license_key = trim( $data[ 'license' ] );
499
+		$settings[ 'license_key_status' ] = $license_data->license;
500
+		$settings[ 'license_key_response' ] = (array)$license_data;
501 501
 
502 502
 		$this->Addon->update_app_settings( $settings );
503 503
 	}
@@ -510,7 +510,7 @@  discard block
 block discarded – undo
510 510
 	 */
511 511
 	private function get_license_renewal_url( $license_data ) {
512 512
 		$license_data = is_array( $license_data ) ? (object)$license_data : $license_data;
513
-		$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&force_login=1', $license_data->license_key ) : 'https://gravityview.co/account/';
513
+		$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&force_login=1', $license_data->license_key ) : 'https://gravityview.co/account/';
514 514
 		return $renew_license_url;
515 515
 	}
516 516
 
@@ -525,31 +525,31 @@  discard block
 block discarded – undo
525 525
 
526 526
 
527 527
 		$strings = array(
528
-			'status' => esc_html__('Status', 'gravityview'),
529
-			'error' => esc_html__('There was an error processing the request.', 'gravityview'),
530
-			'failed'  => esc_html__('Could not deactivate the license. The license key you attempted to deactivate may not be active or valid.', 'gravityview'),
531
-			'site_inactive' => esc_html__('The license key is valid, but it has not been activated for this site.', 'gravityview'),
532
-			'inactive' => esc_html__('The license key is valid, but it has not been activated for this site.', 'gravityview'),
533
-			'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>' ),
534
-			'deactivated' => esc_html__('The license has been deactivated.', 'gravityview'),
535
-			'valid' => esc_html__('The license key is valid and active.', 'gravityview'),
536
-			'invalid' => esc_html__('The license key entered is invalid.', 'gravityview'),
537
-			'missing' => esc_html__('Invalid license key.', 'gravityview'),
538
-			'revoked' => esc_html__('This license key has been revoked.', 'gravityview'),
539
-			'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>' ),
528
+			'status' => esc_html__( 'Status', 'gravityview' ),
529
+			'error' => esc_html__( 'There was an error processing the request.', 'gravityview' ),
530
+			'failed'  => esc_html__( 'Could not deactivate the license. The license key you attempted to deactivate may not be active or valid.', 'gravityview' ),
531
+			'site_inactive' => esc_html__( 'The license key is valid, but it has not been activated for this site.', 'gravityview' ),
532
+			'inactive' => esc_html__( 'The license key is valid, but it has not been activated for this site.', 'gravityview' ),
533
+			'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>' ),
534
+			'deactivated' => esc_html__( 'The license has been deactivated.', 'gravityview' ),
535
+			'valid' => esc_html__( 'The license key is valid and active.', 'gravityview' ),
536
+			'invalid' => esc_html__( 'The license key entered is invalid.', 'gravityview' ),
537
+			'missing' => esc_html__( 'Invalid license key.', 'gravityview' ),
538
+			'revoked' => esc_html__( 'This license key has been revoked.', 'gravityview' ),
539
+			'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>' ),
540 540
 			'capability' => esc_html__( 'You don\'t have the ability to edit plugin settings.', 'gravityview' ),
541 541
 
542
-			'verifying_license' => esc_html__('Verifying license&hellip;', 'gravityview'),
543
-			'activate_license' => esc_html__('Activate License', 'gravityview'),
544
-			'deactivate_license' => esc_html__('Deactivate License', 'gravityview'),
545
-			'check_license' => esc_html__('Verify License', 'gravityview'),
542
+			'verifying_license' => esc_html__( 'Verifying license&hellip;', 'gravityview' ),
543
+			'activate_license' => esc_html__( 'Activate License', 'gravityview' ),
544
+			'deactivate_license' => esc_html__( 'Deactivate License', 'gravityview' ),
545
+			'check_license' => esc_html__( 'Verify License', 'gravityview' ),
546 546
 		);
547 547
 
548
-		if( empty( $status ) ) {
548
+		if ( empty( $status ) ) {
549 549
 			return $strings;
550 550
 		}
551 551
 
552
-		if( isset( $strings[ $status ] ) ) {
552
+		if ( isset( $strings[ $status ] ) ) {
553 553
 			return $strings[ $status ];
554 554
 		}
555 555
 
Please login to merge, or discard this patch.
includes/extensions/edit-entry/class-edit-entry-render.php 1 patch
Spacing   +240 added lines, -240 removed lines patch added patch discarded remove patch
@@ -119,16 +119,16 @@  discard block
 block discarded – undo
119 119
     function load() {
120 120
 
121 121
         /** @define "GRAVITYVIEW_DIR" "../../../" */
122
-        include_once( GRAVITYVIEW_DIR .'includes/class-admin-approve-entries.php' );
122
+        include_once( GRAVITYVIEW_DIR . 'includes/class-admin-approve-entries.php' );
123 123
 
124 124
         // Don't display an embedded form when editing an entry
125 125
         add_action( 'wp_head', array( $this, 'prevent_render_form' ) );
126 126
         add_action( 'wp_footer', array( $this, 'prevent_render_form' ) );
127 127
 
128 128
         // Stop Gravity Forms processing what is ours!
129
-        add_filter( 'wp', array( $this, 'prevent_maybe_process_form'), 8 );
129
+        add_filter( 'wp', array( $this, 'prevent_maybe_process_form' ), 8 );
130 130
 
131
-        add_filter( 'gravityview_is_edit_entry', array( $this, 'is_edit_entry') );
131
+        add_filter( 'gravityview_is_edit_entry', array( $this, 'is_edit_entry' ) );
132 132
 
133 133
         add_action( 'gravityview_edit_entry', array( $this, 'init' ) );
134 134
 
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
         add_filter( 'gform_plupload_settings', array( $this, 'modify_fileupload_settings' ), 10, 3 );
140 140
 
141 141
         // Add fields expected by GFFormDisplay::validate()
142
-        add_filter( 'gform_pre_validation', array( $this, 'gform_pre_validation') );
142
+        add_filter( 'gform_pre_validation', array( $this, 'gform_pre_validation' ) );
143 143
 
144 144
     }
145 145
 
@@ -154,8 +154,8 @@  discard block
 block discarded – undo
154 154
      * @return void
155 155
      */
156 156
     public function prevent_render_form() {
157
-        if( $this->is_edit_entry() ) {
158
-            if( 'wp_head' === current_filter() ) {
157
+        if ( $this->is_edit_entry() ) {
158
+            if ( 'wp_head' === current_filter() ) {
159 159
                 add_filter( 'gform_shortcode_form', '__return_empty_string' );
160 160
             } else {
161 161
                 remove_filter( 'gform_shortcode_form', '__return_empty_string' );
@@ -170,10 +170,10 @@  discard block
 block discarded – undo
170 170
      */
171 171
     public function prevent_maybe_process_form() {
172 172
 
173
-        do_action('gravityview_log_debug', 'GravityView_Edit_Entry[prevent_maybe_process_form] $_POSTed data (sanitized): ', esc_html( print_r( $_POST, true ) ) );
173
+        do_action( 'gravityview_log_debug', 'GravityView_Edit_Entry[prevent_maybe_process_form] $_POSTed data (sanitized): ', esc_html( print_r( $_POST, true ) ) );
174 174
 
175
-        if( $this->is_edit_entry_submission() && $this->verify_nonce() ) {
176
-            remove_action( 'wp',  array( 'RGForms', 'maybe_process_form'), 9 );
175
+        if ( $this->is_edit_entry_submission() && $this->verify_nonce() ) {
176
+            remove_action( 'wp', array( 'RGForms', 'maybe_process_form' ), 9 );
177 177
         }
178 178
     }
179 179
 
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
      */
184 184
     public function is_edit_entry() {
185 185
 
186
-        $is_edit_entry = GravityView_frontend::is_single_entry() && ! empty( $_GET['edit'] );
186
+        $is_edit_entry = GravityView_frontend::is_single_entry() && ! empty( $_GET[ 'edit' ] );
187 187
 
188 188
         return ( $is_edit_entry || $this->is_edit_entry_submission() );
189 189
     }
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
 	 * @return boolean
195 195
 	 */
196 196
 	public function is_edit_entry_submission() {
197
-		return !empty( $_POST[ self::$nonce_field ] );
197
+		return ! empty( $_POST[ self::$nonce_field ] );
198 198
 	}
199 199
 
200 200
     /**
@@ -205,15 +205,15 @@  discard block
 block discarded – undo
205 205
 
206 206
 
207 207
         $entries = $gravityview_view->getEntries();
208
-	    self::$original_entry = $entries[0];
209
-	    $this->entry = $entries[0];
208
+	    self::$original_entry = $entries[ 0 ];
209
+	    $this->entry = $entries[ 0 ];
210 210
 
211 211
         self::$original_form = $gravityview_view->getForm();
212 212
         $this->form = $gravityview_view->getForm();
213 213
         $this->form_id = $gravityview_view->getFormId();
214 214
         $this->view_id = $gravityview_view->getViewId();
215 215
 
216
-        self::$nonce_key = GravityView_Edit_Entry::get_nonce_key( $this->view_id, $this->form_id, $this->entry['id'] );
216
+        self::$nonce_key = GravityView_Edit_Entry::get_nonce_key( $this->view_id, $this->form_id, $this->entry[ 'id' ] );
217 217
     }
218 218
 
219 219
 
@@ -233,14 +233,14 @@  discard block
 block discarded – undo
233 233
         $this->setup_vars();
234 234
 
235 235
         // Multiple Views embedded, don't proceed if nonce fails
236
-        if( $gv_data->has_multiple_views() && ! wp_verify_nonce( $_GET['edit'], self::$nonce_key ) ) {
237
-            do_action('gravityview_log_error', __METHOD__ . ': Nonce validation failed for the Edit Entry request; returning' );
236
+        if ( $gv_data->has_multiple_views() && ! wp_verify_nonce( $_GET[ 'edit' ], self::$nonce_key ) ) {
237
+            do_action( 'gravityview_log_error', __METHOD__ . ': Nonce validation failed for the Edit Entry request; returning' );
238 238
             return;
239 239
         }
240 240
 
241 241
         // Sorry, you're not allowed here.
242
-        if( false === $this->user_can_edit_entry( true ) ) {
243
-            do_action('gravityview_log_error', __METHOD__ . ': User is not allowed to edit this entry; returning', $this->entry );
242
+        if ( false === $this->user_can_edit_entry( true ) ) {
243
+            do_action( 'gravityview_log_error', __METHOD__ . ': User is not allowed to edit this entry; returning', $this->entry );
244 244
             return;
245 245
         }
246 246
 
@@ -260,9 +260,9 @@  discard block
 block discarded – undo
260 260
     private function print_scripts() {
261 261
         $gravityview_view = GravityView_View::getInstance();
262 262
 
263
-        wp_register_script( 'gform_gravityforms', GFCommon::get_base_url().'/js/gravityforms.js', array( 'jquery', 'gform_json', 'gform_placeholder', 'sack', 'plupload-all', 'gravityview-fe-view' ) );
263
+        wp_register_script( 'gform_gravityforms', GFCommon::get_base_url() . '/js/gravityforms.js', array( 'jquery', 'gform_json', 'gform_placeholder', 'sack', 'plupload-all', 'gravityview-fe-view' ) );
264 264
 
265
-        GFFormDisplay::enqueue_form_scripts($gravityview_view->getForm(), false);
265
+        GFFormDisplay::enqueue_form_scripts( $gravityview_view->getForm(), false );
266 266
 
267 267
         // Sack is required for images
268 268
         wp_print_scripts( array( 'sack', 'gform_gravityforms' ) );
@@ -274,32 +274,32 @@  discard block
 block discarded – undo
274 274
      */
275 275
     private function process_save() {
276 276
 
277
-        if( empty( $_POST ) || ! isset( $_POST['lid'] ) ) {
277
+        if ( empty( $_POST ) || ! isset( $_POST[ 'lid' ] ) ) {
278 278
             return;
279 279
         }
280 280
 
281 281
         // Make sure the entry, view, and form IDs are all correct
282 282
         $valid = $this->verify_nonce();
283 283
 
284
-        if( !$valid ) {
285
-            do_action('gravityview_log_error', __METHOD__ . ' Nonce validation failed.' );
284
+        if ( ! $valid ) {
285
+            do_action( 'gravityview_log_error', __METHOD__ . ' Nonce validation failed.' );
286 286
             return;
287 287
         }
288 288
 
289
-        if( $this->entry['id'] !== $_POST['lid'] ) {
290
-            do_action('gravityview_log_error', __METHOD__ . ' Entry ID did not match posted entry ID.' );
289
+        if ( $this->entry[ 'id' ] !== $_POST[ 'lid' ] ) {
290
+            do_action( 'gravityview_log_error', __METHOD__ . ' Entry ID did not match posted entry ID.' );
291 291
             return;
292 292
         }
293 293
 
294
-        do_action('gravityview_log_debug', __METHOD__ . ': $_POSTed data (sanitized): ', esc_html( print_r( $_POST, true ) ) );
294
+        do_action( 'gravityview_log_debug', __METHOD__ . ': $_POSTed data (sanitized): ', esc_html( print_r( $_POST, true ) ) );
295 295
 
296 296
         $this->process_save_process_files( $this->form_id );
297 297
 
298 298
         $this->validate();
299 299
 
300
-        if( $this->is_valid ) {
300
+        if ( $this->is_valid ) {
301 301
 
302
-            do_action('gravityview_log_debug', __METHOD__ . ': Submission is valid.' );
302
+            do_action( 'gravityview_log_debug', __METHOD__ . ': Submission is valid.' );
303 303
 
304 304
             /**
305 305
              * @hack This step is needed to unset the adminOnly from form fields, to add the calculation fields
@@ -309,22 +309,22 @@  discard block
 block discarded – undo
309 309
             /**
310 310
              * @hack to avoid the capability validation of the method save_lead for GF 1.9+
311 311
              */
312
-            unset( $_GET['page'] );
312
+            unset( $_GET[ 'page' ] );
313 313
 
314
-            $date_created = $this->entry['date_created'];
314
+            $date_created = $this->entry[ 'date_created' ];
315 315
 
316 316
             /**
317 317
              * @hack to force Gravity Forms to use $read_value_from_post in GFFormsModel::save_lead()
318 318
              * @since 1.17.2
319 319
              */
320
-            unset( $this->entry['date_created'] );
320
+            unset( $this->entry[ 'date_created' ] );
321 321
 
322 322
             GFFormsModel::save_lead( $form, $this->entry );
323 323
 
324 324
 	        // Delete the values for hidden inputs
325 325
 	        $this->unset_hidden_field_values();
326 326
             
327
-            $this->entry['date_created'] = $date_created;
327
+            $this->entry[ 'date_created' ] = $date_created;
328 328
 
329 329
             // Process calculation fields
330 330
             $this->update_calculation_fields();
@@ -343,10 +343,10 @@  discard block
 block discarded – undo
343 343
              * @param array $form Gravity Forms form array
344 344
              * @param string $entry_id Numeric ID of the entry that was updated
345 345
              */
346
-            do_action( 'gravityview/edit_entry/after_update', $this->form, $this->entry['id'] );
346
+            do_action( 'gravityview/edit_entry/after_update', $this->form, $this->entry[ 'id' ] );
347 347
 
348 348
         } else {
349
-            do_action('gravityview_log_error', __METHOD__ . ': Submission is NOT valid.', $this->entry );
349
+            do_action( 'gravityview_log_error', __METHOD__ . ': Submission is NOT valid.', $this->entry );
350 350
         }
351 351
 
352 352
     } // process_save
@@ -363,8 +363,8 @@  discard block
 block discarded – undo
363 363
     private function unset_hidden_field_values() {
364 364
 	    global $wpdb;
365 365
 
366
-	    $lead_detail_table      = GFFormsModel::get_lead_details_table_name();
367
-	    $current_fields   = $wpdb->get_results( $wpdb->prepare( "SELECT id, field_number FROM $lead_detail_table WHERE lead_id=%d", $this->entry['id'] ) );
366
+	    $lead_detail_table = GFFormsModel::get_lead_details_table_name();
367
+	    $current_fields = $wpdb->get_results( $wpdb->prepare( "SELECT id, field_number FROM $lead_detail_table WHERE lead_id=%d", $this->entry[ 'id' ] ) );
368 368
 
369 369
 	    foreach ( $this->entry as $input_id => $field_value ) {
370 370
 
@@ -417,11 +417,11 @@  discard block
 block discarded – undo
417 417
      * @return mixed
418 418
      */
419 419
     public function modify_fileupload_settings( $plupload_init, $form_id, $instance ) {
420
-        if( ! $this->is_edit_entry() ) {
420
+        if ( ! $this->is_edit_entry() ) {
421 421
             return $plupload_init;
422 422
         }
423 423
 
424
-        $plupload_init['gf_vars']['max_files'] = 0;
424
+        $plupload_init[ 'gf_vars' ][ 'max_files' ] = 0;
425 425
 
426 426
         return $plupload_init;
427 427
     }
@@ -436,22 +436,22 @@  discard block
 block discarded – undo
436 436
         $form = $this->form;
437 437
 
438 438
 	    /** @var GF_Field $field */
439
-        foreach( $form['fields'] as $k => &$field ) {
439
+        foreach ( $form[ 'fields' ] as $k => &$field ) {
440 440
 
441 441
             /**
442 442
              * Remove the fields with calculation formulas before save to avoid conflicts with GF logic
443 443
              * @since 1.16.3
444 444
              * @var GF_Field $field
445 445
              */
446
-            if( $field->has_calculation() ) {
447
-                unset( $form['fields'][ $k ] );
446
+            if ( $field->has_calculation() ) {
447
+                unset( $form[ 'fields' ][ $k ] );
448 448
             }
449 449
 
450 450
             $field->adminOnly = false;
451 451
 
452
-            if( isset( $field->inputs ) && is_array( $field->inputs ) ) {
453
-                foreach( $field->inputs as $key => $input ) {
454
-                    $field->inputs[ $key ][ 'id' ] = (string)$input['id'];
452
+            if ( isset( $field->inputs ) && is_array( $field->inputs ) ) {
453
+                foreach ( $field->inputs as $key => $input ) {
454
+                    $field->inputs[ $key ][ 'id' ] = (string)$input[ 'id' ];
455 455
                 }
456 456
             }
457 457
         }
@@ -465,20 +465,20 @@  discard block
 block discarded – undo
465 465
         $update = false;
466 466
 
467 467
         // get the most up to date entry values
468
-        $entry = GFAPI::get_entry( $this->entry['id'] );
468
+        $entry = GFAPI::get_entry( $this->entry[ 'id' ] );
469 469
 
470
-        if( !empty( $this->fields_with_calculation ) ) {
470
+        if ( ! empty( $this->fields_with_calculation ) ) {
471 471
             $update = true;
472 472
             foreach ( $this->fields_with_calculation as $calc_field ) {
473 473
                 $inputs = $calc_field->get_entry_inputs();
474 474
                 if ( is_array( $inputs ) ) {
475 475
                     foreach ( $inputs as $input ) {
476
-                        $input_name = 'input_' . str_replace( '.', '_', $input['id'] );
477
-                        $entry[ strval( $input['id'] ) ] = RGFormsModel::prepare_value( $form, $calc_field, '', $input_name, $entry['id'], $entry );
476
+                        $input_name = 'input_' . str_replace( '.', '_', $input[ 'id' ] );
477
+                        $entry[ strval( $input[ 'id' ] ) ] = RGFormsModel::prepare_value( $form, $calc_field, '', $input_name, $entry[ 'id' ], $entry );
478 478
                     }
479 479
                 } else {
480
-                    $input_name = 'input_' . str_replace( '.', '_', $calc_field->id);
481
-                    $entry[ strval( $calc_field->id ) ] = RGFormsModel::prepare_value( $form, $calc_field, '', $input_name, $entry['id'], $entry );
480
+                    $input_name = 'input_' . str_replace( '.', '_', $calc_field->id );
481
+                    $entry[ strval( $calc_field->id ) ] = RGFormsModel::prepare_value( $form, $calc_field, '', $input_name, $entry[ 'id' ], $entry );
482 482
                 }
483 483
             }
484 484
 
@@ -488,16 +488,16 @@  discard block
 block discarded – undo
488 488
         if ( ! empty( $this->total_fields ) ) {
489 489
             $update = true;
490 490
             foreach ( $this->total_fields as $total_field ) {
491
-                $input_name = 'input_' . str_replace( '.', '_', $total_field->id);
492
-                $entry[ strval( $total_field->id ) ] = RGFormsModel::prepare_value( $form, $total_field, '', $input_name, $entry['id'], $entry );
491
+                $input_name = 'input_' . str_replace( '.', '_', $total_field->id );
492
+                $entry[ strval( $total_field->id ) ] = RGFormsModel::prepare_value( $form, $total_field, '', $input_name, $entry[ 'id' ], $entry );
493 493
             }
494 494
         }
495 495
 
496
-        if( $update ) {
496
+        if ( $update ) {
497 497
 
498 498
             $return_entry = GFAPI::update_entry( $entry );
499 499
 
500
-            if( is_wp_error( $return_entry ) ) {
500
+            if ( is_wp_error( $return_entry ) ) {
501 501
                 do_action( 'gravityview_log_error', 'Updating the entry calculation and total fields failed', $return_entry );
502 502
             } else {
503 503
                 do_action( 'gravityview_log_debug', 'Updating the entry calculation and total fields succeeded' );
@@ -528,18 +528,18 @@  discard block
 block discarded – undo
528 528
 
529 529
         $input_name = 'input_' . $field_id;
530 530
 
531
-        if ( !empty( $_FILES[ $input_name ]['name'] ) ) {
531
+        if ( ! empty( $_FILES[ $input_name ][ 'name' ] ) ) {
532 532
 
533 533
             // We have a new image
534 534
 
535
-            $value = RGFormsModel::prepare_value( $form, $field, $value, $input_name, $entry['id'] );
535
+            $value = RGFormsModel::prepare_value( $form, $field, $value, $input_name, $entry[ 'id' ] );
536 536
 
537 537
             $ary = ! empty( $value ) ? explode( '|:|', $value ) : array();
538 538
             $img_url = rgar( $ary, 0 );
539 539
 
540
-            $img_title       = count( $ary ) > 1 ? $ary[1] : '';
541
-            $img_caption     = count( $ary ) > 2 ? $ary[2] : '';
542
-            $img_description = count( $ary ) > 3 ? $ary[3] : '';
540
+            $img_title       = count( $ary ) > 1 ? $ary[ 1 ] : '';
541
+            $img_caption     = count( $ary ) > 2 ? $ary[ 2 ] : '';
542
+            $img_description = count( $ary ) > 3 ? $ary[ 3 ] : '';
543 543
 
544 544
             $image_meta = array(
545 545
                 'post_excerpt' => $img_caption,
@@ -548,7 +548,7 @@  discard block
 block discarded – undo
548 548
 
549 549
             //adding title only if it is not empty. It will default to the file name if it is not in the array
550 550
             if ( ! empty( $img_title ) ) {
551
-                $image_meta['post_title'] = $img_title;
551
+                $image_meta[ 'post_title' ] = $img_title;
552 552
             }
553 553
 
554 554
             /**
@@ -563,22 +563,22 @@  discard block
 block discarded – undo
563 563
                 set_post_thumbnail( $post_id, $media_id );
564 564
             }
565 565
 
566
-        } elseif ( !empty( $_POST[ $input_name ] ) && is_array( $value ) ) {
566
+        } elseif ( ! empty( $_POST[ $input_name ] ) && is_array( $value ) ) {
567 567
 
568 568
             // Same image although the image title, caption or description might have changed
569 569
 
570 570
             $ary = array();
571
-            if( ! empty( $entry[ $field_id ] ) ) {
571
+            if ( ! empty( $entry[ $field_id ] ) ) {
572 572
                 $ary = is_array( $entry[ $field_id ] ) ? $entry[ $field_id ] : explode( '|:|', $entry[ $field_id ] );
573 573
             }
574 574
             $img_url = rgar( $ary, 0 );
575 575
 
576 576
             // is this really the same image or something went wrong ?
577
-            if( $img_url === $_POST[ $input_name ] ) {
577
+            if ( $img_url === $_POST[ $input_name ] ) {
578 578
 
579
-                $img_title       = rgar( $value, $field_id .'.1' );
580
-                $img_caption     = rgar( $value, $field_id .'.4' );
581
-                $img_description = rgar( $value, $field_id .'.7' );
579
+                $img_title       = rgar( $value, $field_id . '.1' );
580
+                $img_caption     = rgar( $value, $field_id . '.4' );
581
+                $img_description = rgar( $value, $field_id . '.7' );
582 582
 
583 583
                 $value = ! empty( $img_url ) ? $img_url . "|:|" . $img_title . "|:|" . $img_caption . "|:|" . $img_description : '';
584 584
 
@@ -618,16 +618,16 @@  discard block
 block discarded – undo
618 618
      */
619 619
     private function maybe_update_post_fields( $form ) {
620 620
 
621
-        if( empty( $this->entry['post_id'] ) ) {
621
+        if ( empty( $this->entry[ 'post_id' ] ) ) {
622 622
 	        do_action( 'gravityview_log_debug', __METHOD__ . ': This entry has no post fields. Continuing...' );
623 623
             return;
624 624
         }
625 625
 
626
-        $post_id = $this->entry['post_id'];
626
+        $post_id = $this->entry[ 'post_id' ];
627 627
 
628 628
         // Security check
629
-        if( false === GVCommon::has_cap( 'edit_post', $post_id ) ) {
630
-            do_action( 'gravityview_log_error', 'The current user does not have the ability to edit Post #'.$post_id );
629
+        if ( false === GVCommon::has_cap( 'edit_post', $post_id ) ) {
630
+            do_action( 'gravityview_log_error', 'The current user does not have the ability to edit Post #' . $post_id );
631 631
             return;
632 632
         }
633 633
 
@@ -639,25 +639,25 @@  discard block
 block discarded – undo
639 639
 
640 640
             $field = RGFormsModel::get_field( $form, $field_id );
641 641
 
642
-            if( ! $field ) {
642
+            if ( ! $field ) {
643 643
                 continue;
644 644
             }
645 645
 
646
-            if( GFCommon::is_post_field( $field ) && 'post_category' !== $field->type ) {
646
+            if ( GFCommon::is_post_field( $field ) && 'post_category' !== $field->type ) {
647 647
 
648 648
                 // Get the value of the field, including $_POSTed value
649 649
                 $value = RGFormsModel::get_field_value( $field );
650 650
 
651 651
                 // Use temporary entry variable, to make values available to fill_post_template() and update_post_image()
652 652
                 $entry_tmp = $this->entry;
653
-                $entry_tmp["{$field_id}"] = $value;
653
+                $entry_tmp[ "{$field_id}" ] = $value;
654 654
 
655
-                switch( $field->type ) {
655
+                switch ( $field->type ) {
656 656
 
657 657
                     case 'post_title':
658 658
                         $post_title = $value;
659
-                        if( rgar( $form, 'postTitleTemplateEnabled' ) ) {
660
-                            $post_title = $this->fill_post_template( $form['postTitleTemplate'], $form, $entry_tmp );
659
+                        if ( rgar( $form, 'postTitleTemplateEnabled' ) ) {
660
+                            $post_title = $this->fill_post_template( $form[ 'postTitleTemplate' ], $form, $entry_tmp );
661 661
                         }
662 662
                         $updated_post->post_title = $post_title;
663 663
                         $updated_post->post_name  = $post_title;
@@ -666,8 +666,8 @@  discard block
 block discarded – undo
666 666
 
667 667
                     case 'post_content':
668 668
                         $post_content = $value;
669
-                        if( rgar( $form, 'postContentTemplateEnabled' ) ) {
670
-                            $post_content = $this->fill_post_template( $form['postContentTemplate'], $form, $entry_tmp, true );
669
+                        if ( rgar( $form, 'postContentTemplateEnabled' ) ) {
670
+                            $post_content = $this->fill_post_template( $form[ 'postContentTemplate' ], $form, $entry_tmp, true );
671 671
                         }
672 672
                         $updated_post->post_content = $post_content;
673 673
                         unset( $post_content );
@@ -681,12 +681,12 @@  discard block
 block discarded – undo
681 681
                     case 'post_category':
682 682
                         break;
683 683
                     case 'post_custom_field':
684
-                        if( ! empty( $field->customFieldTemplateEnabled ) ) {
684
+                        if ( ! empty( $field->customFieldTemplateEnabled ) ) {
685 685
                             $value = $this->fill_post_template( $field->customFieldTemplate, $form, $entry_tmp, true );
686 686
                         }
687 687
 
688 688
 	                    if ( $this->is_field_json_encoded( $field ) && ! is_string( $value ) ) {
689
-		                    $value = function_exists('wp_json_encode') ? wp_json_encode( $value ) : json_encode( $value );
689
+		                    $value = function_exists( 'wp_json_encode' ) ? wp_json_encode( $value ) : json_encode( $value );
690 690
 	                    }
691 691
 
692 692
                         update_post_meta( $post_id, $field->postCustomFieldName, $value );
@@ -700,7 +700,7 @@  discard block
 block discarded – undo
700 700
                 }
701 701
 
702 702
                 // update entry after
703
-                $this->entry["{$field_id}"] = $value;
703
+                $this->entry[ "{$field_id}" ] = $value;
704 704
 
705 705
                 $update_entry = true;
706 706
 
@@ -709,25 +709,25 @@  discard block
 block discarded – undo
709 709
 
710 710
         }
711 711
 
712
-        if( $update_entry ) {
712
+        if ( $update_entry ) {
713 713
 
714 714
             $return_entry = GFAPI::update_entry( $this->entry );
715 715
 
716
-            if( is_wp_error( $return_entry ) ) {
716
+            if ( is_wp_error( $return_entry ) ) {
717 717
                do_action( 'gravityview_log_error', 'Updating the entry post fields failed', array( '$this->entry' => $this->entry, '$return_entry' => $return_entry ) );
718 718
             } else {
719
-                do_action( 'gravityview_log_debug', 'Updating the entry post fields for post #'.$post_id.' succeeded' );
719
+                do_action( 'gravityview_log_debug', 'Updating the entry post fields for post #' . $post_id . ' succeeded' );
720 720
             }
721 721
 
722 722
         }
723 723
 
724 724
         $return_post = wp_update_post( $updated_post, true );
725 725
 
726
-        if( is_wp_error( $return_post ) ) {
726
+        if ( is_wp_error( $return_post ) ) {
727 727
             $return_post->add_data( $updated_post, '$updated_post' );
728 728
             do_action( 'gravityview_log_error', 'Updating the post content failed', compact( 'updated_post', 'return_post' ) );
729 729
         } else {
730
-            do_action( 'gravityview_log_debug', 'Updating the post content for post #'.$post_id.' succeeded', $updated_post );
730
+            do_action( 'gravityview_log_debug', 'Updating the post content for post #' . $post_id . ' succeeded', $updated_post );
731 731
         }
732 732
     }
733 733
 
@@ -745,7 +745,7 @@  discard block
 block discarded – undo
745 745
         $input_type = RGFormsModel::get_input_type( $field );
746 746
 
747 747
 	    // Only certain custom field types are supported
748
-	    switch( $input_type ) {
748
+	    switch ( $input_type ) {
749 749
 		    case 'fileupload':
750 750
 		    case 'list':
751 751
 		    case 'multiselect':
@@ -782,7 +782,7 @@  discard block
 block discarded – undo
782 782
         $output = GFCommon::replace_variables( $output, $form, $entry, false, false, false );
783 783
 
784 784
         // replace conditional shortcodes
785
-        if( $do_shortcode ) {
785
+        if ( $do_shortcode ) {
786 786
             $output = do_shortcode( $output );
787 787
         }
788 788
 
@@ -801,18 +801,18 @@  discard block
 block discarded – undo
801 801
      */
802 802
     private function after_update() {
803 803
 
804
-        do_action( 'gform_after_update_entry', $this->form, $this->entry['id'], self::$original_entry );
805
-        do_action( "gform_after_update_entry_{$this->form['id']}", $this->form, $this->entry['id'] );
804
+        do_action( 'gform_after_update_entry', $this->form, $this->entry[ 'id' ], self::$original_entry );
805
+        do_action( "gform_after_update_entry_{$this->form[ 'id' ]}", $this->form, $this->entry[ 'id' ] );
806 806
 
807 807
         // Re-define the entry now that we've updated it.
808
-        $entry = RGFormsModel::get_lead( $this->entry['id'] );
808
+        $entry = RGFormsModel::get_lead( $this->entry[ 'id' ] );
809 809
 
810 810
         $entry = GFFormsModel::set_entry_meta( $entry, $this->form );
811 811
 
812 812
         // We need to clear the cache because Gravity Forms caches the field values, which
813 813
         // we have just updated.
814
-        foreach ($this->form['fields'] as $key => $field) {
815
-            GFFormsModel::refresh_lead_field_value( $entry['id'], $field->id );
814
+        foreach ( $this->form[ 'fields' ] as $key => $field ) {
815
+            GFFormsModel::refresh_lead_field_value( $entry[ 'id' ], $field->id );
816 816
         }
817 817
 
818 818
         $this->entry = $entry;
@@ -830,7 +830,7 @@  discard block
 block discarded – undo
830 830
 
831 831
         <div class="gv-edit-entry-wrapper"><?php
832 832
 
833
-            $javascript = gravityview_ob_include( GravityView_Edit_Entry::$file .'/partials/inline-javascript.php', $this );
833
+            $javascript = gravityview_ob_include( GravityView_Edit_Entry::$file . '/partials/inline-javascript.php', $this );
834 834
 
835 835
             /**
836 836
              * Fixes weird wpautop() issue
@@ -846,7 +846,7 @@  discard block
 block discarded – undo
846 846
                      * @param string $edit_entry_title Modify the "Edit Entry" title
847 847
                      * @param GravityView_Edit_Entry_Render $this This object
848 848
                      */
849
-                    $edit_entry_title = apply_filters('gravityview_edit_entry_title', __('Edit Entry', 'gravityview'), $this );
849
+                    $edit_entry_title = apply_filters( 'gravityview_edit_entry_title', __( 'Edit Entry', 'gravityview' ), $this );
850 850
 
851 851
                     echo esc_attr( $edit_entry_title );
852 852
             ?></span>
@@ -892,20 +892,20 @@  discard block
 block discarded – undo
892 892
      */
893 893
     private function maybe_print_message() {
894 894
 
895
-        if( rgpost('action') === 'update' ) {
895
+        if ( rgpost( 'action' ) === 'update' ) {
896 896
 
897 897
             $back_link = esc_url( remove_query_arg( array( 'page', 'view', 'edit' ) ) );
898 898
 
899
-            if( ! $this->is_valid ){
899
+            if ( ! $this->is_valid ) {
900 900
 
901 901
                 // Keeping this compatible with Gravity Forms.
902
-                $validation_message = "<div class='validation_error'>" . __('There was a problem with your submission.', 'gravityview') . " " . __('Errors have been highlighted below.', 'gravityview') . "</div>";
903
-                $message = apply_filters("gform_validation_message_{$this->form['id']}", apply_filters("gform_validation_message", $validation_message, $this->form), $this->form);
902
+                $validation_message = "<div class='validation_error'>" . __( 'There was a problem with your submission.', 'gravityview' ) . " " . __( 'Errors have been highlighted below.', 'gravityview' ) . "</div>";
903
+                $message = apply_filters( "gform_validation_message_{$this->form[ 'id' ]}", apply_filters( "gform_validation_message", $validation_message, $this->form ), $this->form );
904 904
 
905
-                echo GVCommon::generate_notice( $message , 'gv-error' );
905
+                echo GVCommon::generate_notice( $message, 'gv-error' );
906 906
 
907 907
             } else {
908
-                $entry_updated_message = sprintf( esc_attr__('Entry Updated. %sReturn to Entry%s', 'gravityview'), '<a href="'. $back_link .'">', '</a>' );
908
+                $entry_updated_message = sprintf( esc_attr__( 'Entry Updated. %sReturn to Entry%s', 'gravityview' ), '<a href="' . $back_link . '">', '</a>' );
909 909
 
910 910
                 /**
911 911
                  * @filter `gravityview/edit_entry/success` Modify the edit entry success message (including the anchor link)
@@ -915,7 +915,7 @@  discard block
 block discarded – undo
915 915
                  * @param array $entry Gravity Forms entry array
916 916
                  * @param string $back_link URL to return to the original entry. @since 1.6
917 917
                  */
918
-                $message = apply_filters( 'gravityview/edit_entry/success', $entry_updated_message , $this->view_id, $this->entry, $back_link );
918
+                $message = apply_filters( 'gravityview/edit_entry/success', $entry_updated_message, $this->view_id, $this->entry, $back_link );
919 919
 
920 920
                 echo GVCommon::generate_notice( $message );
921 921
             }
@@ -939,22 +939,22 @@  discard block
 block discarded – undo
939 939
          */
940 940
         do_action( 'gravityview/edit-entry/render/before', $this );
941 941
 
942
-        add_filter( 'gform_pre_render', array( $this, 'filter_modify_form_fields'), 5000, 3 );
943
-        add_filter( 'gform_submit_button', array( $this, 'render_form_buttons') );
942
+        add_filter( 'gform_pre_render', array( $this, 'filter_modify_form_fields' ), 5000, 3 );
943
+        add_filter( 'gform_submit_button', array( $this, 'render_form_buttons' ) );
944 944
         add_filter( 'gform_disable_view_counter', '__return_true' );
945 945
 
946 946
         add_filter( 'gform_field_input', array( $this, 'verify_user_can_edit_post' ), 5, 5 );
947 947
         add_filter( 'gform_field_input', array( $this, 'modify_edit_field_input' ), 10, 5 );
948 948
 
949 949
         // We need to remove the fake $_GET['page'] arg to avoid rendering form as if in admin.
950
-        unset( $_GET['page'] );
950
+        unset( $_GET[ 'page' ] );
951 951
 
952 952
         // TODO: Verify multiple-page forms
953 953
         // TODO: Product fields are not editable
954 954
 
955 955
         ob_start(); // Prevent PHP warnings possibly caused by prefilling list fields for conditional logic
956 956
 
957
-        $html = GFFormDisplay::get_form( $this->form['id'], false, false, true, $this->entry );
957
+        $html = GFFormDisplay::get_form( $this->form[ 'id' ], false, false, true, $this->entry );
958 958
 
959 959
         ob_get_clean();
960 960
 
@@ -980,7 +980,7 @@  discard block
 block discarded – undo
980 980
      * @return string
981 981
      */
982 982
     public function render_form_buttons() {
983
-        return gravityview_ob_include( GravityView_Edit_Entry::$file .'/partials/form-buttons.php', $this );
983
+        return gravityview_ob_include( GravityView_Edit_Entry::$file . '/partials/form-buttons.php', $this );
984 984
     }
985 985
 
986 986
 
@@ -1000,10 +1000,10 @@  discard block
 block discarded – undo
1000 1000
     public function filter_modify_form_fields( $form, $ajax = false, $field_values = '' ) {
1001 1001
 
1002 1002
         // In case we have validated the form, use it to inject the validation results into the form render
1003
-        if( isset( $this->form_after_validation ) ) {
1003
+        if ( isset( $this->form_after_validation ) ) {
1004 1004
             $form = $this->form_after_validation;
1005 1005
         } else {
1006
-            $form['fields'] = $this->get_configured_edit_fields( $form, $this->view_id );
1006
+            $form[ 'fields' ] = $this->get_configured_edit_fields( $form, $this->view_id );
1007 1007
         }
1008 1008
 
1009 1009
         $form = $this->filter_conditional_logic( $form );
@@ -1011,8 +1011,8 @@  discard block
 block discarded – undo
1011 1011
         $form = $this->prefill_conditional_logic( $form );
1012 1012
 
1013 1013
         // for now we don't support Save and Continue feature.
1014
-        if( ! self::$supports_save_and_continue ) {
1015
-	        unset( $form['save'] );
1014
+        if ( ! self::$supports_save_and_continue ) {
1015
+	        unset( $form[ 'save' ] );
1016 1016
         }
1017 1017
 
1018 1018
         return $form;
@@ -1033,29 +1033,29 @@  discard block
 block discarded – undo
1033 1033
      */
1034 1034
     public function verify_user_can_edit_post( $field_content = '', $field, $value, $lead_id = 0, $form_id ) {
1035 1035
 
1036
-        if( GFCommon::is_post_field( $field ) ) {
1036
+        if ( GFCommon::is_post_field( $field ) ) {
1037 1037
 
1038 1038
             $message = null;
1039 1039
 
1040 1040
             // First, make sure they have the capability to edit the post.
1041
-            if( false === current_user_can( 'edit_post', $this->entry['post_id'] ) ) {
1041
+            if ( false === current_user_can( 'edit_post', $this->entry[ 'post_id' ] ) ) {
1042 1042
 
1043 1043
                 /**
1044 1044
                  * @filter `gravityview/edit_entry/unsupported_post_field_text` Modify the message when someone isn't able to edit a post
1045 1045
                  * @param string $message The existing "You don't have permission..." text
1046 1046
                  */
1047
-                $message = apply_filters('gravityview/edit_entry/unsupported_post_field_text', __('You don&rsquo;t have permission to edit this post.', 'gravityview') );
1047
+                $message = apply_filters( 'gravityview/edit_entry/unsupported_post_field_text', __( 'You don&rsquo;t have permission to edit this post.', 'gravityview' ) );
1048 1048
 
1049
-            } elseif( null === get_post( $this->entry['post_id'] ) ) {
1049
+            } elseif ( null === get_post( $this->entry[ 'post_id' ] ) ) {
1050 1050
                 /**
1051 1051
                  * @filter `gravityview/edit_entry/no_post_text` Modify the message when someone is editing an entry attached to a post that no longer exists
1052 1052
                  * @param string $message The existing "This field is not editable; the post no longer exists." text
1053 1053
                  */
1054
-                $message = apply_filters('gravityview/edit_entry/no_post_text', __('This field is not editable; the post no longer exists.', 'gravityview' ) );
1054
+                $message = apply_filters( 'gravityview/edit_entry/no_post_text', __( 'This field is not editable; the post no longer exists.', 'gravityview' ) );
1055 1055
             }
1056 1056
 
1057
-            if( $message ) {
1058
-                $field_content = sprintf('<div class="ginput_container ginput_container_' . $field->type . '">%s</div>', wpautop( $message ) );
1057
+            if ( $message ) {
1058
+                $field_content = sprintf( '<div class="ginput_container ginput_container_' . $field->type . '">%s</div>', wpautop( $message ) );
1059 1059
             }
1060 1060
         }
1061 1061
 
@@ -1080,8 +1080,8 @@  discard block
 block discarded – undo
1080 1080
 
1081 1081
         // If the form has been submitted, then we don't need to pre-fill the values,
1082 1082
         // Except for fileupload type and when a field input is overridden- run always!!
1083
-        if(
1084
-            ( $this->is_edit_entry_submission() && !in_array( $field->type, array( 'fileupload', 'post_image' ) ) )
1083
+        if (
1084
+            ( $this->is_edit_entry_submission() && ! in_array( $field->type, array( 'fileupload', 'post_image' ) ) )
1085 1085
             && false === ( $gv_field && is_callable( array( $gv_field, 'get_field_input' ) ) )
1086 1086
             || ! empty( $field_content )
1087 1087
             || in_array( $field->type, array( 'honeypot' ) )
@@ -1091,8 +1091,8 @@  discard block
 block discarded – undo
1091 1091
         }
1092 1092
 
1093 1093
         // Turn on Admin-style display for file upload fields only
1094
-        if( 'fileupload' === $field->type ) {
1095
-            $_GET['page'] = 'gf_entries';
1094
+        if ( 'fileupload' === $field->type ) {
1095
+            $_GET[ 'page' ] = 'gf_entries';
1096 1096
         }
1097 1097
 
1098 1098
         // SET SOME FIELD DEFAULTS TO PREVENT ISSUES
@@ -1119,13 +1119,13 @@  discard block
 block discarded – undo
1119 1119
          * @param mixed $field_value field value used to populate the input
1120 1120
          * @param GF_Field $field Gravity Forms field object
1121 1121
          */
1122
-        $field_value = apply_filters( 'gravityview/edit_entry/field_value_' . $field->type , $field_value, $field );
1122
+        $field_value = apply_filters( 'gravityview/edit_entry/field_value_' . $field->type, $field_value, $field );
1123 1123
 
1124 1124
 	    // Prevent any PHP warnings, like undefined index
1125 1125
 	    ob_start();
1126 1126
 
1127 1127
         /** @var GravityView_Field $gv_field */
1128
-        if( $gv_field && is_callable( array( $gv_field, 'get_field_input' ) ) ) {
1128
+        if ( $gv_field && is_callable( array( $gv_field, 'get_field_input' ) ) ) {
1129 1129
             $return = $gv_field->get_field_input( $this->form, $field_value, $this->entry, $field );
1130 1130
         } else {
1131 1131
 	        $return = $field->get_field_input( $this->form, $field_value, $this->entry );
@@ -1135,7 +1135,7 @@  discard block
 block discarded – undo
1135 1135
 	    // If there was output, it's an error
1136 1136
 	    $warnings = ob_get_clean();
1137 1137
 
1138
-	    if( !empty( $warnings ) ) {
1138
+	    if ( ! empty( $warnings ) ) {
1139 1139
 		    do_action( 'gravityview_log_error', __METHOD__ . $warnings, $field_value );
1140 1140
 	    }
1141 1141
 
@@ -1144,7 +1144,7 @@  discard block
 block discarded – undo
1144 1144
          * We need the fileupload html field to render with the proper id
1145 1145
          *  ( <li id="field_80_16" ... > )
1146 1146
          */
1147
-        unset( $_GET['page'] );
1147
+        unset( $_GET[ 'page' ] );
1148 1148
 
1149 1149
         return $return;
1150 1150
     }
@@ -1167,7 +1167,7 @@  discard block
 block discarded – undo
1167 1167
         $override_saved_value = apply_filters( 'gravityview/edit_entry/pre_populate/override', false, $field );
1168 1168
 
1169 1169
         // We're dealing with multiple inputs (e.g. checkbox) but not time or date (as it doesn't store data in input IDs)
1170
-        if( isset( $field->inputs ) && is_array( $field->inputs ) && !in_array( $field->type, array( 'time', 'date' ) ) ) {
1170
+        if ( isset( $field->inputs ) && is_array( $field->inputs ) && ! in_array( $field->type, array( 'time', 'date' ) ) ) {
1171 1171
 
1172 1172
             $field_value = array();
1173 1173
 
@@ -1176,10 +1176,10 @@  discard block
 block discarded – undo
1176 1176
 
1177 1177
             foreach ( (array)$field->inputs as $input ) {
1178 1178
 
1179
-                $input_id = strval( $input['id'] );
1179
+                $input_id = strval( $input[ 'id' ] );
1180 1180
                 
1181 1181
                 if ( isset( $this->entry[ $input_id ] ) && ! gv_empty( $this->entry[ $input_id ], false, false ) ) {
1182
-                    $field_value[ $input_id ] =  'post_category' === $field->type ? GFCommon::format_post_category( $this->entry[ $input_id ], true ) : $this->entry[ $input_id ];
1182
+                    $field_value[ $input_id ] = 'post_category' === $field->type ? GFCommon::format_post_category( $this->entry[ $input_id ], true ) : $this->entry[ $input_id ];
1183 1183
                     $allow_pre_populated = false;
1184 1184
                 }
1185 1185
 
@@ -1187,7 +1187,7 @@  discard block
 block discarded – undo
1187 1187
 
1188 1188
             $pre_value = $field->get_value_submission( array(), false );
1189 1189
 
1190
-            $field_value = ! $allow_pre_populated && ! ( $override_saved_value && !gv_empty( $pre_value, false, false ) ) ? $field_value : $pre_value;
1190
+            $field_value = ! $allow_pre_populated && ! ( $override_saved_value && ! gv_empty( $pre_value, false, false ) ) ? $field_value : $pre_value;
1191 1191
 
1192 1192
         } else {
1193 1193
 
@@ -1198,13 +1198,13 @@  discard block
 block discarded – undo
1198 1198
 
1199 1199
             // saved field entry value (if empty, fallback to the pre-populated value, if exists)
1200 1200
             // or pre-populated value if not empty and set to override saved value
1201
-            $field_value = !gv_empty( $this->entry[ $id ], false, false ) && ! ( $override_saved_value && !gv_empty( $pre_value, false, false ) ) ? $this->entry[ $id ] : $pre_value;
1201
+            $field_value = ! gv_empty( $this->entry[ $id ], false, false ) && ! ( $override_saved_value && ! gv_empty( $pre_value, false, false ) ) ? $this->entry[ $id ] : $pre_value;
1202 1202
 
1203 1203
             // in case field is post_category but inputType is select, multi-select or radio, convert value into array of category IDs.
1204
-            if ( 'post_category' === $field->type && !gv_empty( $field_value, false, false ) ) {
1204
+            if ( 'post_category' === $field->type && ! gv_empty( $field_value, false, false ) ) {
1205 1205
                 $categories = array();
1206 1206
                 foreach ( explode( ',', $field_value ) as $cat_string ) {
1207
-                    $categories[] = GFCommon::format_post_category( $cat_string, true );
1207
+                    $categories[ ] = GFCommon::format_post_category( $cat_string, true );
1208 1208
                 }
1209 1209
                 $field_value = 'multiselect' === $field->get_input_type() ? $categories : implode( '', $categories );
1210 1210
             }
@@ -1229,12 +1229,12 @@  discard block
 block discarded – undo
1229 1229
      */
1230 1230
     public function gform_pre_validation( $form ) {
1231 1231
 
1232
-        if( ! $this->verify_nonce() ) {
1232
+        if ( ! $this->verify_nonce() ) {
1233 1233
             return $form;
1234 1234
         }
1235 1235
 
1236 1236
         // Fix PHP warning regarding undefined index.
1237
-        foreach ( $form['fields'] as &$field) {
1237
+        foreach ( $form[ 'fields' ] as &$field ) {
1238 1238
 
1239 1239
             // This is because we're doing admin form pretending to be front-end, so Gravity Forms
1240 1240
             // expects certain field array items to be set.
@@ -1247,7 +1247,7 @@  discard block
 block discarded – undo
1247 1247
                 $field['emailConfirmEnabled'] = '';
1248 1248
             }*/
1249 1249
 
1250
-            switch( RGFormsModel::get_input_type( $field ) ) {
1250
+            switch ( RGFormsModel::get_input_type( $field ) ) {
1251 1251
 
1252 1252
                 /**
1253 1253
                  * this whole fileupload hack is because in the admin, Gravity Forms simply doesn't update any fileupload field if it's empty, but it DOES in the frontend.
@@ -1261,37 +1261,37 @@  discard block
 block discarded – undo
1261 1261
                     // Set the previous value
1262 1262
                     $entry = $this->get_entry();
1263 1263
 
1264
-                    $input_name = 'input_'.$field->id;
1265
-                    $form_id = $form['id'];
1264
+                    $input_name = 'input_' . $field->id;
1265
+                    $form_id = $form[ 'id' ];
1266 1266
 
1267 1267
                     $value = NULL;
1268 1268
 
1269 1269
                     // Use the previous entry value as the default.
1270
-                    if( isset( $entry[ $field->id ] ) ) {
1270
+                    if ( isset( $entry[ $field->id ] ) ) {
1271 1271
                         $value = $entry[ $field->id ];
1272 1272
                     }
1273 1273
 
1274 1274
                     // If this is a single upload file
1275
-                    if( !empty( $_FILES[ $input_name ] ) && !empty( $_FILES[ $input_name ]['name'] ) ) {
1276
-                        $file_path = GFFormsModel::get_file_upload_path( $form['id'], $_FILES[ $input_name ]['name'] );
1277
-                        $value = $file_path['url'];
1275
+                    if ( ! empty( $_FILES[ $input_name ] ) && ! empty( $_FILES[ $input_name ][ 'name' ] ) ) {
1276
+                        $file_path = GFFormsModel::get_file_upload_path( $form[ 'id' ], $_FILES[ $input_name ][ 'name' ] );
1277
+                        $value = $file_path[ 'url' ];
1278 1278
 
1279 1279
                     } else {
1280 1280
 
1281 1281
                         // Fix PHP warning on line 1498 of form_display.php for post_image fields
1282 1282
                         // Fix PHP Notice:  Undefined index:  size in form_display.php on line 1511
1283
-                        $_FILES[ $input_name ] = array('name' => '', 'size' => '' );
1283
+                        $_FILES[ $input_name ] = array( 'name' => '', 'size' => '' );
1284 1284
 
1285 1285
                     }
1286 1286
 
1287
-                    if( rgar($field, "multipleFiles") ) {
1287
+                    if ( rgar( $field, "multipleFiles" ) ) {
1288 1288
 
1289 1289
                         // If there are fresh uploads, process and merge them.
1290 1290
                         // Otherwise, use the passed values, which should be json-encoded array of URLs
1291
-                        if( isset( GFFormsModel::$uploaded_files[$form_id][$input_name] ) ) {
1291
+                        if ( isset( GFFormsModel::$uploaded_files[ $form_id ][ $input_name ] ) ) {
1292 1292
                             $value = empty( $value ) ? '[]' : $value;
1293 1293
                             $value = stripslashes_deep( $value );
1294
-                            $value = GFFormsModel::prepare_value( $form, $field, $value, $input_name, $entry['id'], array());
1294
+                            $value = GFFormsModel::prepare_value( $form, $field, $value, $input_name, $entry[ 'id' ], array() );
1295 1295
                         }
1296 1296
 
1297 1297
                     } else {
@@ -1309,14 +1309,14 @@  discard block
 block discarded – undo
1309 1309
 
1310 1310
                 case 'number':
1311 1311
                     // Fix "undefined index" issue at line 1286 in form_display.php
1312
-                    if( !isset( $_POST['input_'.$field->id ] ) ) {
1313
-                        $_POST['input_'.$field->id ] = NULL;
1312
+                    if ( ! isset( $_POST[ 'input_' . $field->id ] ) ) {
1313
+                        $_POST[ 'input_' . $field->id ] = NULL;
1314 1314
                     }
1315 1315
                     break;
1316 1316
                 case 'captcha':
1317 1317
                     // Fix issue with recaptcha_check_answer() on line 1458 in form_display.php
1318
-                    $_POST['recaptcha_challenge_field'] = NULL;
1319
-                    $_POST['recaptcha_response_field'] = NULL;
1318
+                    $_POST[ 'recaptcha_challenge_field' ] = NULL;
1319
+                    $_POST[ 'recaptcha_response_field' ] = NULL;
1320 1320
                     break;
1321 1321
             }
1322 1322
 
@@ -1352,7 +1352,7 @@  discard block
 block discarded – undo
1352 1352
          * You can enter whatever you want!
1353 1353
          * We try validating, and customize the results using `self::custom_validation()`
1354 1354
          */
1355
-        add_filter( 'gform_validation_'. $this->form_id, array( $this, 'custom_validation' ), 10, 4);
1355
+        add_filter( 'gform_validation_' . $this->form_id, array( $this, 'custom_validation' ), 10, 4 );
1356 1356
 
1357 1357
         // Needed by the validate funtion
1358 1358
         $failed_validation_page = NULL;
@@ -1360,14 +1360,14 @@  discard block
 block discarded – undo
1360 1360
 
1361 1361
         // Prevent entry limit from running when editing an entry, also
1362 1362
         // prevent form scheduling from preventing editing
1363
-        unset( $this->form['limitEntries'], $this->form['scheduleForm'] );
1363
+        unset( $this->form[ 'limitEntries' ], $this->form[ 'scheduleForm' ] );
1364 1364
 
1365 1365
         // Hide fields depending on Edit Entry settings
1366
-        $this->form['fields'] = $this->get_configured_edit_fields( $this->form, $this->view_id );
1366
+        $this->form[ 'fields' ] = $this->get_configured_edit_fields( $this->form, $this->view_id );
1367 1367
 
1368 1368
         $this->is_valid = GFFormDisplay::validate( $this->form, $field_values, 1, $failed_validation_page );
1369 1369
 
1370
-        remove_filter( 'gform_validation_'. $this->form_id, array( $this, 'custom_validation' ), 10 );
1370
+        remove_filter( 'gform_validation_' . $this->form_id, array( $this, 'custom_validation' ), 10 );
1371 1371
     }
1372 1372
 
1373 1373
 
@@ -1384,13 +1384,13 @@  discard block
 block discarded – undo
1384 1384
      */
1385 1385
     public function custom_validation( $validation_results ) {
1386 1386
 
1387
-        do_action('gravityview_log_debug', 'GravityView_Edit_Entry[custom_validation] Validation results: ', $validation_results );
1387
+        do_action( 'gravityview_log_debug', 'GravityView_Edit_Entry[custom_validation] Validation results: ', $validation_results );
1388 1388
 
1389
-        do_action('gravityview_log_debug', 'GravityView_Edit_Entry[custom_validation] $_POSTed data (sanitized): ', esc_html( print_r( $_POST, true ) ) );
1389
+        do_action( 'gravityview_log_debug', 'GravityView_Edit_Entry[custom_validation] $_POSTed data (sanitized): ', esc_html( print_r( $_POST, true ) ) );
1390 1390
 
1391 1391
         $gv_valid = true;
1392 1392
 
1393
-        foreach ( $validation_results['form']['fields'] as $key => &$field ) {
1393
+        foreach ( $validation_results[ 'form' ][ 'fields' ] as $key => &$field ) {
1394 1394
 
1395 1395
             $value = RGFormsModel::get_field_value( $field );
1396 1396
             $field_type = RGFormsModel::get_input_type( $field );
@@ -1403,35 +1403,35 @@  discard block
 block discarded – undo
1403 1403
                 case 'post_image':
1404 1404
 
1405 1405
                     // in case nothing is uploaded but there are already files saved
1406
-                    if( !empty( $field->failed_validation ) && !empty( $field->isRequired ) && !empty( $value ) ) {
1406
+                    if ( ! empty( $field->failed_validation ) && ! empty( $field->isRequired ) && ! empty( $value ) ) {
1407 1407
                         $field->failed_validation = false;
1408 1408
                         unset( $field->validation_message );
1409 1409
                     }
1410 1410
 
1411 1411
                     // validate if multi file upload reached max number of files [maxFiles] => 2
1412
-                    if( rgobj( $field, 'maxFiles') && rgobj( $field, 'multipleFiles') ) {
1412
+                    if ( rgobj( $field, 'maxFiles' ) && rgobj( $field, 'multipleFiles' ) ) {
1413 1413
 
1414 1414
                         $input_name = 'input_' . $field->id;
1415 1415
                         //uploaded
1416
-                        $file_names = isset( GFFormsModel::$uploaded_files[ $validation_results['form']['id'] ][ $input_name ] ) ? GFFormsModel::$uploaded_files[ $validation_results['form']['id'] ][ $input_name ] : array();
1416
+                        $file_names = isset( GFFormsModel::$uploaded_files[ $validation_results[ 'form' ][ 'id' ] ][ $input_name ] ) ? GFFormsModel::$uploaded_files[ $validation_results[ 'form' ][ 'id' ] ][ $input_name ] : array();
1417 1417
 
1418 1418
                         //existent
1419 1419
                         $entry = $this->get_entry();
1420 1420
                         $value = NULL;
1421
-                        if( isset( $entry[ $field->id ] ) ) {
1421
+                        if ( isset( $entry[ $field->id ] ) ) {
1422 1422
                             $value = json_decode( $entry[ $field->id ], true );
1423 1423
                         }
1424 1424
 
1425 1425
                         // count uploaded files and existent entry files
1426 1426
                         $count_files = count( $file_names ) + count( $value );
1427 1427
 
1428
-                        if( $count_files > $field->maxFiles ) {
1428
+                        if ( $count_files > $field->maxFiles ) {
1429 1429
                             $field->validation_message = __( 'Maximum number of files reached', 'gravityview' );
1430 1430
                             $field->failed_validation = 1;
1431 1431
                             $gv_valid = false;
1432 1432
 
1433 1433
                             // in case of error make sure the newest upload files are removed from the upload input
1434
-                            GFFormsModel::$uploaded_files[ $validation_results['form']['id'] ] = null;
1434
+                            GFFormsModel::$uploaded_files[ $validation_results[ 'form' ][ 'id' ] ] = null;
1435 1435
                         }
1436 1436
 
1437 1437
                     }
@@ -1442,7 +1442,7 @@  discard block
 block discarded – undo
1442 1442
             }
1443 1443
 
1444 1444
             // This field has failed validation.
1445
-            if( !empty( $field->failed_validation ) ) {
1445
+            if ( ! empty( $field->failed_validation ) ) {
1446 1446
 
1447 1447
                 do_action( 'gravityview_log_debug', 'GravityView_Edit_Entry[custom_validation] Field is invalid.', array( 'field' => $field, 'value' => $value ) );
1448 1448
 
@@ -1460,32 +1460,32 @@  discard block
 block discarded – undo
1460 1460
                 }
1461 1461
 
1462 1462
                 // You can't continue inside a switch, so we do it after.
1463
-                if( empty( $field->failed_validation ) ) {
1463
+                if ( empty( $field->failed_validation ) ) {
1464 1464
                     continue;
1465 1465
                 }
1466 1466
 
1467 1467
                 // checks if the No Duplicates option is not validating entry against itself, since
1468 1468
                 // we're editing a stored entry, it would also assume it's a duplicate.
1469
-                if( !empty( $field->noDuplicates ) ) {
1469
+                if ( ! empty( $field->noDuplicates ) ) {
1470 1470
 
1471 1471
                     $entry = $this->get_entry();
1472 1472
 
1473 1473
                     // If the value of the entry is the same as the stored value
1474 1474
                     // Then we can assume it's not a duplicate, it's the same.
1475
-                    if( !empty( $entry ) && $value == $entry[ $field->id ] ) {
1475
+                    if ( ! empty( $entry ) && $value == $entry[ $field->id ] ) {
1476 1476
                         //if value submitted was not changed, then don't validate
1477 1477
                         $field->failed_validation = false;
1478 1478
 
1479 1479
                         unset( $field->validation_message );
1480 1480
 
1481
-                        do_action('gravityview_log_debug', 'GravityView_Edit_Entry[custom_validation] Field not a duplicate; it is the same entry.', $entry );
1481
+                        do_action( 'gravityview_log_debug', 'GravityView_Edit_Entry[custom_validation] Field not a duplicate; it is the same entry.', $entry );
1482 1482
 
1483 1483
                         continue;
1484 1484
                     }
1485 1485
                 }
1486 1486
 
1487 1487
                 // if here then probably we are facing the validation 'At least one field must be filled out'
1488
-                if( GFFormDisplay::is_empty( $field, $this->form_id  ) && empty( $field->isRequired ) ) {
1488
+                if ( GFFormDisplay::is_empty( $field, $this->form_id ) && empty( $field->isRequired ) ) {
1489 1489
                     unset( $field->validation_message );
1490 1490
 	                $field->validation_message = false;
1491 1491
                     continue;
@@ -1497,12 +1497,12 @@  discard block
 block discarded – undo
1497 1497
 
1498 1498
         }
1499 1499
 
1500
-        $validation_results['is_valid'] = $gv_valid;
1500
+        $validation_results[ 'is_valid' ] = $gv_valid;
1501 1501
 
1502
-        do_action('gravityview_log_debug', 'GravityView_Edit_Entry[custom_validation] Validation results.', $validation_results );
1502
+        do_action( 'gravityview_log_debug', 'GravityView_Edit_Entry[custom_validation] Validation results.', $validation_results );
1503 1503
 
1504 1504
         // We'll need this result when rendering the form ( on GFFormDisplay::get_form )
1505
-        $this->form_after_validation = $validation_results['form'];
1505
+        $this->form_after_validation = $validation_results[ 'form' ];
1506 1506
 
1507 1507
         return $validation_results;
1508 1508
     }
@@ -1515,7 +1515,7 @@  discard block
 block discarded – undo
1515 1515
      */
1516 1516
     public function get_entry() {
1517 1517
 
1518
-        if( empty( $this->entry ) ) {
1518
+        if ( empty( $this->entry ) ) {
1519 1519
             // Get the database value of the entry that's being edited
1520 1520
             $this->entry = gravityview_get_entry( GravityView_frontend::is_single_entry() );
1521 1521
         }
@@ -1542,13 +1542,13 @@  discard block
 block discarded – undo
1542 1542
         $properties = GravityView_View_Data::getInstance()->get_fields( $view_id );
1543 1543
 
1544 1544
         // If edit tab not yet configured, show all fields
1545
-        $edit_fields = !empty( $properties['edit_edit-fields'] ) ? $properties['edit_edit-fields'] : NULL;
1545
+        $edit_fields = ! empty( $properties[ 'edit_edit-fields' ] ) ? $properties[ 'edit_edit-fields' ] : NULL;
1546 1546
 
1547 1547
         // Show hidden fields as text fields
1548 1548
         $form = $this->fix_survey_fields( $form );
1549 1549
 
1550 1550
         // Hide fields depending on admin settings
1551
-        $fields = $this->filter_fields( $form['fields'], $edit_fields );
1551
+        $fields = $this->filter_fields( $form[ 'fields' ], $edit_fields );
1552 1552
 
1553 1553
 	    // If Edit Entry fields are configured, remove adminOnly field settings. Otherwise, don't.
1554 1554
 	    $fields = $this->filter_admin_only_fields( $fields, $edit_fields, $form, $view_id );
@@ -1578,7 +1578,7 @@  discard block
 block discarded – undo
1578 1578
     private function fix_survey_fields( $form ) {
1579 1579
 
1580 1580
         /** @var GF_Field $field */
1581
-        foreach( $form['fields'] as &$field ) {
1581
+        foreach ( $form[ 'fields' ] as &$field ) {
1582 1582
             $field->allowsPrepopulate = true;
1583 1583
         }
1584 1584
 
@@ -1599,7 +1599,7 @@  discard block
 block discarded – undo
1599 1599
      */
1600 1600
     private function filter_fields( $fields, $configured_fields ) {
1601 1601
 
1602
-        if( empty( $fields ) || !is_array( $fields ) ) {
1602
+        if ( empty( $fields ) || ! is_array( $fields ) ) {
1603 1603
             return $fields;
1604 1604
         }
1605 1605
 
@@ -1616,13 +1616,13 @@  discard block
 block discarded – undo
1616 1616
 	     */
1617 1617
 	    $hide_product_fields = apply_filters( 'gravityview/edit_entry/hide-product-fields', empty( self::$supports_product_fields ) );
1618 1618
 
1619
-	    if( $hide_product_fields ) {
1620
-		    $field_type_blacklist[] = 'option';
1621
-		    $field_type_blacklist[] = 'quantity';
1622
-            $field_type_blacklist[] = 'product';
1623
-            $field_type_blacklist[] = 'total';
1624
-            $field_type_blacklist[] = 'shipping';
1625
-            $field_type_blacklist[] = 'calculation';
1619
+	    if ( $hide_product_fields ) {
1620
+		    $field_type_blacklist[ ] = 'option';
1621
+		    $field_type_blacklist[ ] = 'quantity';
1622
+            $field_type_blacklist[ ] = 'product';
1623
+            $field_type_blacklist[ ] = 'total';
1624
+            $field_type_blacklist[ ] = 'shipping';
1625
+            $field_type_blacklist[ ] = 'calculation';
1626 1626
 	    }
1627 1627
 
1628 1628
         // First, remove blacklist or calculation fields
@@ -1630,24 +1630,24 @@  discard block
 block discarded – undo
1630 1630
 
1631 1631
             // Remove the fields that have calculation properties and keep them to be used later
1632 1632
             // @since 1.16.2
1633
-            if( $field->has_calculation() ) {
1634
-                $this->fields_with_calculation[] = $field;
1633
+            if ( $field->has_calculation() ) {
1634
+                $this->fields_with_calculation[ ] = $field;
1635 1635
                 // don't remove the calculation fields on form render.
1636 1636
             }
1637 1637
 
1638 1638
             // process total field after all fields have been saved
1639 1639
             if ( $field->type == 'total' ) {
1640
-                $this->total_fields[] = $field;
1640
+                $this->total_fields[ ] = $field;
1641 1641
                 unset( $fields[ $key ] );
1642 1642
             }
1643 1643
 
1644
-            if( in_array( $field->type, $field_type_blacklist ) ) {
1644
+            if ( in_array( $field->type, $field_type_blacklist ) ) {
1645 1645
                 unset( $fields[ $key ] );
1646 1646
             }
1647 1647
         }
1648 1648
 
1649 1649
         // The Edit tab has not been configured, so we return all fields by default.
1650
-        if( empty( $configured_fields ) ) {
1650
+        if ( empty( $configured_fields ) ) {
1651 1651
             return $fields;
1652 1652
         }
1653 1653
 
@@ -1657,8 +1657,8 @@  discard block
 block discarded – undo
1657 1657
 	        /** @var GF_Field $field */
1658 1658
 	        foreach ( $fields as $field ) {
1659 1659
 
1660
-                if( intval( $configured_field['id'] ) === intval( $field->id ) && $this->user_can_edit_field( $configured_field, false ) ) {
1661
-                    $edit_fields[] = $this->merge_field_properties( $field, $configured_field );
1660
+                if ( intval( $configured_field[ 'id' ] ) === intval( $field->id ) && $this->user_can_edit_field( $configured_field, false ) ) {
1661
+                    $edit_fields[ ] = $this->merge_field_properties( $field, $configured_field );
1662 1662
                     break;
1663 1663
                 }
1664 1664
 
@@ -1681,14 +1681,14 @@  discard block
 block discarded – undo
1681 1681
 
1682 1682
         $return_field = $field;
1683 1683
 
1684
-        if( empty( $field_setting['show_label'] ) ) {
1684
+        if ( empty( $field_setting[ 'show_label' ] ) ) {
1685 1685
             $return_field->label = '';
1686
-        } elseif ( !empty( $field_setting['custom_label'] ) ) {
1687
-            $return_field->label = $field_setting['custom_label'];
1686
+        } elseif ( ! empty( $field_setting[ 'custom_label' ] ) ) {
1687
+            $return_field->label = $field_setting[ 'custom_label' ];
1688 1688
         }
1689 1689
 
1690
-        if( !empty( $field_setting['custom_class'] ) ) {
1691
-            $return_field->cssClass .= ' '. gravityview_sanitize_html_class( $field_setting['custom_class'] );
1690
+        if ( ! empty( $field_setting[ 'custom_class' ] ) ) {
1691
+            $return_field->cssClass .= ' ' . gravityview_sanitize_html_class( $field_setting[ 'custom_class' ] );
1692 1692
         }
1693 1693
 
1694 1694
         /**
@@ -1726,16 +1726,16 @@  discard block
 block discarded – undo
1726 1726
 	     */
1727 1727
 	    $use_gf_adminonly_setting = apply_filters( 'gravityview/edit_entry/use_gf_admin_only_setting', empty( $edit_fields ), $form, $view_id );
1728 1728
 
1729
-	    if( $use_gf_adminonly_setting && false === GVCommon::has_cap( 'gravityforms_edit_entries', $this->entry['id'] ) ) {
1730
-            foreach( $fields as $k => $field ) {
1731
-                if( $field->adminOnly ) {
1729
+	    if ( $use_gf_adminonly_setting && false === GVCommon::has_cap( 'gravityforms_edit_entries', $this->entry[ 'id' ] ) ) {
1730
+            foreach ( $fields as $k => $field ) {
1731
+                if ( $field->adminOnly ) {
1732 1732
                     unset( $fields[ $k ] );
1733 1733
                 }
1734 1734
             }
1735 1735
             return $fields;
1736 1736
         }
1737 1737
 
1738
-	    foreach( $fields as &$field ) {
1738
+	    foreach ( $fields as &$field ) {
1739 1739
 		    $field->adminOnly = false;
1740 1740
         }
1741 1741
 
@@ -1759,22 +1759,22 @@  discard block
 block discarded – undo
1759 1759
      */
1760 1760
     function prefill_conditional_logic( $form ) {
1761 1761
 
1762
-        if( ! GFFormDisplay::has_conditional_logic( $form ) ) {
1762
+        if ( ! GFFormDisplay::has_conditional_logic( $form ) ) {
1763 1763
             return $form;
1764 1764
         }
1765 1765
 
1766 1766
         // Have Conditional Logic pre-fill fields as if the data were default values
1767 1767
         /** @var GF_Field $field */
1768
-        foreach ( $form['fields'] as &$field ) {
1768
+        foreach ( $form[ 'fields' ] as &$field ) {
1769 1769
 
1770
-            if( 'checkbox' === $field->type ) {
1770
+            if ( 'checkbox' === $field->type ) {
1771 1771
                 foreach ( $field->get_entry_inputs() as $key => $input ) {
1772
-                    $input_id = $input['id'];
1772
+                    $input_id = $input[ 'id' ];
1773 1773
                     $choice = $field->choices[ $key ];
1774 1774
                     $value = rgar( $this->entry, $input_id );
1775 1775
                     $match = RGFormsModel::choice_value_match( $field, $choice, $value );
1776
-                    if( $match ) {
1777
-                        $field->choices[ $key ]['isSelected'] = true;
1776
+                    if ( $match ) {
1777
+                        $field->choices[ $key ][ 'isSelected' ] = true;
1778 1778
                     }
1779 1779
                 }
1780 1780
             } else {
@@ -1782,15 +1782,15 @@  discard block
 block discarded – undo
1782 1782
                 // We need to run through each field to set the default values
1783 1783
                 foreach ( $this->entry as $field_id => $field_value ) {
1784 1784
 
1785
-                    if( floatval( $field_id ) === floatval( $field->id ) ) {
1785
+                    if ( floatval( $field_id ) === floatval( $field->id ) ) {
1786 1786
 
1787
-                        if( 'list' === $field->type ) {
1787
+                        if ( 'list' === $field->type ) {
1788 1788
                             $list_rows = maybe_unserialize( $field_value );
1789 1789
 
1790 1790
                             $list_field_value = array();
1791 1791
                             foreach ( $list_rows as $row ) {
1792 1792
                                 foreach ( $row as $column ) {
1793
-                                    $list_field_value[] = $column;
1793
+                                    $list_field_value[ ] = $column;
1794 1794
                                 }
1795 1795
                             }
1796 1796
 
@@ -1825,16 +1825,16 @@  discard block
 block discarded – undo
1825 1825
          */
1826 1826
         $use_conditional_logic = apply_filters( 'gravityview/edit_entry/conditional_logic', true, $form );
1827 1827
 
1828
-        if( $use_conditional_logic ) {
1828
+        if ( $use_conditional_logic ) {
1829 1829
             return $form;
1830 1830
         }
1831 1831
 
1832
-        foreach( $form['fields'] as &$field ) {
1832
+        foreach ( $form[ 'fields' ] as &$field ) {
1833 1833
             /* @var GF_Field $field */
1834 1834
             $field->conditionalLogic = null;
1835 1835
         }
1836 1836
 
1837
-        unset( $form['button']['conditionalLogic'] );
1837
+        unset( $form[ 'button' ][ 'conditionalLogic' ] );
1838 1838
 
1839 1839
         return $form;
1840 1840
 
@@ -1851,7 +1851,7 @@  discard block
 block discarded – undo
1851 1851
      */
1852 1852
     public function manage_conditional_logic( $has_conditional_logic, $form ) {
1853 1853
 
1854
-        if( ! $this->is_edit_entry() ) {
1854
+        if ( ! $this->is_edit_entry() ) {
1855 1855
             return $has_conditional_logic;
1856 1856
         }
1857 1857
 
@@ -1883,44 +1883,44 @@  discard block
 block discarded – undo
1883 1883
          *  2. There are two entries embedded using oEmbed
1884 1884
          *  3. One of the entries has just been saved
1885 1885
          */
1886
-        if( !empty( $_POST['lid'] ) && !empty( $_GET['entry'] ) && ( $_POST['lid'] !== $_GET['entry'] ) ) {
1886
+        if ( ! empty( $_POST[ 'lid' ] ) && ! empty( $_GET[ 'entry' ] ) && ( $_POST[ 'lid' ] !== $_GET[ 'entry' ] ) ) {
1887 1887
 
1888 1888
             $error = true;
1889 1889
 
1890 1890
         }
1891 1891
 
1892
-        if( !empty( $_GET['entry'] ) && (string)$this->entry['id'] !== $_GET['entry'] ) {
1892
+        if ( ! empty( $_GET[ 'entry' ] ) && (string)$this->entry[ 'id' ] !== $_GET[ 'entry' ] ) {
1893 1893
 
1894 1894
             $error = true;
1895 1895
 
1896
-        } elseif( ! $this->verify_nonce() ) {
1896
+        } elseif ( ! $this->verify_nonce() ) {
1897 1897
 
1898 1898
             /**
1899 1899
              * If the Entry is embedded, there may be two entries on the same page.
1900 1900
              * If that's the case, and one is being edited, the other should fail gracefully and not display an error.
1901 1901
              */
1902
-            if( GravityView_oEmbed::getInstance()->get_entry_id() ) {
1902
+            if ( GravityView_oEmbed::getInstance()->get_entry_id() ) {
1903 1903
                 $error = true;
1904 1904
             } else {
1905
-                $error = __( 'The link to edit this entry is not valid; it may have expired.', 'gravityview');
1905
+                $error = __( 'The link to edit this entry is not valid; it may have expired.', 'gravityview' );
1906 1906
             }
1907 1907
 
1908 1908
         }
1909 1909
 
1910
-        if( ! GravityView_Edit_Entry::check_user_cap_edit_entry( $this->entry ) ) {
1911
-            $error = __( 'You do not have permission to edit this entry.', 'gravityview');
1910
+        if ( ! GravityView_Edit_Entry::check_user_cap_edit_entry( $this->entry ) ) {
1911
+            $error = __( 'You do not have permission to edit this entry.', 'gravityview' );
1912 1912
         }
1913 1913
 
1914
-        if( $this->entry['status'] === 'trash' ) {
1915
-            $error = __('You cannot edit the entry; it is in the trash.', 'gravityview' );
1914
+        if ( $this->entry[ 'status' ] === 'trash' ) {
1915
+            $error = __( 'You cannot edit the entry; it is in the trash.', 'gravityview' );
1916 1916
         }
1917 1917
 
1918 1918
         // No errors; everything's fine here!
1919
-        if( empty( $error ) ) {
1919
+        if ( empty( $error ) ) {
1920 1920
             return true;
1921 1921
         }
1922 1922
 
1923
-        if( $echo && $error !== true ) {
1923
+        if ( $echo && $error !== true ) {
1924 1924
 
1925 1925
 	        $error = esc_html( $error );
1926 1926
 
@@ -1928,13 +1928,13 @@  discard block
 block discarded – undo
1928 1928
 	         * @since 1.9
1929 1929
 	         */
1930 1930
 	        if ( ! empty( $this->entry ) ) {
1931
-		        $error .= ' ' . gravityview_get_link( '#', _x('Go back.', 'Link shown when invalid Edit Entry link is clicked', 'gravityview' ), array( 'onclick' => "window.history.go(-1); return false;" ) );
1931
+		        $error .= ' ' . gravityview_get_link( '#', _x( 'Go back.', 'Link shown when invalid Edit Entry link is clicked', 'gravityview' ), array( 'onclick' => "window.history.go(-1); return false;" ) );
1932 1932
 	        }
1933 1933
 
1934
-            echo GVCommon::generate_notice( wpautop( $error ), 'gv-error error');
1934
+            echo GVCommon::generate_notice( wpautop( $error ), 'gv-error error' );
1935 1935
         }
1936 1936
 
1937
-        do_action('gravityview_log_error', 'GravityView_Edit_Entry[user_can_edit_entry]' . $error );
1937
+        do_action( 'gravityview_log_error', 'GravityView_Edit_Entry[user_can_edit_entry]' . $error );
1938 1938
 
1939 1939
         return false;
1940 1940
     }
@@ -1951,20 +1951,20 @@  discard block
 block discarded – undo
1951 1951
 
1952 1952
         $error = NULL;
1953 1953
 
1954
-        if( ! $this->check_user_cap_edit_field( $field ) ) {
1955
-            $error = __( 'You do not have permission to edit this field.', 'gravityview');
1954
+        if ( ! $this->check_user_cap_edit_field( $field ) ) {
1955
+            $error = __( 'You do not have permission to edit this field.', 'gravityview' );
1956 1956
         }
1957 1957
 
1958 1958
         // No errors; everything's fine here!
1959
-        if( empty( $error ) ) {
1959
+        if ( empty( $error ) ) {
1960 1960
             return true;
1961 1961
         }
1962 1962
 
1963
-        if( $echo ) {
1964
-            echo GVCommon::generate_notice( wpautop( esc_html( $error ) ), 'gv-error error');
1963
+        if ( $echo ) {
1964
+            echo GVCommon::generate_notice( wpautop( esc_html( $error ) ), 'gv-error error' );
1965 1965
         }
1966 1966
 
1967
-        do_action('gravityview_log_error', 'GravityView_Edit_Entry[user_can_edit_field]' . $error );
1967
+        do_action( 'gravityview_log_error', 'GravityView_Edit_Entry[user_can_edit_field]' . $error );
1968 1968
 
1969 1969
         return false;
1970 1970
 
@@ -1982,15 +1982,15 @@  discard block
 block discarded – undo
1982 1982
     private function check_user_cap_edit_field( $field ) {
1983 1983
 
1984 1984
         // If they can edit any entries (as defined in Gravity Forms), we're good.
1985
-        if( GVCommon::has_cap( array( 'gravityforms_edit_entries', 'gravityview_edit_others_entries' ) ) ) {
1985
+        if ( GVCommon::has_cap( array( 'gravityforms_edit_entries', 'gravityview_edit_others_entries' ) ) ) {
1986 1986
             return true;
1987 1987
         }
1988 1988
 
1989
-        $field_cap = isset( $field['allow_edit_cap'] ) ? $field['allow_edit_cap'] : false;
1989
+        $field_cap = isset( $field[ 'allow_edit_cap' ] ) ? $field[ 'allow_edit_cap' ] : false;
1990 1990
 
1991 1991
         // If the field has custom editing capaibilities set, check those
1992
-        if( $field_cap ) {
1993
-            return GVCommon::has_cap( $field['allow_edit_cap'] );
1992
+        if ( $field_cap ) {
1993
+            return GVCommon::has_cap( $field[ 'allow_edit_cap' ] );
1994 1994
         }
1995 1995
 
1996 1996
         return false;
@@ -2004,17 +2004,17 @@  discard block
 block discarded – undo
2004 2004
     public function verify_nonce() {
2005 2005
 
2006 2006
         // Verify form submitted for editing single
2007
-        if( $this->is_edit_entry_submission() ) {
2007
+        if ( $this->is_edit_entry_submission() ) {
2008 2008
             $valid = wp_verify_nonce( $_POST[ self::$nonce_field ], self::$nonce_field );
2009 2009
         }
2010 2010
 
2011 2011
         // Verify
2012
-        else if( ! $this->is_edit_entry() ) {
2012
+        else if ( ! $this->is_edit_entry() ) {
2013 2013
             $valid = false;
2014 2014
         }
2015 2015
 
2016 2016
         else {
2017
-            $valid = wp_verify_nonce( $_GET['edit'], self::$nonce_key );
2017
+            $valid = wp_verify_nonce( $_GET[ 'edit' ], self::$nonce_key );
2018 2018
         }
2019 2019
 
2020 2020
         /**
Please login to merge, or discard this patch.
includes/class-gravityview-uninstall.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -59,8 +59,8 @@
 block discarded – undo
59 59
 
60 60
 		$notes_table = class_exists( 'GFFormsModel' ) ? GFFormsModel::get_lead_notes_table_name() : $wpdb->prefix . 'rg_lead_notes';
61 61
 
62
-		$disapproved = __('Disapproved the Entry for GravityView', 'gravityview');
63
-		$approved = __('Approved the Entry for GravityView', 'gravityview');
62
+		$disapproved = __( 'Disapproved the Entry for GravityView', 'gravityview' );
63
+		$approved = __( 'Approved the Entry for GravityView', 'gravityview' );
64 64
 
65 65
 		$sql = $wpdb->prepare( "
66 66
 			DELETE FROM $notes_table
Please login to merge, or discard this patch.
includes/class-gravityview-settings.php 1 patch
Spacing   +85 added lines, -85 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if( ! class_exists('GFAddOn') ) {
3
+if ( ! class_exists( 'GFAddOn' ) ) {
4 4
 	return;
5 5
 }
6 6
 
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 	 */
76 76
 	public function __construct( $prevent_multiple_instances = '' ) {
77 77
 
78
-		if( $prevent_multiple_instances === 'get_instance' ) {
78
+		if ( $prevent_multiple_instances === 'get_instance' ) {
79 79
 			return parent::__construct();
80 80
 		}
81 81
 
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 	 */
88 88
 	public static function get_instance() {
89 89
 
90
-		if( empty( self::$instance ) ) {
90
+		if ( empty( self::$instance ) ) {
91 91
 			self::$instance = new self( 'get_instance' );
92 92
 		}
93 93
 
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 	 */
107 107
 	public function current_user_can_any( $caps ) {
108 108
 
109
-		if( empty( $caps ) ) {
109
+		if ( empty( $caps ) ) {
110 110
 			$caps = array( 'gravityview_full_access' );
111 111
 		}
112 112
 
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
             ),
161 161
 			'found-other' => array(
162 162
                 'label' => esc_html__( 'I found a better plugin', 'gravityview' ),
163
-                'followup' => esc_attr__('What plugin you are using, and why?', 'gravityview'),
163
+                'followup' => esc_attr__( 'What plugin you are using, and why?', 'gravityview' ),
164 164
             ),
165 165
 			'other' => array(
166 166
                 'label' => esc_html__( 'Other', 'gravityview' ),
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
                 });
248 248
 
249 249
                 function gv_feedback_append_error_message() {
250
-                    $('#gv-uninstall-thanks').append('<div class="notice error"><?php echo esc_js( __('There was an error sharing your feedback. Sorry! Please email us at [email protected]', 'gravityview' ) ) ?></div>');
250
+                    $('#gv-uninstall-thanks').append('<div class="notice error"><?php echo esc_js( __( 'There was an error sharing your feedback. Sorry! Please email us at [email protected]', 'gravityview' ) ) ?></div>');
251 251
                 }
252 252
             });
253 253
         </script>
@@ -264,15 +264,15 @@  discard block
 block discarded – undo
264 264
             </ul>
265 265
             <div class="gv-followup widefat">
266 266
                 <p><strong><label for="gv-reason-details"><?php esc_html_e( 'Comments', 'gravityview' ); ?></label></strong></p>
267
-                <textarea id="gv-reason-details" name="reason_details" data-default="<?php esc_attr_e('Please share your thoughts about GravityView', 'gravityview') ?>" placeholder="<?php esc_attr_e('Please share your thoughts about GravityView', 'gravityview'); ?>" class="large-text"></textarea>
267
+                <textarea id="gv-reason-details" name="reason_details" data-default="<?php esc_attr_e( 'Please share your thoughts about GravityView', 'gravityview' ) ?>" placeholder="<?php esc_attr_e( 'Please share your thoughts about GravityView', 'gravityview' ); ?>" class="large-text"></textarea>
268 268
             </div>
269 269
             <div class="scale-description">
270
-                <p><strong><?php esc_html_e('How likely are you to recommend GravityView?', 'gravityview' ); ?></strong></p>
270
+                <p><strong><?php esc_html_e( 'How likely are you to recommend GravityView?', 'gravityview' ); ?></strong></p>
271 271
                 <ul class="inline">
272 272
 					<?php
273 273
 					$i = 0;
274
-					while( $i < 11 ) {
275
-						echo '<li class="inline number-scale"><label><input name="likely_to_refer" id="likely_to_refer_'.$i.'" value="'.$i.'" type="radio"> '.$i.'</label></li>';
274
+					while ( $i < 11 ) {
275
+						echo '<li class="inline number-scale"><label><input name="likely_to_refer" id="likely_to_refer_' . $i . '" value="' . $i . '" type="radio"> ' . $i . '</label></li>';
276 276
 						$i++;
277 277
 					}
278 278
 					?>
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
             </div>
282 282
 
283 283
             <div class="gv-form-field-wrapper">
284
-                <label><input type="checkbox" class="checkbox" name="follow_up_with_me" value="1" /> <?php esc_html_e('Please follow up with me about my feedback', 'gravityview'); ?></label>
284
+                <label><input type="checkbox" class="checkbox" name="follow_up_with_me" value="1" /> <?php esc_html_e( 'Please follow up with me about my feedback', 'gravityview' ); ?></label>
285 285
             </div>
286 286
 
287 287
             <div class="submit">
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
         <div id="gv-uninstall-thanks" class="notice notice-large notice-updated below-h2" style="display:none;">
296 296
             <h3 class="notice-title"><?php esc_html_e( 'Thank you for using GravityView!', 'gravityview' ); ?></h3>
297 297
             <p><?php echo gravityview_get_floaty(); ?>
298
-				<?php echo make_clickable( esc_html__('Your feedback helps us improve GravityView. If you have any questions or comments, email us: [email protected]', 'gravityview' ) ); ?>
298
+				<?php echo make_clickable( esc_html__( 'Your feedback helps us improve GravityView. If you have any questions or comments, email us: [email protected]', 'gravityview' ) ); ?>
299 299
             </p>
300 300
             <div class="wp-clearfix"></div>
301 301
         </div>
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
 		add_filter( 'gform_addon_app_settings_menu_gravityview', array( $this, 'modify_app_settings_menu_title' ) );
370 370
 
371 371
 		/** @since 1.7.6 */
372
-		add_action('network_admin_menu', array( $this, 'add_network_menu' ) );
372
+		add_action( 'network_admin_menu', array( $this, 'add_network_menu' ) );
373 373
 
374 374
 		parent::init_admin();
375 375
 	}
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
 	 */
384 384
 	public function modify_app_settings_menu_title( $setting_tabs ) {
385 385
 
386
-		$setting_tabs[0]['label'] = __( 'GravityView Settings', 'gravityview');
386
+		$setting_tabs[ 0 ][ 'label' ] = __( 'GravityView Settings', 'gravityview' );
387 387
 
388 388
 		return $setting_tabs;
389 389
 	}
@@ -400,11 +400,11 @@  discard block
 block discarded – undo
400 400
 	 */
401 401
 	private function _load_license_handler() {
402 402
 
403
-		if( !empty( $this->License_Handler ) ) {
403
+		if ( ! empty( $this->License_Handler ) ) {
404 404
 			return;
405 405
 		}
406 406
 
407
-		require_once( GRAVITYVIEW_DIR . 'includes/class-gv-license-handler.php');
407
+		require_once( GRAVITYVIEW_DIR . 'includes/class-gv-license-handler.php' );
408 408
 
409 409
 		$this->License_Handler = GV_License_Handler::get_instance( $this );
410 410
 	}
@@ -416,42 +416,42 @@  discard block
 block discarded – undo
416 416
 	function license_key_notice() {
417 417
 
418 418
 		// Only show on GravityView pages
419
-		if( ! gravityview_is_admin_page() ) {
419
+		if ( ! gravityview_is_admin_page() ) {
420 420
 			return;
421 421
 		}
422 422
 
423
-		$license_status = self::getSetting('license_key_status');
424
-		$license_key = self::getSetting('license_key');
425
-		if( '' === $license_key ) {
423
+		$license_status = self::getSetting( 'license_key_status' );
424
+		$license_key = self::getSetting( 'license_key' );
425
+		if ( '' === $license_key ) {
426 426
 			$license_status = 'inactive';
427 427
         }
428 428
 		$license_id = empty( $license_key ) ? 'license' : $license_key;
429 429
 
430
-		$message = esc_html__('Your GravityView license %s. This means you&rsquo;re missing out on updates and support! %sActivate your license%s or %sget a license here%s.', 'gravityview');
430
+		$message = esc_html__( 'Your GravityView license %s. This means you&rsquo;re missing out on updates and support! %sActivate your license%s or %sget a license here%s.', 'gravityview' );
431 431
 
432 432
 		/**
433 433
 		 * I wanted to remove the period from after the buttons in the string,
434 434
 		 * but didn't want to mess up the translation strings for the translators.
435 435
 		 */
436 436
 		$message = mb_substr( $message, 0, mb_strlen( $message ) - 1 );
437
-		$title = __('Inactive License', 'gravityview');
437
+		$title = __( 'Inactive License', 'gravityview' );
438 438
 		$status = '';
439 439
 		$update_below = false;
440 440
 		$primary_button_link = admin_url( 'edit.php?post_type=gravityview&amp;page=gravityview_settings' );
441 441
 		switch ( $license_status ) {
442 442
 			/** @since 1.17 */
443 443
 			case 'expired':
444
-				$title = __('Expired License', 'gravityview');
444
+				$title = __( 'Expired License', 'gravityview' );
445 445
 				$status = 'expired';
446
-				$message = $this->get_license_handler()->strings( 'expired', self::getSetting('license_key_response') );
446
+				$message = $this->get_license_handler()->strings( 'expired', self::getSetting( 'license_key_response' ) );
447 447
 				break;
448 448
 			case 'invalid':
449
-				$title = __('Invalid License', 'gravityview');
450
-				$status = __('is invalid', 'gravityview');
449
+				$title = __( 'Invalid License', 'gravityview' );
450
+				$status = __( 'is invalid', 'gravityview' );
451 451
 				break;
452 452
 			case 'deactivated':
453
-				$status = __('is inactive', 'gravityview');
454
-				$update_below = __('Activate your license key below.', 'gravityview');
453
+				$status = __( 'is inactive', 'gravityview' );
454
+				$update_below = __( 'Activate your license key below.', 'gravityview' );
455 455
 				break;
456 456
 			/** @noinspection PhpMissingBreakStatementInspection */
457 457
 			case '':
@@ -459,27 +459,27 @@  discard block
 block discarded – undo
459 459
 				// break intentionally left blank
460 460
 			case 'inactive':
461 461
 			case 'site_inactive':
462
-				$status = __('has not been activated', 'gravityview');
463
-				$update_below = __('Activate your license key below.', 'gravityview');
462
+				$status = __( 'has not been activated', 'gravityview' );
463
+				$update_below = __( 'Activate your license key below.', 'gravityview' );
464 464
 				break;
465 465
 		}
466
-		$url = 'https://gravityview.co/pricing/?utm_source=admin_notice&utm_medium=admin&utm_content='.$license_status.'&utm_campaign=Admin%20Notice';
466
+		$url = 'https://gravityview.co/pricing/?utm_source=admin_notice&utm_medium=admin&utm_content=' . $license_status . '&utm_campaign=Admin%20Notice';
467 467
 
468 468
 		// Show a different notice on settings page for inactive licenses (hide the buttons)
469
-		if( $update_below && gravityview_is_admin_page( '', 'settings' ) ) {
469
+		if ( $update_below && gravityview_is_admin_page( '', 'settings' ) ) {
470 470
 			$message = sprintf( $message, $status, '<div class="hidden">', '', '', '</div><a href="#" onclick="jQuery(\'#license_key\').focus(); return false;">' . $update_below . '</a>' );
471 471
 		} else {
472 472
 			$message = sprintf( $message, $status, "\n\n" . '<a href="' . esc_url( $primary_button_link ) . '" class="button button-primary">', '</a>', '<a href="' . esc_url( $url ) . '" class="button button-secondary">', '</a>' );
473 473
 		}
474 474
 
475
-		if( !empty( $status ) ) {
475
+		if ( ! empty( $status ) ) {
476 476
 			GravityView_Admin_Notices::add_notice( array(
477 477
 				'message' => $message,
478 478
 				'class'	=> 'updated',
479 479
 				'title' => $title,
480 480
 				'cap' => 'gravityview_edit_settings',
481
-				'dismiss' => sha1( $license_status.'_'.$license_id ),
482
-			));
481
+				'dismiss' => sha1( $license_status . '_' . $license_id ),
482
+			) );
483 483
 		}
484 484
 	}
485 485
 
@@ -491,7 +491,7 @@  discard block
 block discarded – undo
491 491
 
492 492
 		$styles = parent::styles();
493 493
 
494
-		$styles[] = array(
494
+		$styles[ ] = array(
495 495
 			'handle'  => 'gravityview_settings',
496 496
 			'src'     => plugins_url( 'assets/css/admin-settings.css', GRAVITYVIEW_FILE ),
497 497
 			'version' => GravityView_Plugin::version,
@@ -514,7 +514,7 @@  discard block
 block discarded – undo
514 514
 	 * @return void
515 515
 	 */
516 516
 	public function add_network_menu() {
517
-		if( GravityView_Plugin::is_network_activated() ) {
517
+		if ( GravityView_Plugin::is_network_activated() ) {
518 518
 			add_menu_page( __( 'Settings', 'gravityview' ), __( 'GravityView', 'gravityview' ), $this->_capabilities_app_settings, "{$this->_slug}_settings", array( $this, 'app_tab_page' ), 'none' );
519 519
 		}
520 520
 	}
@@ -531,7 +531,7 @@  discard block
 block discarded – undo
531 531
 		 * If multisite and not network admin, we don't want the settings to show.
532 532
 		 * @since 1.7.6
533 533
 		 */
534
-		$show_submenu = !is_multisite() ||  is_main_site() || !GravityView_Plugin::is_network_activated() || ( is_network_admin() && GravityView_Plugin::is_network_activated() );
534
+		$show_submenu = ! is_multisite() || is_main_site() || ! GravityView_Plugin::is_network_activated() || ( is_network_admin() && GravityView_Plugin::is_network_activated() );
535 535
 
536 536
 		/**
537 537
 		 * Override whether to show the Settings menu on a per-blog basis.
@@ -540,7 +540,7 @@  discard block
 block discarded – undo
540 540
 		 */
541 541
 		$show_submenu = apply_filters( 'gravityview/show-settings-menu', $show_submenu );
542 542
 
543
-		if( $show_submenu ) {
543
+		if ( $show_submenu ) {
544 544
 			add_submenu_page( 'edit.php?post_type=gravityview', __( 'Settings', 'gravityview' ), __( 'Settings', 'gravityview' ), $this->_capabilities_app_settings, $this->_slug . '_settings', array( $this, 'app_tab_page' ) );
545 545
 		}
546 546
 	}
@@ -579,7 +579,7 @@  discard block
 block discarded – undo
579 579
 		/**
580 580
 		 * Backward compatibility with Redux
581 581
 		 */
582
-		if( $setting_name === 'license' ) {
582
+		if ( $setting_name === 'license' ) {
583 583
 			return array(
584 584
 				'license' => parent::get_app_setting( 'license_key' ),
585 585
 				'status' => parent::get_app_setting( 'license_key_status' ),
@@ -643,7 +643,7 @@  discard block
 block discarded – undo
643 643
 
644 644
 		$return = $text . $activation;
645 645
 
646
-		if( $echo ) {
646
+		if ( $echo ) {
647 647
 			echo $return;
648 648
 		}
649 649
 
@@ -670,15 +670,15 @@  discard block
 block discarded – undo
670 670
 	 */
671 671
 	public function settings_submit( $field, $echo = true ) {
672 672
 
673
-		$field['type']  = ( isset($field['type']) && in_array( $field['type'], array('submit','reset','button') ) ) ? $field['type'] : 'submit';
673
+		$field[ 'type' ] = ( isset( $field[ 'type' ] ) && in_array( $field[ 'type' ], array( 'submit', 'reset', 'button' ) ) ) ? $field[ 'type' ] : 'submit';
674 674
 
675 675
 		$attributes    = $this->get_field_attributes( $field );
676 676
 		$default_value = rgar( $field, 'value' ) ? rgar( $field, 'value' ) : rgar( $field, 'default_value' );
677
-		$value         = $this->get_setting( $field['name'], $default_value );
677
+		$value         = $this->get_setting( $field[ 'name' ], $default_value );
678 678
 
679 679
 
680
-		$attributes['class'] = isset( $attributes['class'] ) ? esc_attr( $attributes['class'] ) : 'button-primary gfbutton';
681
-		$name    = ( $field['name'] === 'gform-settings-save' ) ? $field['name'] : '_gaddon_setting_'.$field['name'];
680
+		$attributes[ 'class' ] = isset( $attributes[ 'class' ] ) ? esc_attr( $attributes[ 'class' ] ) : 'button-primary gfbutton';
681
+		$name = ( $field[ 'name' ] === 'gform-settings-save' ) ? $field[ 'name' ] : '_gaddon_setting_' . $field[ 'name' ];
682 682
 
683 683
 		if ( empty( $value ) ) {
684 684
 			$value = __( 'Update Settings', 'gravityview' );
@@ -687,7 +687,7 @@  discard block
 block discarded – undo
687 687
 		$attributes = $this->get_field_attributes( $field );
688 688
 
689 689
 		$html = '<input
690
-                    type="' . $field['type'] . '"
690
+                    type="' . $field[ 'type' ] . '"
691 691
                     name="' . esc_attr( $name ) . '"
692 692
                     value="' . $value . '" ' .
693 693
 		        implode( ' ', $attributes ) .
@@ -709,12 +709,12 @@  discard block
 block discarded – undo
709 709
 	 * @return string
710 710
 	 */
711 711
 	public function settings_save( $field, $echo = true ) {
712
-		$field['type']  = 'submit';
713
-		$field['name']  = 'gform-settings-save';
714
-		$field['class'] = isset( $field['class'] ) ? $field['class'] : 'button-primary gfbutton';
712
+		$field[ 'type' ]  = 'submit';
713
+		$field[ 'name' ]  = 'gform-settings-save';
714
+		$field[ 'class' ] = isset( $field[ 'class' ] ) ? $field[ 'class' ] : 'button-primary gfbutton';
715 715
 
716 716
 		if ( ! rgar( $field, 'value' ) ) {
717
-			$field['value'] = __( 'Update Settings', 'gravityview' );
717
+			$field[ 'value' ] = __( 'Update Settings', 'gravityview' );
718 718
 		}
719 719
 
720 720
 		$output = $this->settings_submit( $field, false );
@@ -723,7 +723,7 @@  discard block
 block discarded – undo
723 723
 		$this->app_settings_uninstall_tab();
724 724
 		$output .= ob_get_clean();
725 725
 
726
-		if( $echo ) {
726
+		if ( $echo ) {
727 727
 			echo $output;
728 728
 		}
729 729
 
@@ -741,8 +741,8 @@  discard block
 block discarded – undo
741 741
 		parent::single_setting_label( $field );
742 742
 
743 743
 		// Added by GravityView
744
-		if ( isset( $field['description'] ) ) {
745
-			echo '<span class="description">'. $field['description'] .'</span>';
744
+		if ( isset( $field[ 'description' ] ) ) {
745
+			echo '<span class="description">' . $field[ 'description' ] . '</span>';
746 746
 		}
747 747
 
748 748
 	}
@@ -804,11 +804,11 @@  discard block
 block discarded – undo
804 804
 
805 805
 		// If the posted key doesn't match the activated/deactivated key (set using the Activate License button, AJAX response),
806 806
 		// then we assume it's changed. If it's changed, unset the status and the previous response.
807
-		if( $local_key !== $response_key ) {
807
+		if ( $local_key !== $response_key ) {
808 808
 
809
-			unset( $posted_settings['license_key_response'] );
810
-			unset( $posted_settings['license_key_status'] );
811
-			GFCommon::add_error_message( __('The license key you entered has been saved, but not activated. Please activate the license.', 'gravityview' ) );
809
+			unset( $posted_settings[ 'license_key_response' ] );
810
+			unset( $posted_settings[ 'license_key_status' ] );
811
+			GFCommon::add_error_message( __( 'The license key you entered has been saved, but not activated. Please activate the license.', 'gravityview' ) );
812 812
 		}
813 813
 
814 814
 		return $posted_settings;
@@ -843,25 +843,25 @@  discard block
 block discarded – undo
843 843
 				'label'             => __( 'License Key', 'gravityview' ),
844 844
 				'description'          => __( 'Enter the license key that was sent to you on purchase. This enables plugin updates &amp; support.', 'gravityview' ) . $this->get_license_handler()->license_details( $this->get_app_setting( 'license_key_response' ) ),
845 845
 				'type'              => 'edd_license',
846
-				'data-pending-text' => __('Verifying license&hellip;', 'gravityview'),
847
-				'default_value'           => $default_settings['license_key'],
846
+				'data-pending-text' => __( 'Verifying license&hellip;', 'gravityview' ),
847
+				'default_value'           => $default_settings[ 'license_key' ],
848 848
 				'class'             => ( '' == $this->get_app_setting( 'license_key' ) ) ? 'activate code regular-text edd-license-key' : 'deactivate code regular-text edd-license-key',
849 849
 			),
850 850
 			array(
851 851
 				'name'       => 'license_key_response',
852
-				'default_value'  => $default_settings['license_key_response'],
852
+				'default_value'  => $default_settings[ 'license_key_response' ],
853 853
 				'type'     => 'hidden',
854 854
 			),
855 855
 			array(
856 856
 				'name'       => 'license_key_status',
857
-				'default_value'  => $default_settings['license_key_status'],
857
+				'default_value'  => $default_settings[ 'license_key_status' ],
858 858
 				'type'     => 'hidden',
859 859
 			),
860 860
 			array(
861 861
 				'name'       => 'support-email',
862 862
 				'type'     => 'text',
863 863
 				'validate' => 'email',
864
-				'default_value'  => $default_settings['support-email'],
864
+				'default_value'  => $default_settings[ 'support-email' ],
865 865
 				'label'    => __( 'Support Email', 'gravityview' ),
866 866
 				'description' => __( 'In order to provide responses to your support requests, please provide your email address.', 'gravityview' ),
867 867
 				'class'    => 'code regular-text',
@@ -873,38 +873,38 @@  discard block
 block discarded – undo
873 873
 				'name'         => 'support_port',
874 874
 				'type'       => 'radio',
875 875
 				'label'      => __( 'Show Support Port?', 'gravityview' ),
876
-				'default_value'    => $default_settings['support_port'],
876
+				'default_value'    => $default_settings[ 'support_port' ],
877 877
 				'horizontal' => 1,
878 878
 				'choices'    => array(
879 879
 					array(
880
-						'label' => _x('Show', 'Setting: Show or Hide', 'gravityview'),
880
+						'label' => _x( 'Show', 'Setting: Show or Hide', 'gravityview' ),
881 881
 						'value' => '1',
882 882
 					),
883 883
 					array(
884
-						'label' => _x('Hide', 'Setting: Show or Hide', 'gravityview'),
884
+						'label' => _x( 'Hide', 'Setting: Show or Hide', 'gravityview' ),
885 885
 						'value' => '0',
886 886
 					),
887 887
 				),
888
-				'tooltip' => '<p><img src="' . esc_url_raw( plugins_url('assets/images/screenshots/beacon.png', GRAVITYVIEW_FILE ) ) . '" alt="' . esc_attr__( 'The Support Port looks like this.', 'gravityview' ) . '" class="alignright" style="max-width:40px; margin:.5em;" />' . esc_html__('The Support Port provides quick access to how-to articles and tutorials. For administrators, it also makes it easy to contact support.', 'gravityview') . '</p>',
888
+				'tooltip' => '<p><img src="' . esc_url_raw( plugins_url( 'assets/images/screenshots/beacon.png', GRAVITYVIEW_FILE ) ) . '" alt="' . esc_attr__( 'The Support Port looks like this.', 'gravityview' ) . '" class="alignright" style="max-width:40px; margin:.5em;" />' . esc_html__( 'The Support Port provides quick access to how-to articles and tutorials. For administrators, it also makes it easy to contact support.', 'gravityview' ) . '</p>',
889 889
 				'description'   => __( 'Show the Support Port on GravityView pages?', 'gravityview' ),
890 890
 			),
891 891
 			array(
892 892
 				'name'         => 'no-conflict-mode',
893 893
 				'type'       => 'radio',
894 894
 				'label'      => __( 'No-Conflict Mode', 'gravityview' ),
895
-				'default_value'    => $default_settings['no-conflict-mode'],
895
+				'default_value'    => $default_settings[ 'no-conflict-mode' ],
896 896
 				'horizontal' => 1,
897 897
 				'choices'    => array(
898 898
 					array(
899
-						'label' => _x('On', 'Setting: On or off', 'gravityview'),
899
+						'label' => _x( 'On', 'Setting: On or off', 'gravityview' ),
900 900
 						'value' => '1',
901 901
 					),
902 902
 					array(
903
-						'label' => _x('Off', 'Setting: On or off', 'gravityview'),
903
+						'label' => _x( 'Off', 'Setting: On or off', 'gravityview' ),
904 904
 						'value' => '0',
905 905
 					),
906 906
 				),
907
-				'description'   => __( 'Set this to ON to prevent extraneous scripts and styles from being printed on GravityView admin pages, reducing conflicts with other plugins and themes.', 'gravityview' ) . ' ' . __('If your Edit View tabs are ugly, enable this setting.', 'gravityview'),
907
+				'description'   => __( 'Set this to ON to prevent extraneous scripts and styles from being printed on GravityView admin pages, reducing conflicts with other plugins and themes.', 'gravityview' ) . ' ' . __( 'If your Edit View tabs are ugly, enable this setting.', 'gravityview' ),
908 908
 			),
909 909
 		) );
910 910
 
@@ -915,20 +915,20 @@  discard block
 block discarded – undo
915 915
 		 * @since 1.7.4
916 916
 		 */
917 917
 		foreach ( $fields as &$field ) {
918
-			$field['name']          = isset( $field['name'] ) ? $field['name'] : rgget('id', $field );
919
-			$field['label']         = isset( $field['label'] ) ? $field['label'] : rgget('title', $field );
920
-			$field['default_value'] = isset( $field['default_value'] ) ? $field['default_value'] : rgget('default', $field );
921
-			$field['description']   = isset( $field['description'] ) ? $field['description'] : rgget('subtitle', $field );
918
+			$field[ 'name' ]          = isset( $field[ 'name' ] ) ? $field[ 'name' ] : rgget( 'id', $field );
919
+			$field[ 'label' ]         = isset( $field[ 'label' ] ) ? $field[ 'label' ] : rgget( 'title', $field );
920
+			$field[ 'default_value' ] = isset( $field[ 'default_value' ] ) ? $field[ 'default_value' ] : rgget( 'default', $field );
921
+			$field[ 'description' ]   = isset( $field[ 'description' ] ) ? $field[ 'description' ] : rgget( 'subtitle', $field );
922 922
 
923
-			if( $disabled_attribute ) {
924
-				$field['disabled']  = $disabled_attribute;
923
+			if ( $disabled_attribute ) {
924
+				$field[ 'disabled' ] = $disabled_attribute;
925 925
 			}
926 926
 		}
927 927
 
928 928
 
929 929
         $sections = array(
930 930
             array(
931
-                'description' =>      sprintf( '<span class="version-info description">%s</span>', sprintf( __('You are running GravityView version %s', 'gravityview'), GravityView_Plugin::version ) ),
931
+                'description' =>      sprintf( '<span class="version-info description">%s</span>', sprintf( __( 'You are running GravityView version %s', 'gravityview' ), GravityView_Plugin::version ) ),
932 932
                 'fields'      => $fields,
933 933
             )
934 934
         );
@@ -939,8 +939,8 @@  discard block
 block discarded – undo
939 939
             'type'     => 'save',
940 940
         );
941 941
 
942
-		if( $disabled_attribute ) {
943
-			$button['disabled'] = $disabled_attribute;
942
+		if ( $disabled_attribute ) {
943
+			$button[ 'disabled' ] = $disabled_attribute;
944 944
 		}
945 945
 
946 946
 
@@ -960,20 +960,20 @@  discard block
 block discarded – undo
960 960
 		// If there are extensions, add a section for them
961 961
 		if ( ! empty( $extension_sections ) ) {
962 962
 
963
-			if( $disabled_attribute ) {
963
+			if ( $disabled_attribute ) {
964 964
 				foreach ( $extension_sections as &$section ) {
965
-					foreach ( $section['fields'] as &$field ) {
966
-						$field['disabled'] = $disabled_attribute;
965
+					foreach ( $section[ 'fields' ] as &$field ) {
966
+						$field[ 'disabled' ] = $disabled_attribute;
967 967
 					}
968 968
 				}
969 969
 			}
970 970
 
971
-            $k = count( $extension_sections ) - 1 ;
972
-            $extension_sections[ $k ]['fields'][] = $button;
971
+            $k = count( $extension_sections ) - 1;
972
+            $extension_sections[ $k ][ 'fields' ][ ] = $button;
973 973
 			$sections = array_merge( $sections, $extension_sections );
974 974
 		} else {
975 975
             // add the 'update settings' button to the general section
976
-            $sections[0]['fields'][] = $button;
976
+            $sections[ 0 ][ 'fields' ][ ] = $button;
977 977
         }
978 978
 
979 979
 		return $sections;
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-fileupload.php 1 patch
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -20,16 +20,16 @@  discard block
 block discarded – undo
20 20
 
21 21
 	function field_options( $field_options, $template_id, $field_id, $context, $input_type ) {
22 22
 
23
-		unset( $field_options['search_filter'] );
23
+		unset( $field_options[ 'search_filter' ] );
24 24
 
25
-		if( 'edit' === $context ) {
25
+		if ( 'edit' === $context ) {
26 26
 			return $field_options;
27 27
 		}
28 28
 
29
-		$add_options['link_to_file'] = array(
29
+		$add_options[ 'link_to_file' ] = array(
30 30
 			'type' => 'checkbox',
31 31
 			'label' => __( 'Display as a Link:', 'gravityview' ),
32
-			'desc' => __('Display the uploaded files as links, rather than embedded content.', 'gravityview'),
32
+			'desc' => __( 'Display the uploaded files as links, rather than embedded content.', 'gravityview' ),
33 33
 			'value' => false,
34 34
 			'merge_tags' => false,
35 35
 		);
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 		$output_arr = array();
66 66
 
67 67
 		// Get an array of file paths for the field.
68
-		$file_paths = rgar( $field , 'multipleFiles' ) ? json_decode( $value ) : array( $value );
68
+		$file_paths = rgar( $field, 'multipleFiles' ) ? json_decode( $value ) : array( $value );
69 69
 
70 70
 		// The $value JSON was probably truncated; let's check lead_detail_long.
71 71
 		if ( ! is_array( $file_paths ) ) {
@@ -79,19 +79,19 @@  discard block
 block discarded – undo
79 79
 		}
80 80
 
81 81
 		// Process each file path
82
-		foreach( $file_paths as $file_path ) {
82
+		foreach ( $file_paths as $file_path ) {
83 83
 
84 84
 			// If the site is HTTPS, use HTTPS
85
-			if(function_exists('set_url_scheme')) { $file_path = set_url_scheme($file_path); }
85
+			if ( function_exists( 'set_url_scheme' ) ) { $file_path = set_url_scheme( $file_path ); }
86 86
 
87 87
 			// This is from Gravity Forms's code
88
-			$file_path = esc_attr(str_replace(" ", "%20", $file_path));
88
+			$file_path = esc_attr( str_replace( " ", "%20", $file_path ) );
89 89
 
90 90
 			// If the field is set to link to the single entry, link to it.
91
-			$link = !empty( $field_settings['show_as_link'] ) ? GravityView_API::entry_link( $entry, $field ) : $file_path;
91
+			$link = ! empty( $field_settings[ 'show_as_link' ] ) ? GravityView_API::entry_link( $entry, $field ) : $file_path;
92 92
 
93 93
 			// Get file path information
94
-			$file_path_info = pathinfo($file_path);
94
+			$file_path_info = pathinfo( $file_path );
95 95
 
96 96
 			$html_format = NULL;
97 97
 
@@ -100,30 +100,30 @@  discard block
 block discarded – undo
100 100
 			$disable_wrapped_link = false;
101 101
 
102 102
 			// Is this an image?
103
-			$image = new GravityView_Image(array(
103
+			$image = new GravityView_Image( array(
104 104
 				'src' => $file_path,
105
-				'class' => 'gv-image gv-field-id-'.$field_settings['id'],
106
-				'alt' => $field_settings['label'],
107
-				'width' => (gravityview_get_context() === 'single' ? NULL : 250)
108
-			));
105
+				'class' => 'gv-image gv-field-id-' . $field_settings[ 'id' ],
106
+				'alt' => $field_settings[ 'label' ],
107
+				'width' => ( gravityview_get_context() === 'single' ? NULL : 250 )
108
+			) );
109 109
 
110 110
 			$content = $image->html();
111 111
 
112 112
 			// The new default content is the image, if it exists. If not, use the file name as the content.
113
-			$content = !empty( $content ) ? $content : $file_path_info['basename'];
113
+			$content = ! empty( $content ) ? $content : $file_path_info[ 'basename' ];
114 114
 
115 115
 			// If pathinfo() gave us the extension of the file, run the switch statement using that.
116
-			$extension = empty( $file_path_info['extension'] ) ? NULL : strtolower( $file_path_info['extension'] );
116
+			$extension = empty( $file_path_info[ 'extension' ] ) ? NULL : strtolower( $file_path_info[ 'extension' ] );
117 117
 
118 118
 
119
-			switch( true ) {
119
+			switch ( true ) {
120 120
 
121 121
 				// Audio file
122 122
 				case in_array( $extension, wp_get_audio_extensions() ):
123 123
 
124 124
 					$disable_lightbox = true;
125 125
 
126
-					if( shortcode_exists( 'audio' ) ) {
126
+					if ( shortcode_exists( 'audio' ) ) {
127 127
 
128 128
 						$disable_wrapped_link = true;
129 129
 
@@ -134,8 +134,8 @@  discard block
 block discarded – undo
134 134
 						 */
135 135
 						$audio_settings = apply_filters( 'gravityview_audio_settings', array(
136 136
 							'src' => $file_path,
137
-							'class' => 'wp-audio-shortcode gv-audio gv-field-id-'.$field_settings['id']
138
-						));
137
+							'class' => 'wp-audio-shortcode gv-audio gv-field-id-' . $field_settings[ 'id' ]
138
+						) );
139 139
 
140 140
 						/**
141 141
 						 * Generate the audio shortcode
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 
154 154
 					$disable_lightbox = true;
155 155
 
156
-					if( shortcode_exists( 'video' ) ) {
156
+					if ( shortcode_exists( 'video' ) ) {
157 157
 
158 158
 						$disable_wrapped_link = true;
159 159
 
@@ -164,8 +164,8 @@  discard block
 block discarded – undo
164 164
 						 */
165 165
 						$video_settings = apply_filters( 'gravityview_video_settings', array(
166 166
 							'src' => $file_path,
167
-							'class' => 'wp-video-shortcode gv-video gv-field-id-'.$field_settings['id']
168
-						));
167
+							'class' => 'wp-video-shortcode gv-video gv-field-id-' . $field_settings[ 'id' ]
168
+						) );
169 169
 
170 170
 						/**
171 171
 						 * Generate the video shortcode
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 					break;
188 188
 
189 189
 				// if not image, do not set the lightbox (@since 1.5.3)
190
-				case !in_array( $extension, array( 'jpg', 'jpeg', 'jpe', 'gif', 'png' ) ):
190
+				case ! in_array( $extension, array( 'jpg', 'jpeg', 'jpe', 'gif', 'png' ) ):
191 191
 
192 192
 					$disable_lightbox = true;
193 193
 
@@ -197,10 +197,10 @@  discard block
 block discarded – undo
197 197
 
198 198
 			// If using Link to File, override the content.
199 199
 			// (We do this here so that the $disable_lightbox can be set. Yes, there's a little more processing time, but oh well.)
200
-			if( !empty( $field_settings['link_to_file'] ) ) {
200
+			if ( ! empty( $field_settings[ 'link_to_file' ] ) ) {
201 201
 
202 202
 				// Force the content to be the file name
203
-				$content =  $file_path_info["basename"];
203
+				$content = $file_path_info[ "basename" ];
204 204
 
205 205
 				// Restore the wrapped link
206 206
 				$disable_wrapped_link = false;
@@ -208,13 +208,13 @@  discard block
 block discarded – undo
208 208
 			}
209 209
 
210 210
 			// Whether to use lightbox or not
211
-			if( $disable_lightbox || empty( $gravityview_view->atts['lightbox'] ) || !empty( $field_settings['show_as_link'] ) ) {
211
+			if ( $disable_lightbox || empty( $gravityview_view->atts[ 'lightbox' ] ) || ! empty( $field_settings[ 'show_as_link' ] ) ) {
212 212
 
213
-				$link_atts = empty( $field_settings['show_as_link'] ) ? array( 'target' => '_blank' ) : array();
213
+				$link_atts = empty( $field_settings[ 'show_as_link' ] ) ? array( 'target' => '_blank' ) : array();
214 214
 
215 215
 			} else {
216 216
 
217
-				$entry_slug = GravityView_API::get_entry_slug( $entry['id'], $entry );
217
+				$entry_slug = GravityView_API::get_entry_slug( $entry[ 'id' ], $entry );
218 218
 
219 219
 				$link_atts = array(
220 220
 					'rel' => sprintf( "%s-%s", $gv_class, $entry_slug ),
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
 			$disable_wrapped_link = apply_filters( 'gravityview/fields/fileupload/disable_link', $disable_wrapped_link, $gravityview_view->getCurrentField() );
241 241
 
242 242
 			// If the HTML output hasn't been overridden by the switch statement above, use the default format
243
-			if( !empty( $content ) && empty( $disable_wrapped_link ) ) {
243
+			if ( ! empty( $content ) && empty( $disable_wrapped_link ) ) {
244 244
 
245 245
 				/**
246 246
 				 * Modify the link text (defaults to the file name)
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
                 $content = gravityview_get_link( $link, $content, $link_atts );
256 256
 			}
257 257
 
258
-			$output_arr[] = array(
258
+			$output_arr[ ] = array(
259 259
 				'file_path' => $file_path,
260 260
 				'content' => $content
261 261
 			);
Please login to merge, or discard this patch.
includes/widgets/search-widget/class-search-widget.php 1 patch
Spacing   +105 added lines, -105 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 				'type' => 'radio',
64 64
 				'full_width' => true,
65 65
 				'label' => esc_html__( 'Search Mode', 'gravityview' ),
66
-				'desc' => __('Should search results match all search fields, or any?', 'gravityview'),
66
+				'desc' => __( 'Should search results match all search fields, or any?', 'gravityview' ),
67 67
 				'value' => 'any',
68 68
 				'class' => 'hide-if-js',
69 69
 				'options' => array(
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 
86 86
 		// admin - add scripts - run at 1100 to make sure GravityView_Admin_Views::add_scripts_and_styles() runs first at 999
87 87
 		add_action( 'admin_enqueue_scripts', array( $this, 'add_scripts_and_styles' ), 1100 );
88
-		add_action( 'wp_enqueue_scripts', array( $this, 'register_scripts') );
88
+		add_action( 'wp_enqueue_scripts', array( $this, 'register_scripts' ) );
89 89
 		add_filter( 'gravityview_noconflict_scripts', array( $this, 'register_no_conflict' ) );
90 90
 
91 91
 		// ajax - get the searchable fields
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 		$script_min = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
213 213
 		$script_source = empty( $script_min ) ? '/source' : '';
214 214
 
215
-		wp_enqueue_script( 'gravityview_searchwidget_admin', plugins_url( 'assets/js'.$script_source.'/admin-search-widget'.$script_min.'.js', __FILE__ ), array( 'jquery', 'gravityview_views_scripts' ), GravityView_Plugin::version );
215
+		wp_enqueue_script( 'gravityview_searchwidget_admin', plugins_url( 'assets/js' . $script_source . '/admin-search-widget' . $script_min . '.js', __FILE__ ), array( 'jquery', 'gravityview_views_scripts' ), GravityView_Plugin::version );
216 216
 
217 217
 		wp_localize_script( 'gravityview_searchwidget_admin', 'gvSearchVar', array(
218 218
 			'nonce' => wp_create_nonce( 'gravityview_ajaxsearchwidget' ),
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
 	 * @return array Scripts allowed in no-conflict mode, plus the search widget script
235 235
 	 */
236 236
 	public function register_no_conflict( $allowed ) {
237
-		$allowed[] = 'gravityview_searchwidget_admin';
237
+		$allowed[ ] = 'gravityview_searchwidget_admin';
238 238
 		return $allowed;
239 239
 	}
240 240
 
@@ -247,24 +247,24 @@  discard block
 block discarded – undo
247 247
 	 */
248 248
 	public static function get_searchable_fields() {
249 249
 
250
-		if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( $_POST['nonce'], 'gravityview_ajaxsearchwidget' ) ) {
250
+		if ( ! isset( $_POST[ 'nonce' ] ) || ! wp_verify_nonce( $_POST[ 'nonce' ], 'gravityview_ajaxsearchwidget' ) ) {
251 251
 			exit( '0' );
252 252
 		}
253 253
 
254 254
 		$form = '';
255 255
 
256 256
 		// Fetch the form for the current View
257
-		if ( ! empty( $_POST['view_id'] ) ) {
257
+		if ( ! empty( $_POST[ 'view_id' ] ) ) {
258 258
 
259
-			$form = gravityview_get_form_id( $_POST['view_id'] );
259
+			$form = gravityview_get_form_id( $_POST[ 'view_id' ] );
260 260
 
261
-		} elseif ( ! empty( $_POST['formid'] ) ) {
261
+		} elseif ( ! empty( $_POST[ 'formid' ] ) ) {
262 262
 
263
-			$form = (int) $_POST['formid'];
263
+			$form = (int)$_POST[ 'formid' ];
264 264
 
265
-		} elseif ( ! empty( $_POST['template_id'] ) && class_exists( 'GravityView_Ajax' ) ) {
265
+		} elseif ( ! empty( $_POST[ 'template_id' ] ) && class_exists( 'GravityView_Ajax' ) ) {
266 266
 
267
-			$form = GravityView_Ajax::pre_get_form_fields( $_POST['template_id'] );
267
+			$form = GravityView_Ajax::pre_get_form_fields( $_POST[ 'template_id' ] );
268 268
 
269 269
 		}
270 270
 
@@ -309,8 +309,8 @@  discard block
 block discarded – undo
309 309
 			)
310 310
 		);
311 311
 
312
-		foreach( $custom_fields as $custom_field_key => $custom_field ) {
313
-			$output .= sprintf( '<option value="%s" %s data-inputtypes="%s" data-placeholder="%s">%s</option>', $custom_field_key, selected( $custom_field_key, $current, false ), $custom_field['type'], self::get_field_label( array('field' => $custom_field_key ) ), $custom_field['text'] );
312
+		foreach ( $custom_fields as $custom_field_key => $custom_field ) {
313
+			$output .= sprintf( '<option value="%s" %s data-inputtypes="%s" data-placeholder="%s">%s</option>', $custom_field_key, selected( $custom_field_key, $current, false ), $custom_field[ 'type' ], self::get_field_label( array( 'field' => $custom_field_key ) ), $custom_field[ 'text' ] );
314 314
 		}
315 315
 
316 316
 		// Get fields with sub-inputs and no parent
@@ -332,13 +332,13 @@  discard block
 block discarded – undo
332 332
 
333 333
 			foreach ( $fields as $id => $field ) {
334 334
 
335
-				if ( in_array( $field['type'], $blacklist_field_types ) ) {
335
+				if ( in_array( $field[ 'type' ], $blacklist_field_types ) ) {
336 336
 					continue;
337 337
 				}
338 338
 
339
-				$types = self::get_search_input_types( $id, $field['type'] );
339
+				$types = self::get_search_input_types( $id, $field[ 'type' ] );
340 340
 
341
-				$output .= '<option value="'. $id .'" '. selected( $id, $current, false ).'data-inputtypes="'. esc_attr( $types ) .'">'. esc_html( $field['label'] ) .'</option>';
341
+				$output .= '<option value="' . $id . '" ' . selected( $id, $current, false ) . 'data-inputtypes="' . esc_attr( $types ) . '">' . esc_html( $field[ 'label' ] ) . '</option>';
342 342
 			}
343 343
 		}
344 344
 
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
 	public static function get_search_input_types( $id = '', $field_type = null ) {
361 361
 
362 362
 		// @todo - This needs to be improved - many fields have . including products and addresses
363
-		if ( false !== strpos( (string) $id, '.' ) && in_array( $field_type, array( 'checkbox' ) ) || in_array( $id, array( 'is_fulfilled' ) ) ) {
363
+		if ( false !== strpos( (string)$id, '.' ) && in_array( $field_type, array( 'checkbox' ) ) || in_array( $id, array( 'is_fulfilled' ) ) ) {
364 364
 			$input_type = 'boolean'; // on/off checkbox
365 365
 		} elseif ( in_array( $field_type, array( 'checkbox', 'post_category', 'multiselect' ) ) ) {
366 366
 			$input_type = 'multi'; //multiselect
@@ -402,19 +402,19 @@  discard block
 block discarded – undo
402 402
 			$post_id = 0;
403 403
 
404 404
 			// We're in the WordPress Widget context, and an overriding post ID has been set.
405
-			if ( ! empty( $widget_args['post_id'] ) ) {
406
-				$post_id = absint( $widget_args['post_id'] );
405
+			if ( ! empty( $widget_args[ 'post_id' ] ) ) {
406
+				$post_id = absint( $widget_args[ 'post_id' ] );
407 407
 			}
408 408
 			// We're in the WordPress Widget context, and the base View ID should be used
409
-			else if ( ! empty( $widget_args['view_id'] ) ) {
410
-				$post_id = absint( $widget_args['view_id'] );
409
+			else if ( ! empty( $widget_args[ 'view_id' ] ) ) {
410
+				$post_id = absint( $widget_args[ 'view_id' ] );
411 411
 			}
412 412
 
413 413
 			$args = gravityview_get_permalink_query_args( $post_id );
414 414
 
415 415
 			// Add hidden fields to the search form
416 416
 			foreach ( $args as $key => $value ) {
417
-				$search_fields[] = array(
417
+				$search_fields[ ] = array(
418 418
 					'name'  => $key,
419 419
 					'input' => 'hidden',
420 420
 					'value' => $value,
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
 	 */
436 436
 	public function filter_entries( $search_criteria ) {
437 437
 
438
-		if( 'post' === $this->search_method ) {
438
+		if ( 'post' === $this->search_method ) {
439 439
 			$get = $_POST;
440 440
 		} else {
441 441
 			$get = $_GET;
@@ -452,15 +452,15 @@  discard block
 block discarded – undo
452 452
 		$get = gv_map_deep( $get, 'rawurldecode' );
453 453
 
454 454
 		// add free search
455
-		if ( ! empty( $get['gv_search'] ) ) {
455
+		if ( ! empty( $get[ 'gv_search' ] ) ) {
456 456
 
457 457
 			// Search for a piece
458
-			$words = explode( ' ', $get['gv_search'] );
458
+			$words = explode( ' ', $get[ 'gv_search' ] );
459 459
 
460 460
 			$words = array_filter( $words );
461 461
 
462 462
 			foreach ( $words as $word ) {
463
-				$search_criteria['field_filters'][] = array(
463
+				$search_criteria[ 'field_filters' ][ ] = array(
464 464
 					'key' => null, // The field ID to search
465 465
 					'value' => $word, // The value to search
466 466
 					'operator' => 'contains', // What to search in. Options: `is` or `contains`
@@ -469,8 +469,8 @@  discard block
 block discarded – undo
469 469
 		}
470 470
 
471 471
 		//start date & end date
472
-		$curr_start = !empty( $get['gv_start'] ) ? $get['gv_start'] : '';
473
-		$curr_end = !empty( $get['gv_start'] ) ? $get['gv_end'] : '';
472
+		$curr_start = ! empty( $get[ 'gv_start' ] ) ? $get[ 'gv_start' ] : '';
473
+		$curr_end = ! empty( $get[ 'gv_start' ] ) ? $get[ 'gv_end' ] : '';
474 474
 
475 475
         /**
476 476
          * @filter `gravityview_date_created_adjust_timezone` Whether to adjust the timezone for entries. \n
@@ -485,16 +485,16 @@  discard block
 block discarded – undo
485 485
 		/**
486 486
 		 * Don't set $search_criteria['start_date'] if start_date is empty as it may lead to bad query results (GFAPI::get_entries)
487 487
 		 */
488
-		if( !empty( $curr_start ) ) {
489
-			$search_criteria['start_date'] = $adjust_tz ? get_gmt_from_date( $curr_start ) : $curr_start;
488
+		if ( ! empty( $curr_start ) ) {
489
+			$search_criteria[ 'start_date' ] = $adjust_tz ? get_gmt_from_date( $curr_start ) : $curr_start;
490 490
 		}
491
-		if( !empty( $curr_end ) ) {
492
-			$search_criteria['end_date'] = $adjust_tz ? get_gmt_from_date( $curr_end ) : $curr_end;
491
+		if ( ! empty( $curr_end ) ) {
492
+			$search_criteria[ 'end_date' ] = $adjust_tz ? get_gmt_from_date( $curr_end ) : $curr_end;
493 493
 		}
494 494
 
495 495
 		// search for a specific entry ID
496 496
 		if ( ! empty( $get[ 'gv_id' ] ) ) {
497
-			$search_criteria['field_filters'][] = array(
497
+			$search_criteria[ 'field_filters' ][ ] = array(
498 498
 				'key' => 'id',
499 499
 				'value' => absint( $get[ 'gv_id' ] ),
500 500
 				'operator' => '=',
@@ -503,36 +503,36 @@  discard block
 block discarded – undo
503 503
 
504 504
 		// search for a specific Created_by ID
505 505
 		if ( ! empty( $get[ 'gv_by' ] ) ) {
506
-			$search_criteria['field_filters'][] = array(
506
+			$search_criteria[ 'field_filters' ][ ] = array(
507 507
 				'key' => 'created_by',
508
-				'value' => absint( $get['gv_by'] ),
508
+				'value' => absint( $get[ 'gv_by' ] ),
509 509
 				'operator' => '=',
510 510
 			);
511 511
 		}
512 512
 
513 513
 
514 514
 		// Get search mode passed in URL
515
-		$mode = isset( $get['mode'] ) && in_array( $get['mode'], array( 'any', 'all' ) ) ?  $get['mode'] : 'any';
515
+		$mode = isset( $get[ 'mode' ] ) && in_array( $get[ 'mode' ], array( 'any', 'all' ) ) ? $get[ 'mode' ] : 'any';
516 516
 
517 517
 		// get the other search filters
518 518
 		foreach ( $get as $key => $value ) {
519 519
 
520
-			if ( 0 !== strpos( $key, 'filter_' ) || empty( $value ) || ( is_array( $value ) && count( $value ) === 1 && empty( $value[0] ) ) ) {
520
+			if ( 0 !== strpos( $key, 'filter_' ) || empty( $value ) || ( is_array( $value ) && count( $value ) === 1 && empty( $value[ 0 ] ) ) ) {
521 521
 				continue;
522 522
 			}
523 523
 
524 524
 			// could return simple filter or multiple filters
525 525
 			$filter = $this->prepare_field_filter( $key, $value );
526 526
 
527
-			if ( isset( $filter[0]['value'] ) ) {
528
-				$search_criteria['field_filters'] = array_merge( $search_criteria['field_filters'], $filter );
527
+			if ( isset( $filter[ 0 ][ 'value' ] ) ) {
528
+				$search_criteria[ 'field_filters' ] = array_merge( $search_criteria[ 'field_filters' ], $filter );
529 529
 
530 530
 				// if date range type, set search mode to ALL
531
-				if ( ! empty( $filter[0]['operator'] ) && in_array( $filter[0]['operator'], array( '>=', '<=', '>', '<' ) ) ) {
531
+				if ( ! empty( $filter[ 0 ][ 'operator' ] ) && in_array( $filter[ 0 ][ 'operator' ], array( '>=', '<=', '>', '<' ) ) ) {
532 532
 					$mode = 'all';
533 533
 				}
534
-			} elseif( !empty( $filter ) ) {
535
-				$search_criteria['field_filters'][] = $filter;
534
+			} elseif ( ! empty( $filter ) ) {
535
+				$search_criteria[ 'field_filters' ][ ] = $filter;
536 536
 			}
537 537
 		}
538 538
 
@@ -541,7 +541,7 @@  discard block
 block discarded – undo
541 541
 		 * @since 1.5.1
542 542
 		 * @param[out,in] string $mode Search mode (`any` vs `all`)
543 543
 		 */
544
-		$search_criteria['field_filters']['mode'] = apply_filters( 'gravityview/search/mode', $mode );
544
+		$search_criteria[ 'field_filters' ][ 'mode' ] = apply_filters( 'gravityview/search/mode', $mode );
545 545
 
546 546
 		do_action( 'gravityview_log_debug', sprintf( '%s[filter_entries] Returned Search Criteria: ', get_class( $this ) ), $search_criteria );
547 547
 
@@ -567,7 +567,7 @@  discard block
 block discarded – undo
567 567
 		$field_id = str_replace( 'filter_', '', $key );
568 568
 
569 569
 		// calculates field_id, removing 'filter_' and for '_' for advanced fields ( like name or checkbox )
570
-		if ( preg_match('/^[0-9_]+$/ism', $field_id ) ) {
570
+		if ( preg_match( '/^[0-9_]+$/ism', $field_id ) ) {
571 571
 			$field_id = str_replace( '_', '.', $field_id );
572 572
 		}
573 573
 
@@ -581,11 +581,11 @@  discard block
 block discarded – undo
581 581
 			'value' => $value,
582 582
 		);
583 583
 
584
-		switch ( $form_field['type'] ) {
584
+		switch ( $form_field[ 'type' ] ) {
585 585
 
586 586
 			case 'select':
587 587
 			case 'radio':
588
-				$filter['operator'] = 'is';
588
+				$filter[ 'operator' ] = 'is';
589 589
 				break;
590 590
 
591 591
 			case 'post_category':
@@ -599,7 +599,7 @@  discard block
 block discarded – undo
599 599
 
600 600
 				foreach ( $value as $val ) {
601 601
 					$cat = get_term( $val, 'category' );
602
-					$filter[] = array(
602
+					$filter[ ] = array(
603 603
 						'key' => $field_id,
604 604
 						'value' => esc_attr( $cat->name ) . ':' . $val,
605 605
 						'operator' => 'is',
@@ -618,18 +618,18 @@  discard block
 block discarded – undo
618 618
 				$filter = array();
619 619
 
620 620
 				foreach ( $value as $val ) {
621
-					$filter[] = array( 'key' => $field_id, 'value' => $val );
621
+					$filter[ ] = array( 'key' => $field_id, 'value' => $val );
622 622
 				}
623 623
 
624 624
 				break;
625 625
 
626 626
 			case 'checkbox':
627 627
 				// convert checkbox on/off into the correct search filter
628
-				if ( false !== strpos( $field_id, '.' ) && ! empty( $form_field['inputs'] ) && ! empty( $form_field['choices'] ) ) {
629
-					foreach ( $form_field['inputs'] as $k => $input ) {
630
-						if ( $input['id'] == $field_id ) {
631
-							$filter['value'] = $form_field['choices'][ $k ]['value'];
632
-							$filter['operator'] = 'is';
628
+				if ( false !== strpos( $field_id, '.' ) && ! empty( $form_field[ 'inputs' ] ) && ! empty( $form_field[ 'choices' ] ) ) {
629
+					foreach ( $form_field[ 'inputs' ] as $k => $input ) {
630
+						if ( $input[ 'id' ] == $field_id ) {
631
+							$filter[ 'value' ] = $form_field[ 'choices' ][ $k ][ 'value' ];
632
+							$filter[ 'operator' ] = 'is';
633 633
 							break;
634 634
 						}
635 635
 					}
@@ -639,7 +639,7 @@  discard block
 block discarded – undo
639 639
 					$filter = array();
640 640
 
641 641
 					foreach ( $value as $val ) {
642
-						$filter[] = array(
642
+						$filter[ ] = array(
643 643
 								'key'   => $field_id,
644 644
 								'value' => $val,
645 645
 								'operator' => 'is',
@@ -660,9 +660,9 @@  discard block
 block discarded – undo
660 660
 					foreach ( $words as $word ) {
661 661
 						if ( ! empty( $word ) && strlen( $word ) > 1 ) {
662 662
 							// Keep the same key for each filter
663
-							$filter['value'] = $word;
663
+							$filter[ 'value' ] = $word;
664 664
 							// Add a search for the value
665
-							$filters[] = $filter;
665
+							$filters[ ] = $filter;
666 666
 						}
667 667
 					}
668 668
 
@@ -689,19 +689,19 @@  discard block
 block discarded – undo
689 689
 						 * @since 1.16.3
690 690
 						 * Safeguard until GF implements '<=' operator
691 691
 						 */
692
-						if( !GFFormsModel::is_valid_operator( $operator ) && $operator === '<=' ) {
692
+						if ( ! GFFormsModel::is_valid_operator( $operator ) && $operator === '<=' ) {
693 693
 							$operator = '<';
694 694
 							$date = date( 'Y-m-d', strtotime( $date . ' +1 day' ) );
695 695
 						}
696 696
 
697
-						$filter[] = array(
697
+						$filter[ ] = array(
698 698
 							'key' => $field_id,
699 699
 							'value' => self::get_formatted_date( $date, 'Y-m-d' ),
700 700
 							'operator' => $operator,
701 701
 						);
702 702
 					}
703 703
 				} else {
704
-					$filter['value'] = self::get_formatted_date( $value, 'Y-m-d' );
704
+					$filter[ 'value' ] = self::get_formatted_date( $value, 'Y-m-d' );
705 705
 				}
706 706
 
707 707
 				break;
@@ -732,7 +732,7 @@  discard block
 block discarded – undo
732 732
 			'ymd_dot' => 'Y.m.d',
733 733
 		);
734 734
 
735
-		if ( ! empty( $field->dateFormat ) && isset( $datepicker[ $field->dateFormat ] ) ){
735
+		if ( ! empty( $field->dateFormat ) && isset( $datepicker[ $field->dateFormat ] ) ) {
736 736
 			$format = $datepicker[ $field->dateFormat ];
737 737
 		}
738 738
 
@@ -763,7 +763,7 @@  discard block
 block discarded – undo
763 763
 	public function add_template_path( $file_paths ) {
764 764
 
765 765
 		// Index 100 is the default GravityView template path.
766
-		$file_paths[102] = self::$file . 'templates/';
766
+		$file_paths[ 102 ] = self::$file . 'templates/';
767 767
 
768 768
 		return $file_paths;
769 769
 	}
@@ -782,7 +782,7 @@  discard block
 block discarded – undo
782 782
 		$has_date = false;
783 783
 
784 784
 		foreach ( $search_fields as $k => $field ) {
785
-			if ( in_array( $field['input'], array( 'date', 'date_range', 'entry_date' ) ) ) {
785
+			if ( in_array( $field[ 'input' ], array( 'date', 'date_range', 'entry_date' ) ) ) {
786 786
 				$has_date = true;
787 787
 				break;
788 788
 			}
@@ -809,7 +809,7 @@  discard block
 block discarded – undo
809 809
 		}
810 810
 
811 811
 		// get configured search fields
812
-		$search_fields = ! empty( $widget_args['search_fields'] ) ? json_decode( $widget_args['search_fields'], true ) : '';
812
+		$search_fields = ! empty( $widget_args[ 'search_fields' ] ) ? json_decode( $widget_args[ 'search_fields' ], true ) : '';
813 813
 
814 814
 		if ( empty( $search_fields ) || ! is_array( $search_fields ) ) {
815 815
 			do_action( 'gravityview_log_debug', sprintf( '%s[render_frontend] No search fields configured for widget:', get_class( $this ) ), $widget_args );
@@ -824,34 +824,34 @@  discard block
 block discarded – undo
824 824
 
825 825
 			$updated_field = $this->get_search_filter_details( $updated_field );
826 826
 
827
-			switch ( $field['field'] ) {
827
+			switch ( $field[ 'field' ] ) {
828 828
 
829 829
 				case 'search_all':
830
-					$updated_field['key'] = 'search_all';
831
-					$updated_field['input'] = 'search_all';
832
-					$updated_field['value'] = $this->rgget_or_rgpost( 'gv_search' );
830
+					$updated_field[ 'key' ] = 'search_all';
831
+					$updated_field[ 'input' ] = 'search_all';
832
+					$updated_field[ 'value' ] = $this->rgget_or_rgpost( 'gv_search' );
833 833
 					break;
834 834
 
835 835
 				case 'entry_date':
836
-					$updated_field['key'] = 'entry_date';
837
-					$updated_field['input'] = 'entry_date';
838
-					$updated_field['value'] = array(
836
+					$updated_field[ 'key' ] = 'entry_date';
837
+					$updated_field[ 'input' ] = 'entry_date';
838
+					$updated_field[ 'value' ] = array(
839 839
 						'start' => $this->rgget_or_rgpost( 'gv_start' ),
840 840
 						'end' => $this->rgget_or_rgpost( 'gv_end' ),
841 841
 					);
842 842
 					break;
843 843
 
844 844
 				case 'entry_id':
845
-					$updated_field['key'] = 'entry_id';
846
-					$updated_field['input'] = 'entry_id';
847
-					$updated_field['value'] = $this->rgget_or_rgpost( 'gv_id' );
845
+					$updated_field[ 'key' ] = 'entry_id';
846
+					$updated_field[ 'input' ] = 'entry_id';
847
+					$updated_field[ 'value' ] = $this->rgget_or_rgpost( 'gv_id' );
848 848
 					break;
849 849
 
850 850
 				case 'created_by':
851
-					$updated_field['key'] = 'created_by';
852
-					$updated_field['name'] = 'gv_by';
853
-					$updated_field['value'] = $this->rgget_or_rgpost( 'gv_by' );
854
-					$updated_field['choices'] = self::get_created_by_choices();
851
+					$updated_field[ 'key' ] = 'created_by';
852
+					$updated_field[ 'name' ] = 'gv_by';
853
+					$updated_field[ 'value' ] = $this->rgget_or_rgpost( 'gv_by' );
854
+					$updated_field[ 'choices' ] = self::get_created_by_choices();
855 855
 					break;
856 856
 			}
857 857
 
@@ -869,16 +869,16 @@  discard block
 block discarded – undo
869 869
 		 */
870 870
 		$gravityview_view->search_fields = apply_filters( 'gravityview_widget_search_filters', $search_fields, $this, $widget_args );
871 871
 
872
-		$gravityview_view->search_layout = ! empty( $widget_args['search_layout'] ) ? $widget_args['search_layout'] : 'horizontal';
872
+		$gravityview_view->search_layout = ! empty( $widget_args[ 'search_layout' ] ) ? $widget_args[ 'search_layout' ] : 'horizontal';
873 873
 
874 874
 		/** @since 1.14 */
875
-		$gravityview_view->search_mode = ! empty( $widget_args['search_mode'] ) ? $widget_args['search_mode'] : 'any';
875
+		$gravityview_view->search_mode = ! empty( $widget_args[ 'search_mode' ] ) ? $widget_args[ 'search_mode' ] : 'any';
876 876
 
877
-		$custom_class = ! empty( $widget_args['custom_class'] ) ? $widget_args['custom_class'] : '';
877
+		$custom_class = ! empty( $widget_args[ 'custom_class' ] ) ? $widget_args[ 'custom_class' ] : '';
878 878
 
879 879
 		$gravityview_view->search_class = self::get_search_class( $custom_class );
880 880
 
881
-		$gravityview_view->search_clear = ! empty( $widget_args['search_clear'] ) ? $widget_args['search_clear'] : false;
881
+		$gravityview_view->search_clear = ! empty( $widget_args[ 'search_clear' ] ) ? $widget_args[ 'search_clear' ] : false;
882 882
 
883 883
 		if ( $this->has_date_field( $search_fields ) ) {
884 884
 			// enqueue datepicker stuff only if needed!
@@ -900,10 +900,10 @@  discard block
 block discarded – undo
900 900
 	public static function get_search_class( $custom_class = '' ) {
901 901
 		$gravityview_view = GravityView_View::getInstance();
902 902
 
903
-		$search_class = 'gv-search-'.$gravityview_view->search_layout;
903
+		$search_class = 'gv-search-' . $gravityview_view->search_layout;
904 904
 
905
-		if ( ! empty( $custom_class )  ) {
906
-			$search_class .= ' '.$custom_class;
905
+		if ( ! empty( $custom_class ) ) {
906
+			$search_class .= ' ' . $custom_class;
907 907
 		}
908 908
 
909 909
 		/**
@@ -945,11 +945,11 @@  discard block
 block discarded – undo
945 945
 
946 946
 		$label = rgget( 'label', $field );
947 947
 
948
-		if( '' === $label ) {
948
+		if ( '' === $label ) {
949 949
 
950
-			$label = isset( $form_field['label'] ) ? $form_field['label'] : '';
950
+			$label = isset( $form_field[ 'label' ] ) ? $form_field[ 'label' ] : '';
951 951
 
952
-			switch( $field['field'] ) {
952
+			switch ( $field[ 'field' ] ) {
953 953
 				case 'search_all':
954 954
 					$label = __( 'Search Entries:', 'gravityview' );
955 955
 					break;
@@ -961,10 +961,10 @@  discard block
 block discarded – undo
961 961
 					break;
962 962
 				default:
963 963
 					// If this is a field input, not a field
964
-					if ( strpos( $field['field'], '.' ) > 0 && ! empty( $form_field['inputs'] ) ) {
964
+					if ( strpos( $field[ 'field' ], '.' ) > 0 && ! empty( $form_field[ 'inputs' ] ) ) {
965 965
 
966 966
 						// Get the label for the field in question, which returns an array
967
-						$items = wp_list_filter( $form_field['inputs'], array( 'id' => $field['field'] ) );
967
+						$items = wp_list_filter( $form_field[ 'inputs' ], array( 'id' => $field[ 'field' ] ) );
968 968
 
969 969
 						// Get the item with the `label` key
970 970
 						$values = wp_list_pluck( $items, 'label' );
@@ -1003,32 +1003,32 @@  discard block
 block discarded – undo
1003 1003
 		$form = $gravityview_view->getForm();
1004 1004
 
1005 1005
 		// for advanced field ids (eg, first name / last name )
1006
-		$name = 'filter_' . str_replace( '.', '_', $field['field'] );
1006
+		$name = 'filter_' . str_replace( '.', '_', $field[ 'field' ] );
1007 1007
 
1008 1008
 		// get searched value from $_GET/$_POST (string or array)
1009 1009
 		$value = $this->rgget_or_rgpost( $name );
1010 1010
 
1011 1011
 		// get form field details
1012
-		$form_field = gravityview_get_field( $form, $field['field'] );
1012
+		$form_field = gravityview_get_field( $form, $field[ 'field' ] );
1013 1013
 
1014 1014
 		$filter = array(
1015
-			'key' => $field['field'],
1015
+			'key' => $field[ 'field' ],
1016 1016
 			'name' => $name,
1017 1017
 			'label' => self::get_field_label( $field, $form_field ),
1018
-			'input' => $field['input'],
1018
+			'input' => $field[ 'input' ],
1019 1019
 			'value' => $value,
1020
-			'type' => $form_field['type'],
1020
+			'type' => $form_field[ 'type' ],
1021 1021
 		);
1022 1022
 
1023 1023
 		// collect choices
1024
-		if ( 'post_category' === $form_field['type'] && ! empty( $form_field['displayAllCategories'] ) && empty( $form_field['choices'] ) ) {
1025
-			$filter['choices'] = gravityview_get_terms_choices();
1026
-		} elseif ( ! empty( $form_field['choices'] ) ) {
1027
-			$filter['choices'] = $form_field['choices'];
1024
+		if ( 'post_category' === $form_field[ 'type' ] && ! empty( $form_field[ 'displayAllCategories' ] ) && empty( $form_field[ 'choices' ] ) ) {
1025
+			$filter[ 'choices' ] = gravityview_get_terms_choices();
1026
+		} elseif ( ! empty( $form_field[ 'choices' ] ) ) {
1027
+			$filter[ 'choices' ] = $form_field[ 'choices' ];
1028 1028
 		}
1029 1029
 
1030
-		if ( 'date_range' === $field['input'] && empty( $value ) ) {
1031
-			$filter['value'] = array( 'start' => '', 'end' => '' );
1030
+		if ( 'date_range' === $field[ 'input' ] && empty( $value ) ) {
1031
+			$filter[ 'value' ] = array( 'start' => '', 'end' => '' );
1032 1032
 		}
1033 1033
 
1034 1034
 		return $filter;
@@ -1052,7 +1052,7 @@  discard block
 block discarded – undo
1052 1052
 
1053 1053
 		$choices = array();
1054 1054
 		foreach ( $users as $user ) {
1055
-			$choices[] = array(
1055
+			$choices[ ] = array(
1056 1056
 				'value' => $user->ID,
1057 1057
 				'text' => $user->display_name,
1058 1058
 			);
@@ -1107,7 +1107,7 @@  discard block
 block discarded – undo
1107 1107
 	 */
1108 1108
 	public function add_datepicker_js_dependency( $js_dependencies ) {
1109 1109
 
1110
-		$js_dependencies[] = 'jquery-ui-datepicker';
1110
+		$js_dependencies[ ] = 'jquery-ui-datepicker';
1111 1111
 
1112 1112
 		return $js_dependencies;
1113 1113
 	}
@@ -1151,7 +1151,7 @@  discard block
 block discarded – undo
1151 1151
 			'isRTL'             => is_rtl(),
1152 1152
 		), $view_data );
1153 1153
 
1154
-		$localizations['datepicker'] = $datepicker_settings;
1154
+		$localizations[ 'datepicker' ] = $datepicker_settings;
1155 1155
 
1156 1156
 		return $localizations;
1157 1157
 
@@ -1180,7 +1180,7 @@  discard block
 block discarded – undo
1180 1180
 	 * @return void
1181 1181
 	 */
1182 1182
 	private function maybe_enqueue_flexibility() {
1183
-		if ( isset( $_SERVER['HTTP_USER_AGENT'] ) && preg_match( '/MSIE [8-9]/', $_SERVER['HTTP_USER_AGENT'] ) ) {
1183
+		if ( isset( $_SERVER[ 'HTTP_USER_AGENT' ] ) && preg_match( '/MSIE [8-9]/', $_SERVER[ 'HTTP_USER_AGENT' ] ) ) {
1184 1184
 			wp_enqueue_script( 'gv-flexibility' );
1185 1185
 		}
1186 1186
 	}
@@ -1202,7 +1202,7 @@  discard block
 block discarded – undo
1202 1202
 		add_filter( 'gravityview_js_localization', array( $this, 'add_datepicker_localization' ), 10, 2 );
1203 1203
 
1204 1204
 		$scheme = is_ssl() ? 'https://' : 'http://';
1205
-		wp_enqueue_style( 'jquery-ui-datepicker', $scheme.'ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/themes/smoothness/jquery-ui.css' );
1205
+		wp_enqueue_style( 'jquery-ui-datepicker', $scheme . 'ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/themes/smoothness/jquery-ui.css' );
1206 1206
 
1207 1207
 		/**
1208 1208
 		 * @filter `gravityview_search_datepicker_class`
Please login to merge, or discard this patch.
includes/class-admin-views.php 1 patch
Spacing   +173 added lines, -173 removed lines patch added patch discarded remove patch
@@ -28,30 +28,30 @@  discard block
 block discarded – undo
28 28
 		add_filter( 'gravityview_blacklist_field_types', array( $this, 'default_field_blacklist' ), 10, 2 );
29 29
 
30 30
 		// Tooltips
31
-		add_filter( 'gform_tooltips', array( $this, 'tooltips') );
31
+		add_filter( 'gform_tooltips', array( $this, 'tooltips' ) );
32 32
 
33 33
 		// adding styles and scripts
34
-		add_action( 'admin_enqueue_scripts', array( 'GravityView_Admin_Views', 'add_scripts_and_styles'), 999 );
35
-		add_filter( 'gform_noconflict_styles', array( $this, 'register_no_conflict') );
36
-		add_filter( 'gform_noconflict_scripts', array( $this, 'register_no_conflict') );
37
-		add_filter( 'gravityview_noconflict_styles', array( $this, 'register_no_conflict') );
38
-		add_filter( 'gravityview_noconflict_scripts', array( $this, 'register_no_conflict') );
39
-
40
-		add_action( 'gravityview_render_directory_active_areas', array( $this, 'render_directory_active_areas'), 10, 4 );
41
-		add_action( 'gravityview_render_widgets_active_areas', array( $this, 'render_widgets_active_areas'), 10, 3 );
42
-		add_action( 'gravityview_render_available_fields', array( $this, 'render_available_fields'), 10, 2 );
43
-		add_action( 'gravityview_render_available_widgets', array( $this, 'render_available_widgets') );
44
-		add_action( 'gravityview_render_active_areas', array( $this, 'render_active_areas'), 10, 5 );
34
+		add_action( 'admin_enqueue_scripts', array( 'GravityView_Admin_Views', 'add_scripts_and_styles' ), 999 );
35
+		add_filter( 'gform_noconflict_styles', array( $this, 'register_no_conflict' ) );
36
+		add_filter( 'gform_noconflict_scripts', array( $this, 'register_no_conflict' ) );
37
+		add_filter( 'gravityview_noconflict_styles', array( $this, 'register_no_conflict' ) );
38
+		add_filter( 'gravityview_noconflict_scripts', array( $this, 'register_no_conflict' ) );
39
+
40
+		add_action( 'gravityview_render_directory_active_areas', array( $this, 'render_directory_active_areas' ), 10, 4 );
41
+		add_action( 'gravityview_render_widgets_active_areas', array( $this, 'render_widgets_active_areas' ), 10, 3 );
42
+		add_action( 'gravityview_render_available_fields', array( $this, 'render_available_fields' ), 10, 2 );
43
+		add_action( 'gravityview_render_available_widgets', array( $this, 'render_available_widgets' ) );
44
+		add_action( 'gravityview_render_active_areas', array( $this, 'render_active_areas' ), 10, 5 );
45 45
 
46 46
 		// @todo check if this hook is needed..
47 47
 		//add_action( 'gravityview_render_field_options', array( $this, 'render_field_options'), 10, 9 );
48 48
 
49 49
 		// Add Connected Form column
50
-		add_filter('manage_gravityview_posts_columns' , array( $this, 'add_post_type_columns' ) );
50
+		add_filter( 'manage_gravityview_posts_columns', array( $this, 'add_post_type_columns' ) );
51 51
 
52 52
 		add_filter( 'gform_toolbar_menu', array( 'GravityView_Admin_Views', 'gform_toolbar_menu' ), 10, 2 );
53 53
 
54
-		add_action( 'manage_gravityview_posts_custom_column', array( $this, 'add_custom_column_content'), 10, 2 );
54
+		add_action( 'manage_gravityview_posts_custom_column', array( $this, 'add_custom_column_content' ), 10, 2 );
55 55
 
56 56
 		add_action( 'restrict_manage_posts', array( $this, 'add_view_dropdown' ) );
57 57
 
@@ -66,11 +66,11 @@  discard block
 block discarded – undo
66 66
 	public function filter_pre_get_posts_by_gravityview_form_id( &$query ) {
67 67
 		global $pagenow;
68 68
 
69
-		if ( !is_admin() ) {
69
+		if ( ! is_admin() ) {
70 70
 			return;
71 71
 		}
72 72
 
73
-		if( 'edit.php' !== $pagenow || ! rgget( 'gravityview_form_id' ) || ! isset( $query->query_vars[ 'post_type' ] ) ) {
73
+		if ( 'edit.php' !== $pagenow || ! rgget( 'gravityview_form_id' ) || ! isset( $query->query_vars[ 'post_type' ] ) ) {
74 74
 			return;
75 75
 		}
76 76
 
@@ -87,18 +87,18 @@  discard block
 block discarded – undo
87 87
 	function add_view_dropdown() {
88 88
 		$current_screen = get_current_screen();
89 89
 
90
-		if( 'gravityview' !== $current_screen->post_type ) {
90
+		if ( 'gravityview' !== $current_screen->post_type ) {
91 91
 			return;
92 92
 		}
93 93
 
94 94
 		$forms = gravityview_get_forms();
95 95
 		$current_form = rgget( 'gravityview_form_id' );
96 96
 		// If there are no forms to select, show no forms.
97
-		if( !empty( $forms ) ) { ?>
97
+		if ( ! empty( $forms ) ) { ?>
98 98
 			<select name="gravityview_form_id" id="gravityview_form_id">
99 99
 				<option value="" <?php selected( '', $current_form, true ); ?>><?php esc_html_e( 'All forms', 'gravityview' ); ?></option>
100
-				<?php foreach( $forms as $form ) { ?>
101
-					<option value="<?php echo $form['id']; ?>" <?php selected( $form['id'], $current_form, true ); ?>><?php echo esc_html( $form['title'] ); ?></option>
100
+				<?php foreach ( $forms as $form ) { ?>
101
+					<option value="<?php echo $form[ 'id' ]; ?>" <?php selected( $form[ 'id' ], $current_form, true ); ?>><?php echo esc_html( $form[ 'title' ] ); ?></option>
102 102
 				<?php } ?>
103 103
 			</select>
104 104
 		<?php }
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 	 */
112 112
 	public static function render_setting_row( $key = '', $current_settings = array(), $override_input = null, $name = 'template_settings[%s]', $id = 'gravityview_se_%s' ) {
113 113
 		_deprecated_function( 'GravityView_Admin_Views::render_setting_row', '1.1.7', 'GravityView_Render_Settings::render_setting_row' );
114
-		GravityView_Render_Settings::render_setting_row( $key, $current_settings, $override_input, $name , $id );
114
+		GravityView_Render_Settings::render_setting_row( $key, $current_settings, $override_input, $name, $id );
115 115
 	}
116 116
 
117 117
 	/**
@@ -134,9 +134,9 @@  discard block
 block discarded – undo
134 134
 
135 135
 		$connected_views = gravityview_get_connected_views( $id );
136 136
 
137
-		if( empty( $connected_views ) ) {
137
+		if ( empty( $connected_views ) ) {
138 138
 
139
-		    $menu_items['gravityview'] = array(
139
+		    $menu_items[ 'gravityview' ] = array(
140 140
 				'label'          => esc_attr__( 'Create a View', 'gravityview' ),
141 141
 				'icon'           => '<i class="fa fa-lg gv-icon-astronaut-head gv-icon"></i>',
142 142
 				'title'          => esc_attr__( 'Create a View using this form as a data source', 'gravityview' ),
@@ -152,22 +152,22 @@  discard block
 block discarded – undo
152 152
 		$sub_menu_items = array();
153 153
 		foreach ( (array)$connected_views as $view ) {
154 154
 
155
-			if( ! GVCommon::has_cap( 'edit_gravityview', $view->ID ) ) {
155
+			if ( ! GVCommon::has_cap( 'edit_gravityview', $view->ID ) ) {
156 156
 				continue;
157 157
 			}
158 158
 
159
-			$label = empty( $view->post_title ) ? sprintf( __('No Title (View #%d)', 'gravityview' ), $view->ID ) : $view->post_title;
159
+			$label = empty( $view->post_title ) ? sprintf( __( 'No Title (View #%d)', 'gravityview' ), $view->ID ) : $view->post_title;
160 160
 
161
-			$sub_menu_items[] = array(
161
+			$sub_menu_items[ ] = array(
162 162
 				'label' => esc_attr( $label ),
163
-				'url' => admin_url( 'post.php?action=edit&post='.$view->ID ),
163
+				'url' => admin_url( 'post.php?action=edit&post=' . $view->ID ),
164 164
 			);
165 165
 		}
166 166
 
167 167
 		// If there were no items added, then let's create the parent menu
168
-		if( $sub_menu_items ) {
168
+		if ( $sub_menu_items ) {
169 169
 
170
-		    $sub_menu_items[] = array(
170
+		    $sub_menu_items[ ] = array(
171 171
 			    'label' => esc_attr__( 'Create a View', 'gravityview' ),
172 172
                 'link_class' => 'gv-create-view',
173 173
 			    'title' => esc_attr__( 'Create a View using this form as a data source', 'gravityview' ),
@@ -176,14 +176,14 @@  discard block
 block discarded – undo
176 176
             );
177 177
 
178 178
 			// Make sure Gravity Forms uses the submenu; if there's only one item, it uses a link instead of a dropdown
179
-			$sub_menu_items[] = array(
179
+			$sub_menu_items[ ] = array(
180 180
 				'url' => '#',
181 181
 				'label' => '',
182 182
 				'menu_class' => 'hidden',
183 183
 				'capabilities' => '',
184 184
 			);
185 185
 
186
-			$menu_items['gravityview'] = array(
186
+			$menu_items[ 'gravityview' ] = array(
187 187
 				'label'          => __( 'Connected Views', 'gravityview' ),
188 188
 				'icon'           => '<i class="fa fa-lg gv-icon-astronaut-head gv-icon"></i>',
189 189
 				'title'          => __( 'GravityView Views using this form as a data source', 'gravityview' ),
@@ -212,8 +212,8 @@  discard block
 block discarded – undo
212 212
 		$add = array( 'captcha', 'page' );
213 213
 
214 214
 		// Don't allowing editing the following values:
215
-		if( $context === 'edit' ) {
216
-			$add[] = 'post_id';
215
+		if ( $context === 'edit' ) {
216
+			$add[ ] = 'post_id';
217 217
 		}
218 218
 
219 219
 		$return = array_merge( $array, $add );
@@ -236,32 +236,32 @@  discard block
 block discarded – undo
236 236
 		foreach ( $default_args as $key => $arg ) {
237 237
 
238 238
 			// If an arg has `tooltip` defined, but it's false, don't display a tooltip
239
-			if( isset( $arg['tooltip'] ) && empty( $arg['tooltip'] ) ) { continue; }
239
+			if ( isset( $arg[ 'tooltip' ] ) && empty( $arg[ 'tooltip' ] ) ) { continue; }
240 240
 
241 241
 			// By default, use `tooltip` if defined.
242
-			$tooltip = empty( $arg['tooltip'] ) ? NULL : $arg['tooltip'];
242
+			$tooltip = empty( $arg[ 'tooltip' ] ) ? NULL : $arg[ 'tooltip' ];
243 243
 
244 244
 			// Otherwise, use the description as a tooltip.
245
-			if( empty( $tooltip ) && !empty( $arg['desc'] ) ) {
246
-				$tooltip = $arg['desc'];
245
+			if ( empty( $tooltip ) && ! empty( $arg[ 'desc' ] ) ) {
246
+				$tooltip = $arg[ 'desc' ];
247 247
 			}
248 248
 
249 249
 			// If there's no tooltip set, continue
250
-			if( empty( $tooltip ) ) {
250
+			if ( empty( $tooltip ) ) {
251 251
 				continue;
252 252
 			}
253 253
 
254 254
 			// Add the tooltip
255
-			$gv_tooltips[ 'gv_'.$key ] = array(
256
-				'title'	=> $arg['label'],
255
+			$gv_tooltips[ 'gv_' . $key ] = array(
256
+				'title'	=> $arg[ 'label' ],
257 257
 				'value'	=> $tooltip,
258 258
 			);
259 259
 
260 260
 		}
261 261
 
262
-		$gv_tooltips['gv_css_merge_tags'] = array(
263
-			'title' => __('CSS Merge Tags', 'gravityview'),
264
-			'value' => sprintf( __( 'Developers: The CSS classes will be sanitized using the %ssanitize_title_with_dashes()%s function.', 'gravityview'), '<code>', '</code>' )
262
+		$gv_tooltips[ 'gv_css_merge_tags' ] = array(
263
+			'title' => __( 'CSS Merge Tags', 'gravityview' ),
264
+			'value' => sprintf( __( 'Developers: The CSS classes will be sanitized using the %ssanitize_title_with_dashes()%s function.', 'gravityview' ), '<code>', '</code>' )
265 265
 		);
266 266
 
267 267
 		/**
@@ -272,9 +272,9 @@  discard block
 block discarded – undo
272 272
 
273 273
 		foreach ( $gv_tooltips as $key => $tooltip ) {
274 274
 
275
-			$title = empty( $tooltip['title'] ) ? '' : '<h6>'.esc_html( $tooltip['title'] ) .'</h6>';
275
+			$title = empty( $tooltip[ 'title' ] ) ? '' : '<h6>' . esc_html( $tooltip[ 'title' ] ) . '</h6>';
276 276
 
277
-			$tooltips[ $key ] = $title . wpautop( esc_html( $tooltip['value'] ) );
277
+			$tooltips[ $key ] = $title . wpautop( esc_html( $tooltip[ 'value' ] ) );
278 278
 		}
279 279
 
280 280
 		return $tooltips;
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
 	 *
289 289
 	 * @return void
290 290
 	 */
291
-	public function add_custom_column_content( $column_name = NULL, $post_id )	{
291
+	public function add_custom_column_content( $column_name = NULL, $post_id ) {
292 292
 
293 293
 		$output = '';
294 294
 
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
 				// Generate backup if label doesn't exist: `example_name` => `Example Name`
311 311
 				$template_id_pretty = ucwords( implode( ' ', explode( '_', $template_id ) ) );
312 312
 
313
-				$output = $template ? $template['label'] : $template_id_pretty;
313
+				$output = $template ? $template[ 'label' ] : $template_id_pretty;
314 314
 
315 315
 				break;
316 316
 
@@ -351,44 +351,44 @@  discard block
 block discarded – undo
351 351
 	static public function get_connected_form_links( $form, $include_form_link = true ) {
352 352
 
353 353
 		// Either the form is empty or the form ID is 0, not yet set.
354
-		if( empty( $form ) ) {
354
+		if ( empty( $form ) ) {
355 355
 			return '';
356 356
 		}
357 357
 
358 358
 		// The $form is passed as the form ID
359
-		if( !is_array( $form ) ) {
359
+		if ( ! is_array( $form ) ) {
360 360
 			$form = gravityview_get_form( $form );
361 361
 		}
362 362
 
363
-		$form_id = $form['id'];
363
+		$form_id = $form[ 'id' ];
364 364
 		$links = array();
365 365
 
366
-		if( GVCommon::has_cap( 'gravityforms_edit_forms' ) ) {
366
+		if ( GVCommon::has_cap( 'gravityforms_edit_forms' ) ) {
367 367
 			$form_url = admin_url( sprintf( 'admin.php?page=gf_edit_forms&amp;id=%d', $form_id ) );
368
-			$form_link = '<strong class="gv-form-title">'.gravityview_get_link( $form_url, $form['title'], 'class=row-title' ).'</strong>';
369
-			$links[] = '<span>'.gravityview_get_link( $form_url, __('Edit Form', 'gravityview') ).'</span>';
368
+			$form_link = '<strong class="gv-form-title">' . gravityview_get_link( $form_url, $form[ 'title' ], 'class=row-title' ) . '</strong>';
369
+			$links[ ] = '<span>' . gravityview_get_link( $form_url, __( 'Edit Form', 'gravityview' ) ) . '</span>';
370 370
 		} else {
371
-			$form_link = '<strong class="gv-form-title">'. esc_html( $form['title'] ). '</strong>';
371
+			$form_link = '<strong class="gv-form-title">' . esc_html( $form[ 'title' ] ) . '</strong>';
372 372
 		}
373 373
 
374
-		if( GVCommon::has_cap( 'gravityforms_view_entries' ) ) {
374
+		if ( GVCommon::has_cap( 'gravityforms_view_entries' ) ) {
375 375
 			$entries_url = admin_url( sprintf( 'admin.php?page=gf_entries&amp;id=%d', $form_id ) );
376
-			$links[] = '<span>'.gravityview_get_link( $entries_url, __('Entries', 'gravityview') ).'</span>';
376
+			$links[ ] = '<span>' . gravityview_get_link( $entries_url, __( 'Entries', 'gravityview' ) ) . '</span>';
377 377
 		}
378 378
 
379
-		if( GVCommon::has_cap( array( 'gravityforms_edit_settings', 'gravityview_view_settings' ) ) ) {
379
+		if ( GVCommon::has_cap( array( 'gravityforms_edit_settings', 'gravityview_view_settings' ) ) ) {
380 380
 			$settings_url = admin_url( sprintf( 'admin.php?page=gf_edit_forms&amp;view=settings&amp;id=%d', $form_id ) );
381
-			$links[] = '<span>'.gravityview_get_link( $settings_url, __('Settings', 'gravityview'), 'title='.__('Edit settings for this form', 'gravityview') ).'</span>';
381
+			$links[ ] = '<span>' . gravityview_get_link( $settings_url, __( 'Settings', 'gravityview' ), 'title=' . __( 'Edit settings for this form', 'gravityview' ) ) . '</span>';
382 382
 		}
383 383
 
384
-		if( GVCommon::has_cap( array("gravityforms_edit_forms", "gravityforms_create_form", "gravityforms_preview_forms") ) ) {
384
+		if ( GVCommon::has_cap( array( "gravityforms_edit_forms", "gravityforms_create_form", "gravityforms_preview_forms" ) ) ) {
385 385
 			$preview_url = site_url( sprintf( '?gf_page=preview&amp;id=%d', $form_id ) );
386
-			$links[] = '<span>'.gravityview_get_link( $preview_url, __('Preview Form', 'gravityview'), 'title='.__('Preview this form', 'gravityview') ).'</span>';
386
+			$links[ ] = '<span>' . gravityview_get_link( $preview_url, __( 'Preview Form', 'gravityview' ), 'title=' . __( 'Preview this form', 'gravityview' ) ) . '</span>';
387 387
 		}
388 388
 
389 389
 		$output = '';
390 390
 
391
-		if( !empty( $include_form_link ) ) {
391
+		if ( ! empty( $include_form_link ) ) {
392 392
 			$output .= $form_link;
393 393
 		}
394 394
 
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
 		 */
401 401
 		$links = apply_filters( 'gravityview_connected_form_links', $links, $form );
402 402
 
403
-		$output .= '<div class="row-actions">'. implode( ' | ', $links ) .'</div>';
403
+		$output .= '<div class="row-actions">' . implode( ' | ', $links ) . '</div>';
404 404
 
405 405
 		return $output;
406 406
 	}
@@ -414,8 +414,8 @@  discard block
 block discarded – undo
414 414
 		// Get the date column and save it for later to add back in.
415 415
 		// This adds it after the Data Source column.
416 416
 		// This way, we don't need to do array_slice, array_merge, etc.
417
-		$date = $columns['date'];
418
-		unset( $columns['date'] );
417
+		$date = $columns[ 'date' ];
418
+		unset( $columns[ 'date' ] );
419 419
 
420 420
 		$data_source_required_caps = array(
421 421
 			'gravityforms_edit_forms',
@@ -426,14 +426,14 @@  discard block
 block discarded – undo
426 426
 			'gravityforms_preview_forms',
427 427
 		);
428 428
 
429
-		if( GVCommon::has_cap( $data_source_required_caps ) ) {
430
-			$columns['gv_connected_form'] = __( 'Data Source', 'gravityview' );
429
+		if ( GVCommon::has_cap( $data_source_required_caps ) ) {
430
+			$columns[ 'gv_connected_form' ] = __( 'Data Source', 'gravityview' );
431 431
 		}
432 432
 
433
-		$columns['gv_template'] = _x( 'Template', 'Column title that shows what template is being used for Views', 'gravityview' );
433
+		$columns[ 'gv_template' ] = _x( 'Template', 'Column title that shows what template is being used for Views', 'gravityview' );
434 434
 
435 435
 		// Add the date back in.
436
-		$columns['date'] = $date;
436
+		$columns[ 'date' ] = $date;
437 437
 
438 438
 		return $columns;
439 439
 	}
@@ -447,12 +447,12 @@  discard block
 block discarded – undo
447 447
 	 */
448 448
 	function save_postdata( $post_id ) {
449 449
 
450
-		if( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ){
450
+		if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
451 451
 			return;
452 452
 		}
453 453
 
454 454
 		// validate post_type
455
-		if ( ! isset( $_POST['post_type'] ) || 'gravityview' != $_POST['post_type'] ) {
455
+		if ( ! isset( $_POST[ 'post_type' ] ) || 'gravityview' != $_POST[ 'post_type' ] ) {
456 456
 			return;
457 457
 		}
458 458
 
@@ -467,63 +467,63 @@  discard block
 block discarded – undo
467 467
 		$statii = array();
468 468
 
469 469
 		// check if this is a start fresh View
470
-		if ( isset( $_POST['gravityview_select_form_nonce'] ) && wp_verify_nonce( $_POST['gravityview_select_form_nonce'], 'gravityview_select_form' ) ) {
470
+		if ( isset( $_POST[ 'gravityview_select_form_nonce' ] ) && wp_verify_nonce( $_POST[ 'gravityview_select_form_nonce' ], 'gravityview_select_form' ) ) {
471 471
 
472
-			$form_id = !empty( $_POST['gravityview_form_id'] ) ? $_POST['gravityview_form_id'] : '';
472
+			$form_id = ! empty( $_POST[ 'gravityview_form_id' ] ) ? $_POST[ 'gravityview_form_id' ] : '';
473 473
 			// save form id
474
-			$statii['form_id'] = update_post_meta( $post_id, '_gravityview_form_id', $form_id );
474
+			$statii[ 'form_id' ] = update_post_meta( $post_id, '_gravityview_form_id', $form_id );
475 475
 
476 476
 		}
477 477
 
478
-		if( false === GVCommon::has_cap( 'gravityforms_create_form' ) && empty( $statii['form_id'] ) ) {
478
+		if ( false === GVCommon::has_cap( 'gravityforms_create_form' ) && empty( $statii[ 'form_id' ] ) ) {
479 479
 			do_action( 'gravityview_log_error', __METHOD__ . ' - Current user does not have the capability to create a new Form.', wp_get_current_user() );
480 480
 			return;
481 481
 		}
482 482
 
483 483
 		// Was this a start fresh?
484
-		if ( ! empty( $_POST['gravityview_form_id_start_fresh'] ) ) {
485
-			$statii['start_fresh'] = add_post_meta( $post_id, '_gravityview_start_fresh', 1 );
484
+		if ( ! empty( $_POST[ 'gravityview_form_id_start_fresh' ] ) ) {
485
+			$statii[ 'start_fresh' ] = add_post_meta( $post_id, '_gravityview_start_fresh', 1 );
486 486
 		} else {
487
-			$statii['start_fresh'] = delete_post_meta( $post_id, '_gravityview_start_fresh' );
487
+			$statii[ 'start_fresh' ] = delete_post_meta( $post_id, '_gravityview_start_fresh' );
488 488
 		}
489 489
 
490 490
 		// Check if we have a template id
491
-		if ( isset( $_POST['gravityview_select_template_nonce'] ) && wp_verify_nonce( $_POST['gravityview_select_template_nonce'], 'gravityview_select_template' ) ) {
491
+		if ( isset( $_POST[ 'gravityview_select_template_nonce' ] ) && wp_verify_nonce( $_POST[ 'gravityview_select_template_nonce' ], 'gravityview_select_template' ) ) {
492 492
 
493
-			$template_id = !empty( $_POST['gravityview_directory_template'] ) ? $_POST['gravityview_directory_template'] : '';
493
+			$template_id = ! empty( $_POST[ 'gravityview_directory_template' ] ) ? $_POST[ 'gravityview_directory_template' ] : '';
494 494
 
495 495
 			// now save template id
496
-			$statii['directory_template'] = update_post_meta( $post_id, '_gravityview_directory_template', $template_id );
496
+			$statii[ 'directory_template' ] = update_post_meta( $post_id, '_gravityview_directory_template', $template_id );
497 497
 		}
498 498
 
499 499
 
500 500
 		// save View Configuration metabox
501
-		if ( isset( $_POST['gravityview_view_configuration_nonce'] ) && wp_verify_nonce( $_POST['gravityview_view_configuration_nonce'], 'gravityview_view_configuration' ) ) {
501
+		if ( isset( $_POST[ 'gravityview_view_configuration_nonce' ] ) && wp_verify_nonce( $_POST[ 'gravityview_view_configuration_nonce' ], 'gravityview_view_configuration' ) ) {
502 502
 
503 503
 			// template settings
504
-			if( empty( $_POST['template_settings'] ) ) {
505
-				$_POST['template_settings'] = array();
504
+			if ( empty( $_POST[ 'template_settings' ] ) ) {
505
+				$_POST[ 'template_settings' ] = array();
506 506
 			}
507
-			$statii['template_settings'] = update_post_meta( $post_id, '_gravityview_template_settings', $_POST['template_settings'] );
507
+			$statii[ 'template_settings' ] = update_post_meta( $post_id, '_gravityview_template_settings', $_POST[ 'template_settings' ] );
508 508
 
509 509
 			$fields = array();
510 510
 
511 511
 			// Directory&single Visible Fields
512
-			if( !empty( $preset_fields ) ) {
512
+			if ( ! empty( $preset_fields ) ) {
513 513
 
514 514
 				$fields = $preset_fields;
515 515
 
516
-			} elseif( !empty( $_POST['gv_fields'] ) ) {
516
+			} elseif ( ! empty( $_POST[ 'gv_fields' ] ) ) {
517 517
 				$fields = _gravityview_process_posted_fields();
518 518
 			}
519 519
 
520
-			$statii['directory_fields'] = update_post_meta( $post_id, '_gravityview_directory_fields', $fields );
520
+			$statii[ 'directory_fields' ] = update_post_meta( $post_id, '_gravityview_directory_fields', $fields );
521 521
 
522 522
 			// Directory Visible Widgets
523
-			if( empty( $_POST['widgets'] ) ) {
524
-				$_POST['widgets'] = array();
523
+			if ( empty( $_POST[ 'widgets' ] ) ) {
524
+				$_POST[ 'widgets' ] = array();
525 525
 			}
526
-			$statii['directory_widgets'] = gravityview_set_directory_widgets( $post_id, $_POST['widgets'] );
526
+			$statii[ 'directory_widgets' ] = gravityview_set_directory_widgets( $post_id, $_POST[ 'widgets' ] );
527 527
 
528 528
 		} // end save view configuration
529 529
 
@@ -533,9 +533,9 @@  discard block
 block discarded – undo
533 533
 		 * @param array $statii Array of statuses of the post meta saving processes. If saving worked, each key should be mapped to a value of the post ID (`directory_widgets` => `124`). If failed (or didn't change), the value will be false.
534 534
 		 * @since 1.17.2
535 535
 		 */
536
-		do_action('gravityview_view_saved', $post_id, $statii );
536
+		do_action( 'gravityview_view_saved', $post_id, $statii );
537 537
 
538
-		do_action('gravityview_log_debug', '[save_postdata] Update Post Meta Statuses (also returns false if nothing changed)', array_map( 'intval', $statii ) );
538
+		do_action( 'gravityview_log_debug', '[save_postdata] Update Post Meta Statuses (also returns false if nothing changed)', array_map( 'intval', $statii ) );
539 539
 	}
540 540
 
541 541
 	/**
@@ -570,20 +570,20 @@  discard block
 block discarded – undo
570 570
 
571 571
 		$output = '';
572 572
 
573
-		if( !empty( $fields ) ) {
573
+		if ( ! empty( $fields ) ) {
574 574
 
575
-			foreach( $fields as $id => $details ) {
575
+			foreach ( $fields as $id => $details ) {
576 576
 
577
-				if( in_array( $details['type'], $blacklist_field_types ) ) {
577
+				if ( in_array( $details[ 'type' ], $blacklist_field_types ) ) {
578 578
 					continue;
579 579
 				}
580 580
 
581 581
 				// Edit mode only allows editing the parent fields, not single inputs.
582
-				if( $context === 'edit' && !empty( $details['parent'] ) ) {
582
+				if ( $context === 'edit' && ! empty( $details[ 'parent' ] ) ) {
583 583
 					continue;
584 584
 				}
585 585
 
586
-				$output .= new GravityView_Admin_View_Field( $details['label'], $id, $details );
586
+				$output .= new GravityView_Admin_View_Field( $details[ 'label' ], $id, $details );
587 587
 
588 588
 			} // End foreach
589 589
 		}
@@ -591,7 +591,7 @@  discard block
 block discarded – undo
591 591
 		echo $output;
592 592
 
593 593
 		// For the EDIT view we only want to allow the form fields.
594
-		if( $context === 'edit' ) {
594
+		if ( $context === 'edit' ) {
595 595
 			return;
596 596
 		}
597 597
 
@@ -615,16 +615,16 @@  discard block
 block discarded – undo
615 615
 		$additional_fields = apply_filters( 'gravityview_additional_fields', array(
616 616
 			array(
617 617
 				'label_text' => __( '+ Add All Fields', 'gravityview' ),
618
-				'desc' => __('Add all the available fields at once.', 'gravityview'),
618
+				'desc' => __( 'Add all the available fields at once.', 'gravityview' ),
619 619
 				'field_id' => 'all-fields',
620 620
 				'label_type' => 'field',
621 621
 				'input_type' => NULL,
622 622
 				'field_options' => NULL,
623 623
 				'settings_html'	=> NULL,
624 624
 			)
625
-		));
625
+		) );
626 626
 
627
-		if( !empty( $additional_fields )) {
627
+		if ( ! empty( $additional_fields ) ) {
628 628
 			foreach ( (array)$additional_fields as $item ) {
629 629
 
630 630
 				// Prevent items from not having index set
@@ -635,16 +635,16 @@  discard block
 block discarded – undo
635 635
 					'input_type' => NULL,
636 636
 					'field_options' => NULL,
637 637
 					'settings_html'	=> NULL,
638
-				));
638
+				) );
639 639
 
640 640
 				// Backward compat.
641
-				if( !empty( $item['field_options'] ) ) {
641
+				if ( ! empty( $item[ 'field_options' ] ) ) {
642 642
 					// Use settings_html from now on.
643
-					$item['settings_html'] = $item['field_options'];
643
+					$item[ 'settings_html' ] = $item[ 'field_options' ];
644 644
 				}
645 645
 
646 646
 				// Render a label for each of them
647
-				echo new GravityView_Admin_View_Field( $item['label_text'], $item['field_id'], $item );
647
+				echo new GravityView_Admin_View_Field( $item[ 'label_text' ], $item[ 'field_id' ], $item );
648 648
 
649 649
 			}
650 650
 		}
@@ -657,63 +657,63 @@  discard block
 block discarded – undo
657 657
 	 * @param  string $zone   Either 'single', 'directory', 'header', 'footer'
658 658
 	 * @return array
659 659
 	 */
660
-	function get_entry_default_fields($form, $zone) {
660
+	function get_entry_default_fields( $form, $zone ) {
661 661
 
662 662
 		$entry_default_fields = array();
663 663
 
664
-		if( in_array( $zone, array( 'directory', 'single' ) ) ) {
664
+		if ( in_array( $zone, array( 'directory', 'single' ) ) ) {
665 665
 
666 666
 			$entry_default_fields = array(
667 667
 				'id' => array(
668
-					'label' => __('Entry ID', 'gravityview'),
668
+					'label' => __( 'Entry ID', 'gravityview' ),
669 669
 					'type' => 'id',
670
-					'desc'	=> __('The unique ID of the entry.', 'gravityview'),
670
+					'desc'	=> __( 'The unique ID of the entry.', 'gravityview' ),
671 671
 				),
672 672
 				'date_created' => array(
673
-					'label' => __('Entry Date', 'gravityview'),
674
-					'desc'	=> __('The date the entry was created.', 'gravityview'),
673
+					'label' => __( 'Entry Date', 'gravityview' ),
674
+					'desc'	=> __( 'The date the entry was created.', 'gravityview' ),
675 675
 					'type' => 'date_created',
676 676
 				),
677 677
 				'source_url' => array(
678
-					'label' => __('Source URL', 'gravityview'),
678
+					'label' => __( 'Source URL', 'gravityview' ),
679 679
 					'type' => 'source_url',
680
-					'desc'	=> __('The URL of the page where the form was submitted.', 'gravityview'),
680
+					'desc'	=> __( 'The URL of the page where the form was submitted.', 'gravityview' ),
681 681
 				),
682 682
 				'ip' => array(
683
-					'label' => __('User IP', 'gravityview'),
683
+					'label' => __( 'User IP', 'gravityview' ),
684 684
 					'type' => 'ip',
685
-					'desc'	=> __('The IP Address of the user who created the entry.', 'gravityview'),
685
+					'desc'	=> __( 'The IP Address of the user who created the entry.', 'gravityview' ),
686 686
 				),
687 687
 				'created_by' => array(
688
-					'label' => __('User', 'gravityview'),
688
+					'label' => __( 'User', 'gravityview' ),
689 689
 					'type' => 'created_by',
690
-					'desc'	=> __('Details of the logged-in user who created the entry (if any).', 'gravityview'),
690
+					'desc'	=> __( 'Details of the logged-in user who created the entry (if any).', 'gravityview' ),
691 691
 				),
692 692
 
693 693
 				/**
694 694
 				 * @since  1.2
695 695
 				 */
696 696
 				'custom'	=> array(
697
-					'label'	=> __('Custom Content', 'gravityview'),
697
+					'label'	=> __( 'Custom Content', 'gravityview' ),
698 698
 					'type'	=> 'custom',
699
-					'desc'	=> __('Insert custom text or HTML.', 'gravityview'),
699
+					'desc'	=> __( 'Insert custom text or HTML.', 'gravityview' ),
700 700
 				),
701 701
 
702 702
 				/**
703 703
 				 * @since 1.7.2
704 704
 				 */
705 705
 			    'other_entries' => array(
706
-				    'label'	=> __('Other Entries', 'gravityview'),
706
+				    'label'	=> __( 'Other Entries', 'gravityview' ),
707 707
 				    'type'	=> 'other_entries',
708
-				    'desc'	=> __('Display other entries created by the entry creator.', 'gravityview'),
708
+				    'desc'	=> __( 'Display other entries created by the entry creator.', 'gravityview' ),
709 709
 			    ),
710 710
 	        );
711 711
 
712
-			if( 'single' !== $zone) {
712
+			if ( 'single' !== $zone ) {
713 713
 
714
-				$entry_default_fields['entry_link'] = array(
715
-					'label' => __('Link to Entry', 'gravityview'),
716
-					'desc'	=> __('A dedicated link to the single entry with customizable text.', 'gravityview'),
714
+				$entry_default_fields[ 'entry_link' ] = array(
715
+					'label' => __( 'Link to Entry', 'gravityview' ),
716
+					'desc'	=> __( 'A dedicated link to the single entry with customizable text.', 'gravityview' ),
717 717
 					'type' => 'entry_link',
718 718
 				);
719 719
 			}
@@ -727,7 +727,7 @@  discard block
 block discarded – undo
727 727
 		 * @param  string|array $form form_ID or form object
728 728
 		 * @param  string $zone   Either 'single', 'directory', 'header', 'footer'
729 729
 		 */
730
-		return apply_filters( 'gravityview_entry_default_fields', $entry_default_fields, $form, $zone);
730
+		return apply_filters( 'gravityview_entry_default_fields', $entry_default_fields, $form, $zone );
731 731
 	}
732 732
 
733 733
 	/**
@@ -738,7 +738,7 @@  discard block
 block discarded – undo
738 738
 	 */
739 739
 	function get_available_fields( $form = '', $zone = NULL ) {
740 740
 
741
-		if( empty( $form ) ) {
741
+		if ( empty( $form ) ) {
742 742
 			do_action( 'gravityview_log_error', '[get_available_fields] $form is empty' );
743 743
 			return array();
744 744
 		}
@@ -747,7 +747,7 @@  discard block
 block discarded – undo
747 747
 		$fields = gravityview_get_form_fields( $form, true );
748 748
 
749 749
 		// get meta fields ( only if form was already created )
750
-		if( !is_array( $form ) ) {
750
+		if ( ! is_array( $form ) ) {
751 751
 			$meta_fields = gravityview_get_entry_meta( $form );
752 752
 		} else {
753 753
 			$meta_fields = array();
@@ -771,11 +771,11 @@  discard block
 block discarded – undo
771 771
 
772 772
 		$widgets = $this->get_registered_widgets();
773 773
 
774
-		if( !empty( $widgets ) ) {
774
+		if ( ! empty( $widgets ) ) {
775 775
 
776
-			foreach( $widgets as $id => $details ) {
776
+			foreach ( $widgets as $id => $details ) {
777 777
 
778
-				echo new GravityView_Admin_View_Widget( $details['label'], $id, $details );
778
+				echo new GravityView_Admin_View_Widget( $details[ 'label' ], $id, $details );
779 779
 
780 780
 			}
781 781
 		}
@@ -809,7 +809,7 @@  discard block
 block discarded – undo
809 809
 	function render_active_areas( $template_id, $type, $zone, $rows, $values ) {
810 810
 		global $post;
811 811
 
812
-		if( $type === 'widget' ) {
812
+		if ( $type === 'widget' ) {
813 813
 			$button_label = __( 'Add Widget', 'gravityview' );
814 814
 		} else {
815 815
 			$button_label = __( 'Add Field', 'gravityview' );
@@ -818,15 +818,15 @@  discard block
 block discarded – undo
818 818
 		$available_items = array();
819 819
 
820 820
 		// if saved values, get available fields to label everyone
821
-		if( !empty( $values ) && ( !empty( $post->ID ) || !empty( $_POST['template_id'] ) ) ) {
821
+		if ( ! empty( $values ) && ( ! empty( $post->ID ) || ! empty( $_POST[ 'template_id' ] ) ) ) {
822 822
 
823
-			if( !empty( $_POST['template_id'] ) ) {
824
-				$form = GravityView_Ajax::pre_get_form_fields( $_POST['template_id'] );
823
+			if ( ! empty( $_POST[ 'template_id' ] ) ) {
824
+				$form = GravityView_Ajax::pre_get_form_fields( $_POST[ 'template_id' ] );
825 825
 			} else {
826 826
 				$form = gravityview_get_form_id( $post->ID );
827 827
 			}
828 828
 
829
-			if( 'field' === $type ) {
829
+			if ( 'field' === $type ) {
830 830
 				$available_items = $this->get_available_fields( $form, $zone );
831 831
 			} else {
832 832
 				$available_items = $this->get_registered_widgets();
@@ -834,39 +834,39 @@  discard block
 block discarded – undo
834 834
 
835 835
 		}
836 836
 
837
-		foreach( $rows as $row ) :
838
-			foreach( $row as $col => $areas ) :
839
-				$column = ($col == '2-2') ? '1-2' : $col; ?>
837
+		foreach ( $rows as $row ) :
838
+			foreach ( $row as $col => $areas ) :
839
+				$column = ( $col == '2-2' ) ? '1-2' : $col; ?>
840 840
 
841 841
 				<div class="gv-grid-col-<?php echo esc_attr( $column ); ?>">
842 842
 
843
-					<?php foreach( $areas as $area ) : 	?>
843
+					<?php foreach ( $areas as $area ) : 	?>
844 844
 
845 845
 						<div class="gv-droppable-area">
846
-							<div class="active-drop active-drop-<?php echo esc_attr( $type ); ?>" data-areaid="<?php echo esc_attr( $zone .'_'. $area['areaid'] ); ?>">
846
+							<div class="active-drop active-drop-<?php echo esc_attr( $type ); ?>" data-areaid="<?php echo esc_attr( $zone . '_' . $area[ 'areaid' ] ); ?>">
847 847
 
848 848
 								<?php // render saved fields
849 849
 
850
-								if( !empty( $values[ $zone .'_'. $area['areaid'] ] ) ) {
850
+								if ( ! empty( $values[ $zone . '_' . $area[ 'areaid' ] ] ) ) {
851 851
 
852
-									foreach( $values[ $zone .'_'. $area['areaid'] ] as $uniqid => $field ) {
852
+									foreach ( $values[ $zone . '_' . $area[ 'areaid' ] ] as $uniqid => $field ) {
853 853
 
854 854
 										$input_type = NULL;
855
-										$original_item = isset( $available_items[ $field['id'] ] ) ? $available_items[ $field['id'] ] : false ;
855
+										$original_item = isset( $available_items[ $field[ 'id' ] ] ) ? $available_items[ $field[ 'id' ] ] : false;
856 856
 
857
-										if( !$original_item ) {
857
+										if ( ! $original_item ) {
858 858
 
859
-											do_action('gravityview_log_error', 'An item was not available when rendering the output; maybe it was added by a plugin that is now de-activated.', array('available_items' => $available_items, 'field' => $field ));
859
+											do_action( 'gravityview_log_error', 'An item was not available when rendering the output; maybe it was added by a plugin that is now de-activated.', array( 'available_items' => $available_items, 'field' => $field ) );
860 860
 
861 861
 											$original_item = $field;
862 862
 										} else {
863 863
 
864
-											$input_type = isset( $original_item['type'] ) ? $original_item['type'] : NULL;
864
+											$input_type = isset( $original_item[ 'type' ] ) ? $original_item[ 'type' ] : NULL;
865 865
 
866 866
 										}
867 867
 
868 868
 										// Field options dialog box
869
-										$field_options = GravityView_Render_Settings::render_field_options( $type, $template_id, $field['id'], $original_item['label'], $zone .'_'. $area['areaid'], $input_type, $uniqid, $field, $zone, $original_item );
869
+										$field_options = GravityView_Render_Settings::render_field_options( $type, $template_id, $field[ 'id' ], $original_item[ 'label' ], $zone . '_' . $area[ 'areaid' ], $input_type, $uniqid, $field, $zone, $original_item );
870 870
 
871 871
 										$item = array(
872 872
 											'input_type' => $input_type,
@@ -875,16 +875,16 @@  discard block
 block discarded – undo
875 875
 										);
876 876
 
877 877
 										// Merge the values with the current item to pass things like widget descriptions and original field names
878
-										if( $original_item ) {
878
+										if ( $original_item ) {
879 879
 											$item = wp_parse_args( $item, $original_item );
880 880
 										}
881 881
 
882
-										switch( $type ) {
882
+										switch ( $type ) {
883 883
 											case 'widget':
884
-												echo new GravityView_Admin_View_Widget( $item['label'], $field['id'], $item, $field );
884
+												echo new GravityView_Admin_View_Widget( $item[ 'label' ], $field[ 'id' ], $item, $field );
885 885
 												break;
886 886
 											default:
887
-												echo new GravityView_Admin_View_Field( $item['label'], $field['id'], $item, $field );
887
+												echo new GravityView_Admin_View_Field( $item[ 'label' ], $field[ 'id' ], $item, $field );
888 888
 										}
889 889
 
890 890
 
@@ -894,11 +894,11 @@  discard block
 block discarded – undo
894 894
 
895 895
 								} // End if zone is not empty ?>
896 896
 
897
-								<span class="drop-message"><?php echo sprintf(esc_attr__('"+ %s" or drag existing %ss here.', 'gravityview'), $button_label, $type ); ?></span>
897
+								<span class="drop-message"><?php echo sprintf( esc_attr__( '"+ %s" or drag existing %ss here.', 'gravityview' ), $button_label, $type ); ?></span>
898 898
 							</div>
899 899
 							<div class="gv-droppable-area-action">
900
-								<a href="#" class="gv-add-field button-secondary" title="" data-objecttype="<?php echo esc_attr( $type ); ?>" data-areaid="<?php echo esc_attr( $zone .'_'. $area['areaid'] ); ?>" data-context="<?php echo esc_attr( $zone ); ?>"><?php echo '+ '.esc_html( $button_label ); ?></a>
901
-								<p class="gv-droppable-area-title"><strong><?php echo esc_html( $area['title'] ); ?></strong><?php if( !empty( $area['subtitle'] ) ) { ?><span class="gv-droppable-area-subtitle"> &ndash; <?php echo esc_html( $area['subtitle'] ); ?></span><?php } ?></p>
900
+								<a href="#" class="gv-add-field button-secondary" title="" data-objecttype="<?php echo esc_attr( $type ); ?>" data-areaid="<?php echo esc_attr( $zone . '_' . $area[ 'areaid' ] ); ?>" data-context="<?php echo esc_attr( $zone ); ?>"><?php echo '+ ' . esc_html( $button_label ); ?></a>
901
+								<p class="gv-droppable-area-title"><strong><?php echo esc_html( $area[ 'title' ] ); ?></strong><?php if ( ! empty( $area[ 'subtitle' ] ) ) { ?><span class="gv-droppable-area-subtitle"> &ndash; <?php echo esc_html( $area[ 'subtitle' ] ); ?></span><?php } ?></p>
902 902
 							</div>
903 903
 						</div>
904 904
 
@@ -920,7 +920,7 @@  discard block
 block discarded – undo
920 920
 		$default_widget_areas = GravityView_Plugin::get_default_widget_areas();
921 921
 
922 922
 		$widgets = array();
923
-		if( !empty( $post_id ) ) {
923
+		if ( ! empty( $post_id ) ) {
924 924
 			$widgets = gravityview_get_directory_widgets( $post_id );
925 925
 		}
926 926
 
@@ -950,7 +950,7 @@  discard block
 block discarded – undo
950 950
 	 */
951 951
 	function render_directory_active_areas( $template_id = '', $context = 'single', $post_id = '', $echo = false ) {
952 952
 
953
-		if( empty( $template_id ) ) {
953
+		if ( empty( $template_id ) ) {
954 954
 			do_action( 'gravityview_log_debug', '[render_directory_active_areas] $template_id is empty' );
955 955
 			return '';
956 956
 		}
@@ -964,12 +964,12 @@  discard block
 block discarded – undo
964 964
 		 */
965 965
 		$template_areas = apply_filters( 'gravityview_template_active_areas', array(), $template_id, $context );
966 966
 
967
-		if( empty( $template_areas ) ) {
967
+		if ( empty( $template_areas ) ) {
968 968
 
969 969
 			do_action( 'gravityview_log_debug', '[render_directory_active_areas] No areas defined. Maybe template %s is disabled.', $template_id );
970 970
 			$output = '<div>';
971
-			$output .= '<h2 class="description" style="font-size: 16px; margin:0">'. sprintf( esc_html__( 'This View is configured using the %s View type, which is disabled.', 'gravityview' ), '<em>'.$template_id.'</em>' ) .'</h2>';
972
-			$output .= '<p class="description" style="font-size: 14px; margin:0 0 1em 0;padding:0">'.esc_html__('The data is not lost; re-activate the associated plugin and the configuration will re-appear.', 'gravityview').'</p>';
971
+			$output .= '<h2 class="description" style="font-size: 16px; margin:0">' . sprintf( esc_html__( 'This View is configured using the %s View type, which is disabled.', 'gravityview' ), '<em>' . $template_id . '</em>' ) . '</h2>';
972
+			$output .= '<p class="description" style="font-size: 14px; margin:0 0 1em 0;padding:0">' . esc_html__( 'The data is not lost; re-activate the associated plugin and the configuration will re-appear.', 'gravityview' ) . '</p>';
973 973
 			$output .= '</div>';
974 974
 		} else {
975 975
 
@@ -984,7 +984,7 @@  discard block
 block discarded – undo
984 984
 
985 985
 		}
986 986
 
987
-		if( $echo ) {
987
+		if ( $echo ) {
988 988
 			echo $output;
989 989
 		}
990 990
 
@@ -1004,27 +1004,27 @@  discard block
 block discarded – undo
1004 1004
 		$is_widgets_page = ( $pagenow === 'widgets.php' );
1005 1005
 
1006 1006
 		// Add the GV font (with the Astronaut)
1007
-		wp_enqueue_style( 'gravityview_global', plugins_url('assets/css/admin-global.css', GRAVITYVIEW_FILE), array(), GravityView_Plugin::version );
1007
+		wp_enqueue_style( 'gravityview_global', plugins_url( 'assets/css/admin-global.css', GRAVITYVIEW_FILE ), array(), GravityView_Plugin::version );
1008 1008
 
1009
-		wp_register_script( 'gravityview-jquery-cookie', plugins_url('assets/lib/jquery.cookie/jquery.cookie.min.js', GRAVITYVIEW_FILE), array( 'jquery' ), GravityView_Plugin::version, true );
1009
+		wp_register_script( 'gravityview-jquery-cookie', plugins_url( 'assets/lib/jquery.cookie/jquery.cookie.min.js', GRAVITYVIEW_FILE ), array( 'jquery' ), GravityView_Plugin::version, true );
1010 1010
 
1011 1011
 		// Don't process any scripts below here if it's not a GravityView page.
1012
-		if( !gravityview_is_admin_page($hook) && !$is_widgets_page ) { return; }
1012
+		if ( ! gravityview_is_admin_page( $hook ) && ! $is_widgets_page ) { return; }
1013 1013
 
1014 1014
 		// Only enqueue the following on single pages
1015
-		if( gravityview_is_admin_page($hook, 'single') || $is_widgets_page ) {
1015
+		if ( gravityview_is_admin_page( $hook, 'single' ) || $is_widgets_page ) {
1016 1016
 
1017 1017
 			wp_enqueue_script( 'jquery-ui-datepicker' );
1018
-			wp_enqueue_style( 'gravityview_views_datepicker', plugins_url('assets/css/admin-datepicker.css', GRAVITYVIEW_FILE), GravityView_Plugin::version );
1018
+			wp_enqueue_style( 'gravityview_views_datepicker', plugins_url( 'assets/css/admin-datepicker.css', GRAVITYVIEW_FILE ), GravityView_Plugin::version );
1019 1019
 
1020
-			$script_debug = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';
1020
+			$script_debug = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
1021 1021
 
1022 1022
 			//enqueue scripts
1023 1023
 			wp_enqueue_script( 'gravityview_views_scripts', plugins_url( 'assets/js/admin-views' . $script_debug . '.js', GRAVITYVIEW_FILE ), array( 'jquery-ui-tabs', 'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-sortable', 'jquery-ui-tooltip', 'jquery-ui-dialog', 'gravityview-jquery-cookie', 'jquery-ui-datepicker', 'underscore' ), GravityView_Plugin::version );
1024 1024
 
1025
-			wp_localize_script('gravityview_views_scripts', 'gvGlobals', array(
1025
+			wp_localize_script( 'gravityview_views_scripts', 'gvGlobals', array(
1026 1026
 				'cookiepath' => COOKIEPATH,
1027
-                'passed_form_id' => (bool) rgget( 'form_id' ),
1027
+                'passed_form_id' => (bool)rgget( 'form_id' ),
1028 1028
 				'nonce' => wp_create_nonce( 'gravityview_ajaxviews' ),
1029 1029
 				'label_viewname' => __( 'Enter View name here', 'gravityview' ),
1030 1030
 				'label_close' => __( 'Close', 'gravityview' ),
@@ -1036,9 +1036,9 @@  discard block
 block discarded – undo
1036 1036
 				'loading_error' => esc_html__( 'There was an error loading dynamic content.', 'gravityview' ),
1037 1037
 				'field_loaderror' => __( 'Error while adding the field. Please try again or contact GravityView support.', 'gravityview' ),
1038 1038
 				'remove_all_fields' => __( 'Would you like to remove all fields in this zone? (You are seeing this message because you were holding down the ALT key)', 'gravityview' ),
1039
-			));
1039
+			) );
1040 1040
 
1041
-			wp_enqueue_style( 'gravityview_views_styles', plugins_url( 'assets/css/admin-views.css', GRAVITYVIEW_FILE ), array('dashicons', 'wp-jquery-ui-dialog' ), GravityView_Plugin::version );
1041
+			wp_enqueue_style( 'gravityview_views_styles', plugins_url( 'assets/css/admin-views.css', GRAVITYVIEW_FILE ), array( 'dashicons', 'wp-jquery-ui-dialog' ), GravityView_Plugin::version );
1042 1042
 
1043 1043
 			self::enqueue_gravity_forms_scripts();
1044 1044
 
@@ -1057,10 +1057,10 @@  discard block
 block discarded – undo
1057 1057
 		);
1058 1058
 
1059 1059
 		if ( wp_is_mobile() ) {
1060
-		    $scripts[] = 'jquery-touch-punch';
1060
+		    $scripts[ ] = 'jquery-touch-punch';
1061 1061
 		}
1062 1062
 
1063
-		foreach ($scripts as $script) {
1063
+		foreach ( $scripts as $script ) {
1064 1064
 			wp_enqueue_script( $script );
1065 1065
 		}
1066 1066
 	}
Please login to merge, or discard this patch.