Completed
Pull Request — master (#908)
by Zack
16:57 queued 13:33
created
future/includes/class-gv-form-gravityforms.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -40,14 +40,14 @@  discard block
 block discarded – undo
40 40
 	 */
41 41
 	public static function by_id( $form_id ) {
42 42
 		$form = \GFAPI::get_form( $form_id );
43
-		if ( !$form ) {
43
+		if ( ! $form ) {
44 44
 			return null;
45 45
 		}
46 46
 
47 47
 		$self = new self();
48 48
 		$self->form = $form;
49 49
 
50
-		$self->ID = $self->form['id'];
50
+		$self->ID = $self->form[ 'id' ];
51 51
 
52 52
 		return $self;
53 53
 	}
@@ -90,11 +90,11 @@  discard block
 block discarded – undo
90 90
 
91 91
 			/** The offset and limit */
92 92
 			if ( ! empty( $offset->limit ) ) {
93
-				$paging['page_size'] = $offset->limit;
93
+				$paging[ 'page_size' ] = $offset->limit;
94 94
 			}
95 95
 
96 96
 			if ( ! empty( $offset->offset ) ) {
97
-				$paging['offset'] = $offset->offset;
97
+				$paging[ 'offset' ] = $offset->offset;
98 98
 			}
99 99
 
100 100
 			foreach ( \GFAPI::get_entries( $form->ID, $search_criteria, $sorting, $paging ) as $entry ) {
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 	 * @return bool Whether the offset exists or not.
131 131
 	 */
132 132
 	public function offsetExists( $offset ) {
133
-		return isset( $this->form[$offset] );
133
+		return isset( $this->form[ $offset ] );
134 134
 	}
135 135
 
136 136
 	/**
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 	 * @return mixed The value of the requested form data.
146 146
 	 */
147 147
 	public function offsetGet( $offset ) {
148
-		return $this->form[$offset];
148
+		return $this->form[ $offset ];
149 149
 	}
150 150
 
151 151
 	/**
Please login to merge, or discard this patch.
includes/class-gravityview-logging.php 2 patches
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -12,10 +12,10 @@  discard block
 block discarded – undo
12 12
 		add_action( 'gravityview_log_debug', array( $this, 'log_debug'), 10, 2 );
13 13
 
14 14
 		// Enable debug with Gravity Forms Logging Add-on
15
-	    add_filter( 'gform_logging_supported', array( $this, 'enable_gform_logging' ) );
15
+		add_filter( 'gform_logging_supported', array( $this, 'enable_gform_logging' ) );
16 16
 
17
-	    // Load Debug Bar integration
18
-	    add_filter( 'debug_bar_panels', array( $this, 'add_debug_bar' ) );
17
+		// Load Debug Bar integration
18
+		add_filter( 'debug_bar_panels', array( $this, 'add_debug_bar' ) );
19 19
 
20 20
 	}
21 21
 
@@ -44,8 +44,8 @@  discard block
 block discarded – undo
44 44
 	 * @param array $supported_plugins List of plugins
45 45
 	 */
46 46
 	public function enable_gform_logging( $supported_plugins ) {
47
-	    $supported_plugins['gravityview'] = 'GravityView';
48
-	    return $supported_plugins;
47
+		$supported_plugins['gravityview'] = 'GravityView';
48
+		return $supported_plugins;
49 49
 	}
50 50
 
51 51
 	/**
@@ -96,8 +96,8 @@  discard block
 block discarded – undo
96 96
 
97 97
 		if ( class_exists("GFLogging") ) {
98 98
 			GFLogging::include_logger();
99
-	        GFLogging::log_message( 'gravityview', $function( $message, true ) . $function($data, true), KLogger::DEBUG );
100
-	    }
99
+			GFLogging::log_message( 'gravityview', $function( $message, true ) . $function($data, true), KLogger::DEBUG );
100
+		}
101 101
 	}
102 102
 
103 103
 	static function log_error( $message = '', $data = null  ) {
@@ -115,8 +115,8 @@  discard block
 block discarded – undo
115 115
 		}
116 116
 
117 117
 		if ( class_exists("GFLogging") ) {
118
-		    GFLogging::include_logger();
119
-		    GFLogging::log_message( 'gravityview', $function ( $message, true ) . $function ( $error, true), KLogger::ERROR );
118
+			GFLogging::include_logger();
119
+			GFLogging::log_message( 'gravityview', $function ( $message, true ) . $function ( $error, true), KLogger::ERROR );
120 120
 		}
121 121
 	}
122 122
 
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -7,9 +7,9 @@  discard block
 block discarded – undo
7 7
 
8 8
 	function __construct() {
9 9
 
10
-		add_action( 'gravityview_log_error', array( $this, 'log_error'), 10, 2 );
10
+		add_action( 'gravityview_log_error', array( $this, 'log_error' ), 10, 2 );
11 11
 
12
-		add_action( 'gravityview_log_debug', array( $this, 'log_debug'), 10, 2 );
12
+		add_action( 'gravityview_log_debug', array( $this, 'log_debug' ), 10, 2 );
13 13
 
14 14
 		// Enable debug with Gravity Forms Logging Add-on
15 15
 	    add_filter( 'gform_logging_supported', array( $this, 'enable_gform_logging' ) );
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 			include_once( GRAVITYVIEW_DIR . 'includes/class-debug-bar.php' );
35 35
 		}
36 36
 
37
-		$panels[] = new GravityView_Debug_Bar;
37
+		$panels[ ] = new GravityView_Debug_Bar;
38 38
 
39 39
 		return $panels;
40 40
 	}
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 	 * @param array $supported_plugins List of plugins
45 45
 	 */
46 46
 	public function enable_gform_logging( $supported_plugins ) {
47
-	    $supported_plugins['gravityview'] = 'GravityView';
47
+	    $supported_plugins[ 'gravityview' ] = 'GravityView';
48 48
 	    return $supported_plugins;
49 49
 	}
50 50
 
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 	 * @return string "print_r" or "var_export"
73 73
 	 */
74 74
 	static function get_print_function() {
75
-		if( ob_get_level() > 0 ) {
75
+		if ( ob_get_level() > 0 ) {
76 76
 			$function = 'var_export';
77 77
 		} else {
78 78
 			$function = 'print_r';
@@ -90,17 +90,17 @@  discard block
 block discarded – undo
90 90
 			'data' => $data,
91 91
 		);
92 92
 
93
-		if( !in_array( $notice, self::$notices ) ) {
94
-			self::$notices[] = $notice;
93
+		if ( ! in_array( $notice, self::$notices ) ) {
94
+			self::$notices[ ] = $notice;
95 95
 		}
96 96
 
97
-		if ( class_exists("GFLogging") ) {
97
+		if ( class_exists( "GFLogging" ) ) {
98 98
 			GFLogging::include_logger();
99
-	        GFLogging::log_message( 'gravityview', $function( $message, true ) . $function($data, true), KLogger::DEBUG );
99
+	        GFLogging::log_message( 'gravityview', $function( $message, true ) . $function( $data, true ), KLogger::DEBUG );
100 100
 	    }
101 101
 	}
102 102
 
103
-	static function log_error( $message = '', $data = null  ) {
103
+	static function log_error( $message = '', $data = null ) {
104 104
 
105 105
 		$function = self::get_print_function();
106 106
 
@@ -110,13 +110,13 @@  discard block
 block discarded – undo
110 110
 			'backtrace' => function_exists( 'wp_debug_backtrace_summary' ) ? wp_debug_backtrace_summary( null, 3 ) : '',
111 111
 		);
112 112
 
113
-		if( !in_array( $error, self::$errors ) ) {
114
-			self::$errors[] = $error;
113
+		if ( ! in_array( $error, self::$errors ) ) {
114
+			self::$errors[ ] = $error;
115 115
 		}
116 116
 
117
-		if ( class_exists("GFLogging") ) {
117
+		if ( class_exists( "GFLogging" ) ) {
118 118
 		    GFLogging::include_logger();
119
-		    GFLogging::log_message( 'gravityview', $function ( $message, true ) . $function ( $error, true), KLogger::ERROR );
119
+		    GFLogging::log_message( 'gravityview', $function( $message, true ) . $function( $error, true ), KLogger::ERROR );
120 120
 		}
121 121
 	}
122 122
 
Please login to merge, or discard this patch.
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.