Completed
Pull Request — develop (#1523)
by Zack
19:41
created
includes/class-gravityview-change-entry-creator.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -97,11 +97,11 @@  discard block
 block discarded – undo
97 97
 			)
98 98
 		);
99 99
 
100
-		if ( ! wp_verify_nonce( $post_var['gv_nonce'], 'gv_entry_creator' ) ) {
100
+		if ( ! wp_verify_nonce( $post_var[ 'gv_nonce' ], 'gv_entry_creator' ) ) {
101 101
 			die();
102 102
 		}
103 103
 
104
-		$search_string = $post_var['q'];
104
+		$search_string = $post_var[ 'q' ];
105 105
 
106 106
 		if ( is_numeric( $search_string ) ) {
107 107
 			$user_args = array(
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 		}
149 149
 
150 150
 		// Update the entry. The `false` prevents checking Akismet; `true` disables the user updated hook from firing
151
-		$result = RGFormsModel::update_entry_property( (int) $entry['id'], 'created_by', (int) $user_id, false, true );
151
+		$result = RGFormsModel::update_entry_property( (int)$entry[ 'id' ], 'created_by', (int)$user_id, false, true );
152 152
 
153 153
 		if ( false === $result ) {
154 154
 			$status = __( 'Error', 'gravityview' );
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 			return;
171 171
 		}
172 172
 
173
-		GravityView_Entry_Notes::add_note( $entry['id'], - 1, 'GravityView', $note, 'gravityview' );
173
+		GravityView_Entry_Notes::add_note( $entry[ 'id' ], - 1, 'GravityView', $note, 'gravityview' );
174 174
 
175 175
 	}
176 176
 
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 		}
206 206
 
207 207
 		// If screen mode isn't set, then we're in the wrong place.
208
-		if ( empty( $_REQUEST['screen_mode'] ) ) {
208
+		if ( empty( $_REQUEST[ 'screen_mode' ] ) ) {
209 209
 			return;
210 210
 		}
211 211
 
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
 
232 232
 		// If $_GET['screen_mode'] is set to edit, set $_POST value
233 233
 		if ( \GV\Utils::_GET( 'screen_mode' ) === 'edit' ) {
234
-			$_POST["screen_mode"] = 'edit';
234
+			$_POST[ "screen_mode" ] = 'edit';
235 235
 		}
236 236
 
237 237
 	}
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
 		$entry_creator_user_id = \GV\Utils::get( $entry, 'created_by' );
307 307
 
308 308
 		$entry_creator_user = GVCommon::get_users( 'change_entry_creator', array( 'include' => $entry_creator_user_id ) );
309
-		$entry_creator_user = isset( $entry_creator_user[0] ) ? $entry_creator_user[0] : array();
309
+		$entry_creator_user = isset( $entry_creator_user[ 0 ] ) ? $entry_creator_user[ 0 ] : array();
310 310
 
311 311
 		if ( empty( $entry_creator_user ) ) {
312 312
 			$output .= '<option value="0"> &mdash; ' . esc_attr_x( 'No User', 'No user assigned to the entry', 'gravityview' ) . ' &mdash; </option>';
@@ -324,16 +324,16 @@  discard block
 block discarded – undo
324 324
 		}
325 325
 
326 326
 		$user_count      = count_users();
327
-		$user_count      = $user_count['total_users'];
327
+		$user_count      = $user_count[ 'total_users' ];
328 328
 		$users_displayed = self::DEFAULT_NUMBER_OF_USERS + ( ! empty( $entry_creator_user ) ? 1 : 0 );
329 329
 		if ( $user_count > $users_displayed ) {
330 330
 			$message = esc_html_x( 'Use the input field above to search through the remaining %d users.', '%d is replaced by user count', 'gravityview' );
331 331
 			$message = sprintf( $message, $user_count - $users_displayed );
332
-			$output  .= '<option value="_user_count" disabled="disabled">' . $message . '</option>';
332
+			$output .= '<option value="_user_count" disabled="disabled">' . $message . '</option>';
333 333
 		}
334 334
 
335 335
 		$output .= '</select>';
336
-		$output .= '<input name="originally_created_by" value="' . esc_attr( $entry['created_by'] ) . '" type="hidden" />';
336
+		$output .= '<input name="originally_created_by" value="' . esc_attr( $entry[ 'created_by' ] ) . '" type="hidden" />';
337 337
 		$output .= wp_nonce_field( 'gv_entry_creator', 'gv_entry_creator_nonce', false, false );
338 338
 
339 339
 		echo $output;
Please login to merge, or discard this patch.