Completed
Push — develop ( 732857...9f2630 )
by Zack
11:50
created
includes/class-oembed.php 1 patch
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 		add_action( 'init', array( $this, 'register_handler' ) );
36 36
 		add_action( 'init', array( $this, 'add_provider' ) );
37 37
 
38
-		if ( ! empty( $_GET['gv_oembed_provider'] ) && ! empty( $_GET['url'] ) ) {
38
+		if ( ! empty( $_GET[ 'gv_oembed_provider' ] ) && ! empty( $_GET[ 'url' ] ) ) {
39 39
 			add_action( 'template_redirect', array( $this, 'render_provider_request' ) );
40 40
 		}
41 41
 	}
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 	 */
47 47
 	static function getInstance() {
48 48
 
49
-		if( empty( self::$instance ) ) {
49
+		if ( empty( self::$instance ) ) {
50 50
 			self::$instance = new self;
51 51
 
52 52
 			self::$instance->initialize();
@@ -86,8 +86,8 @@  discard block
 block discarded – undo
86 86
 	 * @return void
87 87
 	 */
88 88
 	function render_provider_request() {
89
-		if ( ! empty( $_GET['url'] ) ) {
90
-			$url = $_GET['url'];
89
+		if ( ! empty( $_GET[ 'url' ] ) ) {
90
+			$url = $_GET[ 'url' ];
91 91
 		} else {
92 92
 			header( 'HTTP/1.0 404 Not Found' );
93 93
 			exit;
@@ -96,16 +96,16 @@  discard block
 block discarded – undo
96 96
 		preg_match( $this->get_handler_regex(), $url, $matches );
97 97
 
98 98
 		// If not using permalinks, re-assign values for matching groups
99
-		if ( ! empty( $matches['entry_slug2'] ) ) {
100
-			$matches['is_cpt'] = $matches['is_cpt2'];
101
-			$matches['slug'] = $matches['slug2'];
102
-			$matches['entry_slug'] = $matches['entry_slug2'];
103
-			unset( $matches['is_cpt2'], $matches['slug2'], $matches['entry_slug2'] );
99
+		if ( ! empty( $matches[ 'entry_slug2' ] ) ) {
100
+			$matches[ 'is_cpt' ] = $matches[ 'is_cpt2' ];
101
+			$matches[ 'slug' ] = $matches[ 'slug2' ];
102
+			$matches[ 'entry_slug' ] = $matches[ 'entry_slug2' ];
103
+			unset( $matches[ 'is_cpt2' ], $matches[ 'slug2' ], $matches[ 'entry_slug2' ] );
104 104
 		}
105 105
 
106 106
 		// No Entry was found
107
-		if ( empty( $matches['entry_slug'] ) ) {
108
-			do_action('gravityview_log_error', 'GravityView_oEmbed[render_handler] $entry_slug not parsed by regex.', $matches );
107
+		if ( empty( $matches[ 'entry_slug' ] ) ) {
108
+			do_action( 'gravityview_log_error', 'GravityView_oEmbed[render_handler] $entry_slug not parsed by regex.', $matches );
109 109
 			header( 'HTTP/1.0 404 Not Found' );
110 110
 			exit;
111 111
 		}
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 		// Catch either
159 159
 		$match_regex = "(?:{$using_permalinks}|{$not_using_permalinks})";
160 160
 
161
-		return '#'.$match_regex.'#i';
161
+		return '#' . $match_regex . '#i';
162 162
 	}
163 163
 
164 164
 	/**
@@ -177,18 +177,18 @@  discard block
 block discarded – undo
177 177
 
178 178
 		$post_id = url_to_postid( $url );
179 179
 
180
-		if( empty( $post_id ) ) {
180
+		if ( empty( $post_id ) ) {
181 181
 
182 182
 			$args = array(
183 183
 				'post_status' => 'publish',
184 184
 				'name' => $slug,
185
-				'post_type' => array('any', 'gravityview'),
185
+				'post_type' => array( 'any', 'gravityview' ),
186 186
 			);
187 187
 
188 188
 			$posts = get_posts( $args );
189 189
 
190
-			if( !empty( $posts ) ) {
191
-				$post_id = $posts[0]->ID;
190
+			if ( ! empty( $posts ) ) {
191
+				$post_id = $posts[ 0 ]->ID;
192 192
 			}
193 193
 		}
194 194
 
@@ -221,17 +221,17 @@  discard block
 block discarded – undo
221 221
 	public function render_handler( $matches, $attr, $url, $rawattr ) {
222 222
 
223 223
 		// If not using permalinks, re-assign values for matching groups
224
-		if( !empty( $matches['entry_slug2'] ) ) {
225
-			$matches['is_cpt'] = $matches['is_cpt2'];
226
-			$matches['slug'] = $matches['slug2'];
227
-			$matches['entry_slug'] = $matches['entry_slug2'];
228
-			unset( $matches['is_cpt2'], $matches['slug2'], $matches['entry_slug2'] );
224
+		if ( ! empty( $matches[ 'entry_slug2' ] ) ) {
225
+			$matches[ 'is_cpt' ] = $matches[ 'is_cpt2' ];
226
+			$matches[ 'slug' ] = $matches[ 'slug2' ];
227
+			$matches[ 'entry_slug' ] = $matches[ 'entry_slug2' ];
228
+			unset( $matches[ 'is_cpt2' ], $matches[ 'slug2' ], $matches[ 'entry_slug2' ] );
229 229
 		}
230 230
 
231 231
 		// No Entry was found
232
-		if( empty( $matches['entry_slug'] ) ) {
232
+		if ( empty( $matches[ 'entry_slug' ] ) ) {
233 233
 
234
-			do_action('gravityview_log_error', 'GravityView_oEmbed[render_handler] $entry_slug not parsed by regex.', $matches );
234
+			do_action( 'gravityview_log_error', 'GravityView_oEmbed[render_handler] $entry_slug not parsed by regex.', $matches );
235 235
 
236 236
 			return '';
237 237
 		}
@@ -241,11 +241,11 @@  discard block
 block discarded – undo
241 241
 		// Setup the data used
242 242
 		$this->set_vars( $matches, $attr, $url, $rawattr );
243 243
 
244
-		if( is_admin() && !$this->is_full_oembed_preview ) {
244
+		if ( is_admin() && ! $this->is_full_oembed_preview ) {
245 245
 			$return = $this->render_admin( $matches, $attr, $url, $rawattr );
246 246
 		} else {
247 247
 
248
-			if( $this->is_full_oembed_preview ) {
248
+			if ( $this->is_full_oembed_preview ) {
249 249
 				$return .= $this->generate_preview_notice();
250 250
 			}
251 251
 
@@ -264,8 +264,8 @@  discard block
 block discarded – undo
264 264
 	private function generate_preview_notice() {
265 265
 		$floaty = GravityView_Admin::get_floaty();
266 266
 		$title = esc_html__( 'This will look better when it is embedded.', 'gravityview' );
267
-		$message = esc_html__('Styles don\'t get loaded when being previewed, so the content below will look strange. Don\'t be concerned!', 'gravityview');
268
-		return '<div class="updated notice">'. $floaty. '<h3>'.$title.'</h3><p>'.$message.'</p><br style="clear:both;" /></div>';
267
+		$message = esc_html__( 'Styles don\'t get loaded when being previewed, so the content below will look strange. Don\'t be concerned!', 'gravityview' );
268
+		return '<div class="updated notice">' . $floaty . '<h3>' . $title . '</h3><p>' . $message . '</p><br style="clear:both;" /></div>';
269 269
 	}
270 270
 
271 271
 	/**
@@ -278,14 +278,14 @@  discard block
 block discarded – undo
278 278
 	 */
279 279
 	private function set_vars( $matches, $attr, $url, $rawattr ) {
280 280
 
281
-		$this->entry_id = $matches['entry_slug'];
281
+		$this->entry_id = $matches[ 'entry_slug' ];
282 282
 
283
-		$post_id = $this->get_postid_from_url_and_slug( $url, $matches['slug'] );
283
+		$post_id = $this->get_postid_from_url_and_slug( $url, $matches[ 'slug' ] );
284 284
 
285 285
 		// The URL didn't have the View Custom Post Type structure.
286
-		if( empty( $matches['is_cpt'] ) || $matches['is_cpt'] !== 'gravityview' ) {
286
+		if ( empty( $matches[ 'is_cpt' ] ) || $matches[ 'is_cpt' ] !== 'gravityview' ) {
287 287
 
288
-			do_action('gravityview_log_debug', 'GravityView_oEmbed[render_handler] Embedding an entry inside a post or page', $matches );
288
+			do_action( 'gravityview_log_debug', 'GravityView_oEmbed[render_handler] Embedding an entry inside a post or page', $matches );
289 289
 
290 290
 			if ( defined( 'GRAVITYVIEW_FUTURE_CORE_LOADED' ) && $post = get_post( $post_id ) ) {
291 291
 				$views = \GV\View_Collection::from_post( $post );
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
 						}
299 299
 					}
300 300
 
301
-					$this->view_id = $views[0]->ID;
301
+					$this->view_id = $views[ 0 ]->ID;
302 302
 				}
303 303
 			} else {
304 304
 				/** Deprecated. */
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
 		}
313 313
 
314 314
 		// The inline content has $_POST['type'] set to "embed", while the "Add Media" modal doesn't set that.
315
-		$this->is_full_oembed_preview = ( isset( $_POST['action'] ) && $_POST['action'] === 'parse-embed' && !isset( $_POST['type'] ) );
315
+		$this->is_full_oembed_preview = ( isset( $_POST[ 'action' ] ) && $_POST[ 'action' ] === 'parse-embed' && ! isset( $_POST[ 'type' ] ) );
316 316
 	}
317 317
 
318 318
 	/**
@@ -330,15 +330,15 @@  discard block
 block discarded – undo
330 330
 		// Floaty the astronaut
331 331
 		$image = GravityView_Admin::get_floaty();
332 332
 
333
-		$embed_heading = sprintf( esc_html__('Embed Entry %d', 'gravityview'), $this->entry_id );
333
+		$embed_heading = sprintf( esc_html__( 'Embed Entry %d', 'gravityview' ), $this->entry_id );
334 334
 
335
-		$embed_text = sprintf( esc_html__('This entry will be displayed as it is configured in View %d', 'gravityview'), $this->view_id );
335
+		$embed_text = sprintf( esc_html__( 'This entry will be displayed as it is configured in View %d', 'gravityview' ), $this->view_id );
336 336
 
337 337
 		return '
338 338
 		<div class="loading-placeholder" style="background-color:#e6f0f5;">
339
-			<h3 style="margin:0; padding:0; font-family: -apple-system, BlinkMacSystemFont, \'Segoe UI\', Roboto, Oxygen-Sans, Ubuntu, Cantarell, \'Helvetica Neue\', sans-serif;">'.$image.$embed_heading.'</h3>
339
+			<h3 style="margin:0; padding:0; font-family: -apple-system, BlinkMacSystemFont, \'Segoe UI\', Roboto, Oxygen-Sans, Ubuntu, Cantarell, \'Helvetica Neue\', sans-serif;">'.$image . $embed_heading . '</h3>
340 340
 			<p style="margin:0; padding:0; font-family: -apple-system, BlinkMacSystemFont, \'Segoe UI\', Roboto, Oxygen-Sans, Ubuntu, Cantarell, \'Helvetica Neue\', sans-serif;">
341
-				'.$embed_text.'
341
+				'.$embed_text . '
342 342
 			</p>
343 343
 			<br style="clear: both;">
344 344
 		</div>';
@@ -393,14 +393,14 @@  discard block
 block discarded – undo
393 393
 	private function render_frontend( $matches, $attr, $url, $rawattr ) {
394 394
 
395 395
 		// If it's already been parsed, don't re-output it.
396
-		if( !empty( $this->output[ $this->entry_id ] ) ) {
396
+		if ( ! empty( $this->output[ $this->entry_id ] ) ) {
397 397
 			return $this->output[ $this->entry_id ];
398 398
 		}
399 399
 
400 400
 		$entry_output = $this->generate_entry_output();
401 401
 
402 402
 		// Wrap a container div around the output to allow for custom styling
403
-		$output = sprintf('<div class="gravityview-oembed gravityview-oembed-entry gravityview-oembed-entry-'.$this->entry_id.'">%s</div>', $entry_output );
403
+		$output = sprintf( '<div class="gravityview-oembed gravityview-oembed-entry gravityview-oembed-entry-' . $this->entry_id . '">%s</div>', $entry_output );
404 404
 
405 405
 		/**
406 406
 		 * @filter `gravityview/oembed/entry` Filter the output of the oEmbed entry embed
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
 		 *  @var string $url The original URL that was matched by the regex. \n
414 414
 		 *  @var array $rawattr The original unmodified attributes.
415 415
 		 */
416
-		$output = apply_filters('gravityview/oembed/entry', $output, $this, compact( $entry_output, $matches, $attr, $url, $rawattr ) );
416
+		$output = apply_filters( 'gravityview/oembed/entry', $output, $this, compact( $entry_output, $matches, $attr, $url, $rawattr ) );
417 417
 
418 418
 		unset( $entry_output );
419 419
 
Please login to merge, or discard this patch.
includes/widgets/search-widget/templates/search-field-date.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -11,10 +11,10 @@
 block discarded – undo
11 11
 ?>
12 12
 
13 13
 <div class="gv-search-box gv-search-date">
14
-	<?php if( ! gv_empty( $search_field['label'], false, false ) ) { ?>
15
-	<label for="search-box-<?php echo esc_attr( $search_field['name'] ); ?>"><?php echo esc_html( $search_field['label'] ); ?></label>
14
+	<?php if ( ! gv_empty( $search_field[ 'label' ], false, false ) ) { ?>
15
+	<label for="search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>"><?php echo esc_html( $search_field[ 'label' ] ); ?></label>
16 16
 	<?php } ?>
17 17
 	<p>
18
-		<input type="text" name="<?php echo esc_attr( $search_field['name'] ); ?>" id="search-box-<?php echo esc_attr( $search_field['name'] ); ?>" value="<?php echo esc_attr( $search_field['value'] ); ?>" class="<?php echo esc_html( $gravityview_view->datepicker_class ); ?>" >
18
+		<input type="text" name="<?php echo esc_attr( $search_field[ 'name' ] ); ?>" id="search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>" value="<?php echo esc_attr( $search_field[ 'value' ] ); ?>" class="<?php echo esc_html( $gravityview_view->datepicker_class ); ?>" >
19 19
 	</p>
20 20
 </div>
21 21
\ No newline at end of file
Please login to merge, or discard this patch.
includes/widgets/search-widget/templates/search-field-multiselect.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -10,8 +10,8 @@  discard block
 block discarded – undo
10 10
 $search_field = $gravityview_view->search_field;
11 11
 
12 12
 // Make sure that there are choices to display
13
-if( empty( $search_field['choices'] ) ) {
14
-	do_action('gravityview_log_debug', 'search-field-multiselect.php - No choices for field' );
13
+if ( empty( $search_field[ 'choices' ] ) ) {
14
+	do_action( 'gravityview_log_debug', 'search-field-multiselect.php - No choices for field' );
15 15
 	return;
16 16
 }
17 17
 
@@ -21,19 +21,19 @@  discard block
 block discarded – undo
21 21
  * @param string $default_option Default: `&mdash;` (—)
22 22
  * @param string $field_type Field type: "select" or "multiselect"
23 23
  */
24
-$default_option = apply_filters('gravityview/extension/search/select_default', '&mdash;', 'multiselect' );
24
+$default_option = apply_filters( 'gravityview/extension/search/select_default', '&mdash;', 'multiselect' );
25 25
 
26 26
 ?>
27 27
 <div class="gv-search-box gv-search-field-multiselect">
28
-	<?php if( ! gv_empty( $search_field['label'], false, false ) ) { ?>
29
-		<label for="search-box-<?php echo esc_attr( $search_field['name'] ); ?>"><?php echo esc_html( $search_field['label'] ); ?></label>
28
+	<?php if ( ! gv_empty( $search_field[ 'label' ], false, false ) ) { ?>
29
+		<label for="search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>"><?php echo esc_html( $search_field[ 'label' ] ); ?></label>
30 30
 	<?php } ?>
31 31
 	<p>
32
-		<select name="<?php echo esc_attr( $search_field['name'] ); ?>[]" id="search-box-<?php echo esc_attr( $search_field['name'] ); ?>" multiple>
33
-			<option value="" <?php gv_selected( '', $search_field['value'], true ); ?>><?php echo esc_html( $default_option ); ?></option>
32
+		<select name="<?php echo esc_attr( $search_field[ 'name' ] ); ?>[]" id="search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>" multiple>
33
+			<option value="" <?php gv_selected( '', $search_field[ 'value' ], true ); ?>><?php echo esc_html( $default_option ); ?></option>
34 34
 			<?php
35
-			foreach( $search_field['choices'] as $choice ) : ?>
36
-				<option value="<?php echo esc_attr( $choice['value'] ); ?>" <?php gv_selected( $choice['value'], $search_field['value'], true ); ?>><?php echo esc_html( $choice['text'] ); ?></option>
35
+			foreach ( $search_field[ 'choices' ] as $choice ) : ?>
36
+				<option value="<?php echo esc_attr( $choice[ 'value' ] ); ?>" <?php gv_selected( $choice[ 'value' ], $search_field[ 'value' ], true ); ?>><?php echo esc_html( $choice[ 'text' ] ); ?></option>
37 37
 			<?php endforeach; ?>
38 38
 		</select>
39 39
 	</p>
Please login to merge, or discard this patch.
includes/widgets/search-widget/templates/search-field-entry_date.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -7,17 +7,17 @@
 block discarded – undo
7 7
 
8 8
 $gravityview_view = GravityView_View::getInstance();
9 9
 $view_id = $gravityview_view->getViewId();
10
-$value = $gravityview_view->search_field['value'];
11
-$label = $gravityview_view->search_field['label'];
10
+$value = $gravityview_view->search_field[ 'value' ];
11
+$label = $gravityview_view->search_field[ 'label' ];
12 12
 
13 13
 ?>
14 14
 
15 15
 <div class="gv-search-box gv-search-date gv-search-date-range gv-search-field-entry_date">
16
-	<?php if( ! gv_empty( $label, false, false ) ) { ?>
16
+	<?php if ( ! gv_empty( $label, false, false ) ) { ?>
17 17
 	<label for="gv_start_date_<?php echo $view_id; ?>"><?php echo esc_html( $label ); ?></label>
18 18
 	<?php } ?>
19 19
 	<p>
20
-		<input name="gv_start" id="gv_start_date_<?php echo $view_id; ?>" type="text" class="<?php echo esc_html( $gravityview_view->datepicker_class ); ?>" placeholder="<?php esc_attr_e('Start date', 'gravityview' ); ?>" value="<?php echo $value['start']; ?>">
21
-		<input name="gv_end" id="gv_end_date_<?php echo $view_id; ?>" type="text" class="<?php echo esc_html( $gravityview_view->datepicker_class ); ?>" placeholder="<?php esc_attr_e('End date', 'gravityview' ); ?>" value="<?php echo $value['end']; ?>">
20
+		<input name="gv_start" id="gv_start_date_<?php echo $view_id; ?>" type="text" class="<?php echo esc_html( $gravityview_view->datepicker_class ); ?>" placeholder="<?php esc_attr_e( 'Start date', 'gravityview' ); ?>" value="<?php echo $value[ 'start' ]; ?>">
21
+		<input name="gv_end" id="gv_end_date_<?php echo $view_id; ?>" type="text" class="<?php echo esc_html( $gravityview_view->datepicker_class ); ?>" placeholder="<?php esc_attr_e( 'End date', 'gravityview' ); ?>" value="<?php echo $value[ 'end' ]; ?>">
22 22
 	</p>
23 23
 </div>
24 24
\ No newline at end of file
Please login to merge, or discard this patch.
includes/widgets/search-widget/templates/search-field-select.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -10,8 +10,8 @@  discard block
 block discarded – undo
10 10
 $search_field = $gravityview_view->search_field;
11 11
 
12 12
 // Make sure that there are choices to display
13
-if( empty( $search_field['choices'] ) ) {
14
-	do_action('gravityview_log_debug', 'search-field-select.php - No choices for field' );
13
+if ( empty( $search_field[ 'choices' ] ) ) {
14
+	do_action( 'gravityview_log_debug', 'search-field-select.php - No choices for field' );
15 15
 	return;
16 16
 }
17 17
 
@@ -21,19 +21,19 @@  discard block
 block discarded – undo
21 21
  * @param string $default_option Default: `&mdash;` (—)
22 22
  * @param string $field_type Field type: "select" or "multiselect"
23 23
  */
24
-$default_option = apply_filters('gravityview/extension/search/select_default', '&mdash;', 'select' );
24
+$default_option = apply_filters( 'gravityview/extension/search/select_default', '&mdash;', 'select' );
25 25
 
26 26
 ?>
27 27
 <div class="gv-search-box gv-search-field-select">
28
-	<?php if( ! gv_empty( $search_field['label'], false, false ) ) { ?>
29
-		<label for="search-box-<?php echo esc_attr( $search_field['name'] ); ?>"><?php echo esc_html( $search_field['label'] ); ?></label>
28
+	<?php if ( ! gv_empty( $search_field[ 'label' ], false, false ) ) { ?>
29
+		<label for="search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>"><?php echo esc_html( $search_field[ 'label' ] ); ?></label>
30 30
 	<?php } ?>
31 31
 	<p>
32
-		<select name="<?php echo esc_attr( $search_field['name'] ); ?>" id="search-box-<?php echo esc_attr( $search_field['name'] ); ?>">
33
-			<option value="" <?php gv_selected( '', $search_field['value'], true ); ?>><?php echo esc_html( $default_option ); ?></option>
32
+		<select name="<?php echo esc_attr( $search_field[ 'name' ] ); ?>" id="search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>">
33
+			<option value="" <?php gv_selected( '', $search_field[ 'value' ], true ); ?>><?php echo esc_html( $default_option ); ?></option>
34 34
 			<?php
35
-			foreach( $search_field['choices'] as $choice ) : ?>
36
-				<option value="<?php echo esc_attr( $choice['value'] ); ?>" <?php gv_selected( esc_attr( $choice['value'] ), esc_attr( $search_field['value'] ), true ); ?>><?php echo esc_html( $choice['text'] ); ?></option>
35
+			foreach ( $search_field[ 'choices' ] as $choice ) : ?>
36
+				<option value="<?php echo esc_attr( $choice[ 'value' ] ); ?>" <?php gv_selected( esc_attr( $choice[ 'value' ] ), esc_attr( $search_field[ 'value' ] ), true ); ?>><?php echo esc_html( $choice[ 'text' ] ); ?></option>
37 37
 			<?php endforeach; ?>
38 38
 		</select>
39 39
 	</p>
Please login to merge, or discard this patch.
includes/widgets/search-widget/templates/search-field-radio.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -10,22 +10,22 @@
 block discarded – undo
10 10
 $search_field = $gravityview_view->search_field;
11 11
 
12 12
 // Make sure that there are choices to display
13
-if( empty( $search_field['choices'] ) ) {
14
-	do_action('gravityview_log_debug', 'search-field-radio.php - No choices for field' );
13
+if ( empty( $search_field[ 'choices' ] ) ) {
14
+	do_action( 'gravityview_log_debug', 'search-field-radio.php - No choices for field' );
15 15
 	return;
16 16
 }
17 17
 
18 18
 ?>
19 19
 <div class="gv-search-box gv-search-field-radio">
20
-	<?php if( ! gv_empty( $search_field['label'], false, false ) ) { ?>
21
-	<label for=search-box-<?php echo esc_attr( $search_field['name'] ); ?>><?php echo esc_html( $search_field['label'] ); ?></label>
20
+	<?php if ( ! gv_empty( $search_field[ 'label' ], false, false ) ) { ?>
21
+	<label for=search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>><?php echo esc_html( $search_field[ 'label' ] ); ?></label>
22 22
 	<?php } ?>
23 23
 	<p>
24
-	<?php foreach( $search_field['choices'] as $choice ) { ?>
24
+	<?php foreach ( $search_field[ 'choices' ] as $choice ) { ?>
25 25
 
26
-		<label for="search-box-<?php echo sanitize_html_class( $search_field['name'].$choice['value'].$choice['text'] ); ?>" class="gv-check-radio">
27
-			<input type="radio" name="<?php echo esc_attr( $search_field['name'] ); ?>" value="<?php echo esc_attr( $choice['value'] ); ?>" id="search-box-<?php echo sanitize_html_class( $search_field['name'].$choice['value'].$choice['text'] ); ?>" <?php checked( $choice['value'], $search_field['value'], true ); ?>>
28
-			<?php echo esc_html( $choice['text'] ); ?>
26
+		<label for="search-box-<?php echo sanitize_html_class( $search_field[ 'name' ] . $choice[ 'value' ] . $choice[ 'text' ] ); ?>" class="gv-check-radio">
27
+			<input type="radio" name="<?php echo esc_attr( $search_field[ 'name' ] ); ?>" value="<?php echo esc_attr( $choice[ 'value' ] ); ?>" id="search-box-<?php echo sanitize_html_class( $search_field[ 'name' ] . $choice[ 'value' ] . $choice[ 'text' ] ); ?>" <?php checked( $choice[ 'value' ], $search_field[ 'value' ], true ); ?>>
28
+			<?php echo esc_html( $choice[ 'text' ] ); ?>
29 29
 		</label>
30 30
 
31 31
 	<?php } ?>
Please login to merge, or discard this patch.
includes/widgets/search-widget/templates/search-field-entry_id.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -7,13 +7,13 @@
 block discarded – undo
7 7
 
8 8
 $gravityview_view = GravityView_View::getInstance();
9 9
 $view_id = $gravityview_view->getViewId();
10
-$value = $gravityview_view->search_field['value'];
11
-$label = $gravityview_view->search_field['label'];
10
+$value = $gravityview_view->search_field[ 'value' ];
11
+$label = $gravityview_view->search_field[ 'label' ];
12 12
 ?>
13 13
 
14 14
 <div class="gv-search-box gv-search-field-entry_id">
15 15
 	<div class="gv-search">
16
-		<?php if( ! gv_empty( $label, false, false ) ) { ?>
16
+		<?php if ( ! gv_empty( $label, false, false ) ) { ?>
17 17
 		<label for="gv_entry_id_<?php echo $view_id; ?>"><?php echo esc_html( $label ); ?></label>
18 18
 		<?php } ?>
19 19
 		<p><input type="text" name="gv_id" id="gv_entry_id_<?php echo $view_id; ?>" value="<?php echo $value; ?>" /></p>
Please login to merge, or discard this patch.
includes/widgets/search-widget/templates/search-field-checkbox.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -10,22 +10,22 @@
 block discarded – undo
10 10
 $search_field = $gravityview_view->search_field;
11 11
 
12 12
 // Make sure that there are choices to display
13
-if( empty( $search_field['choices'] ) ) {
14
-	do_action('gravityview_log_debug', 'search-field-checkbox.php - No choices for field' );
13
+if ( empty( $search_field[ 'choices' ] ) ) {
14
+	do_action( 'gravityview_log_debug', 'search-field-checkbox.php - No choices for field' );
15 15
 	return;
16 16
 }
17 17
 
18 18
 ?>
19 19
 <div class="gv-search-box gv-search-field-checkbox">
20
-	<?php if( ! gv_empty( $search_field['label'], false, false ) ) { ?>
21
-	<label for=search-box-<?php echo esc_attr( $search_field['name'] ); ?>><?php echo esc_html( $search_field['label'] ); ?></label>
20
+	<?php if ( ! gv_empty( $search_field[ 'label' ], false, false ) ) { ?>
21
+	<label for=search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>><?php echo esc_html( $search_field[ 'label' ] ); ?></label>
22 22
 	<?php } ?>
23 23
 	<p>
24
-	<?php foreach( $search_field['choices'] as $choice ) { ?>
24
+	<?php foreach ( $search_field[ 'choices' ] as $choice ) { ?>
25 25
 
26
-		<label for="search-box-<?php echo sanitize_html_class( $search_field['name'].$choice['value'].$choice['text'] ); ?>" class="gv-check-radio">
27
-			<input type="checkbox" name="<?php echo esc_attr( $search_field['name'] ); ?>[]" value="<?php echo esc_attr( $choice['value'] ); ?>" id="search-box-<?php echo sanitize_html_class( $search_field['name'].$choice['value'].$choice['text'] ); ?>" <?php gv_selected( $choice['value'], $search_field['value'], true, 'checked' ); ?>>
28
-			<?php echo esc_html( $choice['text'] ); ?>
26
+		<label for="search-box-<?php echo sanitize_html_class( $search_field[ 'name' ] . $choice[ 'value' ] . $choice[ 'text' ] ); ?>" class="gv-check-radio">
27
+			<input type="checkbox" name="<?php echo esc_attr( $search_field[ 'name' ] ); ?>[]" value="<?php echo esc_attr( $choice[ 'value' ] ); ?>" id="search-box-<?php echo sanitize_html_class( $search_field[ 'name' ] . $choice[ 'value' ] . $choice[ 'text' ] ); ?>" <?php gv_selected( $choice[ 'value' ], $search_field[ 'value' ], true, 'checked' ); ?>>
28
+			<?php echo esc_html( $choice[ 'text' ] ); ?>
29 29
 		</label>
30 30
 
31 31
 	<?php } ?>
Please login to merge, or discard this patch.
includes/widgets/search-widget/templates/search-field-date_range.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -7,17 +7,17 @@
 block discarded – undo
7 7
 
8 8
 $gravityview_view = GravityView_View::getInstance();
9 9
 $view_id = $gravityview_view->getViewId();
10
-$value = $gravityview_view->search_field['value'];
11
-$label = $gravityview_view->search_field['label'];
12
-$name = $gravityview_view->search_field['name'];
10
+$value = $gravityview_view->search_field[ 'value' ];
11
+$label = $gravityview_view->search_field[ 'label' ];
12
+$name = $gravityview_view->search_field[ 'name' ];
13 13
 ?>
14 14
 
15 15
 <div class="gv-search-box gv-search-date gv-search-date-range">
16
-	<?php if( ! gv_empty( $label, false, false ) ) { ?>
17
-	<label for="search-box-<?php echo esc_attr( $name ).'-start'; ?>"><?php echo esc_html( $label ); ?></label>
16
+	<?php if ( ! gv_empty( $label, false, false ) ) { ?>
17
+	<label for="search-box-<?php echo esc_attr( $name ) . '-start'; ?>"><?php echo esc_html( $label ); ?></label>
18 18
 	<?php } ?>
19 19
 	<p>
20
-		<input name="<?php echo esc_attr( $name ).'[start]'; ?>" id="search-box-<?php echo esc_attr( $name ).'-start'; ?>" type="text" class="<?php echo esc_html( $gravityview_view->datepicker_class ); ?>" placeholder="<?php esc_attr_e('Start date', 'gravityview' ); ?>" value="<?php echo $value['start']; ?>">
21
-		<input name="<?php echo esc_attr( $name ).'[end]'; ?>" id="search-box-<?php echo esc_attr( $name ).'-end'; ?>" type="text" class="<?php echo esc_html( $gravityview_view->datepicker_class ); ?>" placeholder="<?php esc_attr_e('End date', 'gravityview' ); ?>" value="<?php echo $value['end']; ?>">
20
+		<input name="<?php echo esc_attr( $name ) . '[start]'; ?>" id="search-box-<?php echo esc_attr( $name ) . '-start'; ?>" type="text" class="<?php echo esc_html( $gravityview_view->datepicker_class ); ?>" placeholder="<?php esc_attr_e( 'Start date', 'gravityview' ); ?>" value="<?php echo $value[ 'start' ]; ?>">
21
+		<input name="<?php echo esc_attr( $name ) . '[end]'; ?>" id="search-box-<?php echo esc_attr( $name ) . '-end'; ?>" type="text" class="<?php echo esc_html( $gravityview_view->datepicker_class ); ?>" placeholder="<?php esc_attr_e( 'End date', 'gravityview' ); ?>" value="<?php echo $value[ 'end' ]; ?>">
22 22
 	</p>
23 23
 </div>
24 24
\ No newline at end of file
Please login to merge, or discard this patch.