Completed
Push — develop ( 44670d...7da4f0 )
by
unknown
16:21
created
class-gravityview-plugin-hooks-gravityformspartialentries.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 
54 54
 		$partial_entries_addon = GF_Partial_Entries::get_instance();
55 55
 
56
-		$feed_settings = $partial_entries_addon->get_feed_settings( $form['id'] );
56
+		$feed_settings = $partial_entries_addon->get_feed_settings( $form[ 'id' ] );
57 57
 
58 58
 		$is_enabled = \GV\Utils::get( $feed_settings, 'enable', 0 );
59 59
 
@@ -70,14 +70,14 @@  discard block
 block discarded – undo
70 70
 		}
71 71
 
72 72
 		// Set the expected $_POST key for the Add-On to use
73
-		$_POST['partial_entry_id'] = $partial_entry_id;
73
+		$_POST[ 'partial_entry_id' ] = $partial_entry_id;
74 74
 
75 75
 		gravityview()->log->debug( 'Saving partial entry (ID #{partial_entry_id}) for Entry #{entry_id}', array(
76 76
 			'partial_entry_id' => $partial_entry_id,
77 77
 			'entry_id'         => $entry_id
78 78
 		) );
79 79
 
80
-		$partial_entries_addon->maybe_save_partial_entry( $form['id'] );
80
+		$partial_entries_addon->maybe_save_partial_entry( $form[ 'id' ] );
81 81
 	}
82 82
 }
83 83
 
Please login to merge, or discard this patch.
includes/admin/class-gravityview-admin-view-item.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -196,7 +196,7 @@
 block discarded – undo
196 196
 
197 197
 		$parent_label = '';
198 198
 
199
-        if ( ! empty( $this->item['parent'] ) ) {
199
+		if ( ! empty( $this->item['parent'] ) ) {
200 200
 			$parent_label = ' <small>(' . esc_attr( $this->item['parent']['label'] ) . ')</small>';
201 201
 		}
202 202
 
Please login to merge, or discard this patch.
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -44,12 +44,12 @@  discard block
 block discarded – undo
44 44
 	 */
45 45
 	protected $form_id;
46 46
 
47
-	function __construct( $title = '', $item_id = '', $item = array(), $settings = array(), $form_id = null) {
47
+	function __construct( $title = '', $item_id = '', $item = array(), $settings = array(), $form_id = null ) {
48 48
 
49 49
 		// Backward compat
50
-		if ( ! empty( $item['type'] ) ) {
51
-			$item['input_type'] = $item['type'];
52
-			unset( $item['type'] );
50
+		if ( ! empty( $item[ 'type' ] ) ) {
51
+			$item[ 'input_type' ] = $item[ 'type' ];
52
+			unset( $item[ 'type' ] );
53 53
 		}
54 54
 
55 55
 		if ( $admin_label = \GV\Utils::get( $settings, 'admin_label' ) ) {
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 		$this->id         = $item_id;
77 77
 		$this->form_id    = $form_id;
78 78
 		$this->settings   = $settings;
79
-		$this->label_type = $item['label_type'];
79
+		$this->label_type = $item[ 'label_type' ];
80 80
 	}
81 81
 
82 82
 	/**
@@ -120,14 +120,14 @@  discard block
 block discarded – undo
120 120
 
121 121
 			foreach ( $field_info_items as $item ) {
122 122
 
123
-				if( \GV\Utils::get( $item, 'hide_in_picker', false ) ) {
123
+				if ( \GV\Utils::get( $item, 'hide_in_picker', false ) ) {
124 124
 					continue;
125 125
 				}
126 126
 
127
-				$class = isset( $item['class'] ) ? sanitize_html_class( $item['class'] ) . ' description' : 'description';
127
+				$class = isset( $item[ 'class' ] ) ? sanitize_html_class( $item[ 'class' ] ) . ' description' : 'description';
128 128
 				// Add the title in case the value's long, in which case, it'll be truncated by CSS.
129 129
 				$output .= '<span class="' . $class . '">';
130
-				$output .= esc_html( $item['value'] );
130
+				$output .= esc_html( $item[ 'value' ] );
131 131
 				$output .= '</span>';
132 132
 			}
133 133
 
@@ -155,36 +155,36 @@  discard block
 block discarded – undo
155 155
 
156 156
 		// $settings_html will just be hidden inputs if empty. Otherwise, it'll have an <ul>. Ugly hack, I know.
157 157
 		// TODO: Un-hack this
158
-		$hide_settings_link_class = ( empty( $this->item['settings_html'] ) || strpos( $this->item['settings_html'], '<!-- No Options -->' ) > 0 ) ? 'hide-if-js' : '';
159
-		$settings_link      = sprintf( '<button class="gv-field-settings" title="%1$s" aria-label="%1$s"><span class="dashicons-admin-generic dashicons %2$s"></span></button>', esc_attr( $settings_title ), $hide_settings_link_class );
158
+		$hide_settings_link_class = ( empty( $this->item[ 'settings_html' ] ) || strpos( $this->item[ 'settings_html' ], '<!-- No Options -->' ) > 0 ) ? 'hide-if-js' : '';
159
+		$settings_link = sprintf( '<button class="gv-field-settings" title="%1$s" aria-label="%1$s"><span class="dashicons-admin-generic dashicons %2$s"></span></button>', esc_attr( $settings_title ), $hide_settings_link_class );
160 160
 
161 161
 		// Should we show the icon that the field is being used as a link to single entry?
162
-		$hide_show_as_link_class = empty( $this->settings['show_as_link'] ) ? 'hide-if-js' : '';
162
+		$hide_show_as_link_class = empty( $this->settings[ 'show_as_link' ] ) ? 'hide-if-js' : '';
163 163
 		$show_as_link            = '<span class="dashicons dashicons-admin-links ' . $hide_show_as_link_class . '" title="' . esc_attr( $single_link_title ) . '"></span>';
164 164
 
165 165
 		// When a field label is empty, use the Field ID
166 166
 		$label = empty( $this->title ) ? sprintf( _x( 'Field #%s (No Label)', 'Label in field picker for empty label', 'gravityview' ), $this->id ) : $this->title;
167 167
 
168 168
 		// If there's a custom label, and show label is checked, use that as the field heading
169
-		if ( ! empty( $this->settings['custom_label'] ) && ! empty( $this->settings['show_label'] ) ) {
170
-			$label = $this->settings['custom_label'];
171
-		} else if ( ! empty( $this->item['customLabel'] ) ) {
172
-			$label = $this->item['customLabel'];
169
+		if ( ! empty( $this->settings[ 'custom_label' ] ) && ! empty( $this->settings[ 'show_label' ] ) ) {
170
+			$label = $this->settings[ 'custom_label' ];
171
+		} else if ( ! empty( $this->item[ 'customLabel' ] ) ) {
172
+			$label = $this->item[ 'customLabel' ];
173 173
 		}
174 174
 		$label = esc_attr( $label );
175 175
 
176 176
 		$icon = '';
177 177
 
178
-		if ( $this->item['icon'] && ! \GV\Utils::get( $this->item, 'parent' ) ) {
179
-			if ( 0 === strpos( $this->item['icon'], 'data:' ) ) {
178
+		if ( $this->item[ 'icon' ] && ! \GV\Utils::get( $this->item, 'parent' ) ) {
179
+			if ( 0 === strpos( $this->item[ 'icon' ], 'data:' ) ) {
180 180
 				// Inline icon SVG
181
-				$icon = '<i class="dashicons background-icon" style="background-image: url(\'' . esc_attr( $this->item['icon'] ) . '\');"></i>';
182
-			} elseif ( false === strpos( $this->item['icon'], 'dashicons' ) ) {
181
+				$icon = '<i class="dashicons background-icon" style="background-image: url(\'' . esc_attr( $this->item[ 'icon' ] ) . '\');"></i>';
182
+			} elseif ( false === strpos( $this->item[ 'icon' ], 'dashicons' ) ) {
183 183
 				// Not dashicon icon
184
-				$icon = '<i class="' . esc_attr( $this->item['icon'] ) . '"></i>';
184
+				$icon = '<i class="' . esc_attr( $this->item[ 'icon' ] ) . '"></i>';
185 185
 			} else {
186 186
 				// Dashicon; prefix with "dashicons"
187
-				$icon = '<i class="dashicons ' . esc_attr( $this->item['icon'] ) . '"></i>';
187
+				$icon = '<i class="dashicons ' . esc_attr( $this->item[ 'icon' ] ) . '"></i>';
188 188
 			}
189 189
 
190 190
 			$icon = $icon . ' ';
@@ -196,8 +196,8 @@  discard block
 block discarded – undo
196 196
 
197 197
 		$parent_label = '';
198 198
 
199
-        if ( ! empty( $this->item['parent'] ) ) {
200
-			$parent_label = ' <small>(' . esc_attr( $this->item['parent']['label'] ) . ')</small>';
199
+        if ( ! empty( $this->item[ 'parent' ] ) ) {
200
+			$parent_label = ' <small>(' . esc_attr( $this->item[ 'parent' ][ 'label' ] ) . ')</small>';
201 201
 		}
202 202
 
203 203
 		// Name of field / widget
@@ -210,10 +210,10 @@  discard block
 block discarded – undo
210 210
 
211 211
 		$output .= '</h5>';
212 212
 
213
-		$container_class = ! empty( $this->item['parent'] ) ? ' gv-child-field' : '';
214
-		$data_form_id   = ! empty( $this->form_id ) ? 'data-formid="' . esc_attr( $this->form_id ) . '"' : '';
213
+		$container_class = ! empty( $this->item[ 'parent' ] ) ? ' gv-child-field' : '';
214
+		$data_form_id = ! empty( $this->form_id ) ? 'data-formid="' . esc_attr( $this->form_id ) . '"' : '';
215 215
 
216
-		$output = '<div data-fieldid="' . esc_attr( $this->id ) . '" ' . $data_form_id . ' data-inputtype="' . esc_attr( $this->item['input_type'] ) . '" class="gv-fields' . $container_class . '">' . $output . $this->item['settings_html'] . '</div>';
216
+		$output = '<div data-fieldid="' . esc_attr( $this->id ) . '" ' . $data_form_id . ' data-inputtype="' . esc_attr( $this->item[ 'input_type' ] ) . '" class="gv-fields' . $container_class . '">' . $output . $this->item[ 'settings_html' ] . '</div>';
217 217
 
218 218
 		return $output;
219 219
 	}
Please login to merge, or discard this patch.
includes/class-gravityview-change-entry-creator.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -354,7 +354,7 @@
 block discarded – undo
354 354
 	 *
355 355
 	 * @param array $assets
356 356
 	 *
357
-	 * @return array
357
+	 * @return string[]
358 358
 	 */
359 359
 	function register_gform_noconflict( $assets ) {
360 360
 		$assets[] = 'gravityview_selectwoo';
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 			array(
82 82
 				'ajaxurl'  => admin_url( 'admin-ajax.php' ),
83 83
 				'action'   => 'entry_creator_get_users',
84
-				'gf25'    => (bool) gravityview()->plugin->is_GF_25(),
84
+				'gf25'    => (bool)gravityview()->plugin->is_GF_25(),
85 85
 				'language' => array(
86 86
 					'search_placeholder' => esc_html__( 'Search by ID, login, email, or name.', 'gravityview' ),
87 87
 				),
@@ -105,11 +105,11 @@  discard block
 block discarded – undo
105 105
 			)
106 106
 		);
107 107
 
108
-		if ( ! wp_verify_nonce( $post_var['gv_nonce'], 'gv_entry_creator' ) ) {
108
+		if ( ! wp_verify_nonce( $post_var[ 'gv_nonce' ], 'gv_entry_creator' ) ) {
109 109
 			die();
110 110
 		}
111 111
 
112
-		$search_string = $post_var['q'];
112
+		$search_string = $post_var[ 'q' ];
113 113
 
114 114
 		if ( is_numeric( $search_string ) ) {
115 115
 			$user_args = array(
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 		}
157 157
 
158 158
 		// Update the entry. The `false` prevents checking Akismet; `true` disables the user updated hook from firing
159
-		$result = RGFormsModel::update_entry_property( (int) $entry['id'], 'created_by', (int) $user_id, false, true );
159
+		$result = RGFormsModel::update_entry_property( (int)$entry[ 'id' ], 'created_by', (int)$user_id, false, true );
160 160
 
161 161
 		if ( false === $result ) {
162 162
 			$status = __( 'Error', 'gravityview' );
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
 			return;
179 179
 		}
180 180
 
181
-		GravityView_Entry_Notes::add_note( $entry['id'], - 1, 'GravityView', $note, 'gravityview' );
181
+		GravityView_Entry_Notes::add_note( $entry[ 'id' ], - 1, 'GravityView', $note, 'gravityview' );
182 182
 
183 183
 	}
184 184
 
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
 		}
214 214
 
215 215
 		// If screen mode isn't set, then we're in the wrong place.
216
-		if ( empty( $_REQUEST['screen_mode'] ) ) {
216
+		if ( empty( $_REQUEST[ 'screen_mode' ] ) ) {
217 217
 			return;
218 218
 		}
219 219
 
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 
240 240
 		// If $_GET['screen_mode'] is set to edit, set $_POST value
241 241
 		if ( \GV\Utils::_GET( 'screen_mode' ) === 'edit' ) {
242
-			$_POST["screen_mode"] = 'edit';
242
+			$_POST[ "screen_mode" ] = 'edit';
243 243
 		}
244 244
 
245 245
 	}
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
 		$entry_creator_user_id = \GV\Utils::get( $entry, 'created_by' );
315 315
 
316 316
 		$entry_creator_user = GVCommon::get_users( 'change_entry_creator', array( 'include' => $entry_creator_user_id ) );
317
-		$entry_creator_user = isset( $entry_creator_user[0] ) ? $entry_creator_user[0] : array();
317
+		$entry_creator_user = isset( $entry_creator_user[ 0 ] ) ? $entry_creator_user[ 0 ] : array();
318 318
 
319 319
 		if ( empty( $entry_creator_user ) ) {
320 320
 			$output .= '<option value="0"> &mdash; ' . esc_attr_x( 'No User', 'No user assigned to the entry', 'gravityview' ) . ' &mdash; </option>';
@@ -332,18 +332,18 @@  discard block
 block discarded – undo
332 332
 		}
333 333
 
334 334
 		$user_count      = count_users();
335
-		$user_count      = $user_count['total_users'];
335
+		$user_count      = $user_count[ 'total_users' ];
336 336
 		$users_displayed = self::DEFAULT_NUMBER_OF_USERS + ( ! empty( $entry_creator_user ) ? 1 : 0 );
337 337
 		if ( $user_count > $users_displayed ) {
338 338
 			$remaining_users = $user_count - $users_displayed;
339
-			$user_users = _n( esc_html__('user', 'gravityview' ), esc_html__('users', 'gravityview' ), $remaining_users );
339
+			$user_users = _n( esc_html__( 'user', 'gravityview' ), esc_html__( 'users', 'gravityview' ), $remaining_users );
340 340
 			$message = esc_html_x( 'Use the input above to search the remaining %d %s.', '%d is replaced with user count %s is replaced with "user" or "users"', 'gravityview' );
341 341
 			$message = sprintf( $message, $remaining_users, $user_users );
342
-			$output  .= '<option value="_user_count" disabled="disabled">' . esc_html( $message ) . '</option>';
342
+			$output .= '<option value="_user_count" disabled="disabled">' . esc_html( $message ) . '</option>';
343 343
 		}
344 344
 
345 345
 		$output .= '</select>';
346
-		$output .= '<input name="originally_created_by" value="' . esc_attr( $entry['created_by'] ) . '" type="hidden" />';
346
+		$output .= '<input name="originally_created_by" value="' . esc_attr( $entry[ 'created_by' ] ) . '" type="hidden" />';
347 347
 		$output .= wp_nonce_field( 'gv_entry_creator', 'gv_entry_creator_nonce', false, false );
348 348
 
349 349
 		echo $output;
@@ -357,8 +357,8 @@  discard block
 block discarded – undo
357 357
 	 * @return array
358 358
 	 */
359 359
 	function register_gform_noconflict( $assets ) {
360
-		$assets[] = 'gravityview_selectwoo';
361
-		$assets[] = 'gravityview_entry_creator';
360
+		$assets[ ] = 'gravityview_selectwoo';
361
+		$assets[ ] = 'gravityview_entry_creator';
362 362
 
363 363
 		return $assets;
364 364
 	}
Please login to merge, or discard this patch.