Completed
Branch master (3ac4b1)
by Zack
04:30
created
includes/widgets/search-widget/templates/search-field-hidden.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,4 +7,4 @@
 block discarded – undo
7 7
 
8 8
 $gravityview_view = GravityView_View::getInstance();
9 9
 $search_field = $gravityview_view->search_field;
10
-?><div><input type="hidden" name="<?php echo esc_attr( $search_field['name'] ); ?>" value="<?php echo esc_attr( $search_field['value'] ); ?>"></div>
11 10
\ No newline at end of file
11
+?><div><input type="hidden" name="<?php echo esc_attr($search_field['name']); ?>" value="<?php echo esc_attr($search_field['value']); ?>"></div>
12 12
\ No newline at end of file
Please login to merge, or discard this patch.
includes/widgets/search-widget/templates/search-field-input_text.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">
14
-	<?php if( ! gv_empty( $search_field['label'], 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)) { ?>
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'] ); ?>">
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']); ?>">
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-link.php 2 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -39,22 +39,22 @@
 block discarded – undo
39 39
 
40 40
         <?php
41 41
 
42
-        $search_value = rgget( $search_field['name'] );
42
+		$search_value = rgget( $search_field['name'] );
43 43
 
44
-        foreach ( $search_field['choices'] as $k => $choice ) {
44
+		foreach ( $search_field['choices'] as $k => $choice ) {
45 45
 
46
-            if ( 0 != $k ) {
47
-                echo esc_html( $links_sep );
48
-            }
46
+			if ( 0 != $k ) {
47
+				echo esc_html( $links_sep );
48
+			}
49 49
 
50
-            $active = ( '' !== $search_value && in_array( $search_value, array( $choice['text'], $choice['value'] ) ) ) ? ' class="active"' : false;
50
+			$active = ( '' !== $search_value && in_array( $search_value, array( $choice['text'], $choice['value'] ) ) ) ? ' class="active"' : false;
51 51
 
52
-            if ( $active ) {
53
-                $link = remove_query_arg( array( 'pagenum', $search_field['name'] ), $base_url );
54
-            } else {
55
-                $link = add_query_arg( array( $search_field['name'] => urlencode( $choice['value'] ) ), remove_query_arg( array('pagenum'), $base_url ) );
56
-            }
57
-            ?>
52
+			if ( $active ) {
53
+				$link = remove_query_arg( array( 'pagenum', $search_field['name'] ), $base_url );
54
+			} else {
55
+				$link = add_query_arg( array( $search_field['name'] => urlencode( $choice['value'] ) ), remove_query_arg( array('pagenum'), $base_url ) );
56
+			}
57
+			?>
58 58
 
59 59
 			<a href="<?php echo esc_url_raw( $link ); ?>" <?php echo $active; ?>><?php echo esc_html( $choice['text'] ); ?></a>
60 60
 
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -13,8 +13,8 @@  discard block
 block discarded – undo
13 13
 $base_url = GravityView_Widget_Search::get_search_form_action();
14 14
 
15 15
 // Make sure that there are choices to display
16
-if ( empty( $search_field['choices'] ) ) {
17
-	do_action( 'gravityview_log_debug', 'search-field-link.php - No choices for field' );
16
+if (empty($search_field['choices'])) {
17
+	do_action('gravityview_log_debug', 'search-field-link.php - No choices for field');
18 18
 	return;
19 19
 }
20 20
 
@@ -22,41 +22,41 @@  discard block
 block discarded – undo
22 22
  * @filter `gravityview/extension/search/links_sep` Change the label for the "Link" search bar input type
23 23
  * @param string $links_label Default: `Show only:`
24 24
  */
25
-$links_label = apply_filters( 'gravityview/extension/search/links_label', __( 'Show only:', 'gravityview' ) );
25
+$links_label = apply_filters('gravityview/extension/search/links_label', __('Show only:', 'gravityview'));
26 26
 
27 27
 /**
28 28
  * @filter `gravityview/extension/search/links_sep` Change what separates search bar "Link" input type links
29 29
  * @param string $links_sep Default: `&nbsp;|&nbsp;` Used to connect multiple links
30 30
  */
31
-$links_sep = apply_filters( 'gravityview/extension/search/links_sep', '&nbsp;|&nbsp;' );
31
+$links_sep = apply_filters('gravityview/extension/search/links_sep', '&nbsp;|&nbsp;');
32 32
 
33 33
 ?>
34 34
 
35 35
 <div class="gv-search-box">
36 36
 
37 37
 	<p class="gv-search-box-links">
38
-		<?php echo esc_html( $links_label ); ?>
38
+		<?php echo esc_html($links_label); ?>
39 39
 
40 40
         <?php
41 41
 
42
-        $search_value = rgget( $search_field['name'] );
42
+        $search_value = rgget($search_field['name']);
43 43
 
44
-        foreach ( $search_field['choices'] as $k => $choice ) {
44
+        foreach ($search_field['choices'] as $k => $choice) {
45 45
 
46
-            if ( 0 != $k ) {
47
-                echo esc_html( $links_sep );
46
+            if (0 != $k) {
47
+                echo esc_html($links_sep);
48 48
             }
49 49
 
50
-            $active = ( '' !== $search_value && in_array( $search_value, array( $choice['text'], $choice['value'] ) ) ) ? ' class="active"' : false;
50
+            $active = ('' !== $search_value && in_array($search_value, array($choice['text'], $choice['value']))) ? ' class="active"' : false;
51 51
 
52
-            if ( $active ) {
53
-                $link = remove_query_arg( array( 'pagenum', $search_field['name'] ), $base_url );
52
+            if ($active) {
53
+                $link = remove_query_arg(array('pagenum', $search_field['name']), $base_url);
54 54
             } else {
55
-                $link = add_query_arg( array( $search_field['name'] => urlencode( $choice['value'] ) ), remove_query_arg( array('pagenum'), $base_url ) );
55
+                $link = add_query_arg(array($search_field['name'] => urlencode($choice['value'])), remove_query_arg(array('pagenum'), $base_url));
56 56
             }
57 57
             ?>
58 58
 
59
-			<a href="<?php echo esc_url_raw( $link ); ?>" <?php echo $active; ?>><?php echo esc_html( $choice['text'] ); ?></a>
59
+			<a href="<?php echo esc_url_raw($link); ?>" <?php echo $active; ?>><?php echo esc_html($choice['text']); ?></a>
60 60
 
61 61
 		<?php } ?>
62 62
 	</p>
Please login to merge, or discard this patch.
includes/widgets/search-widget/templates/search-field-multiselect.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Display the search MULTISELECT input field
4
- *
5
- * @see class-search-widget.php
6
- */
3
+			 * Display the search MULTISELECT input field
4
+			 *
5
+			 * @see class-search-widget.php
6
+			 */
7 7
 
8 8
 $gravityview_view = GravityView_View::getInstance();
9 9
 $view_id = $gravityview_view->getViewId();
Please login to merge, or discard this 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-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
 
18 18
 ?>
19 19
 <div class="gv-search-box">
20
-	<?php if( ! gv_empty( $search_field['label'], 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)) { ?>
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
-		<select name="<?php echo esc_attr( $search_field['name'] ); ?>[]" id="search-box-<?php echo esc_attr( $search_field['name'] ); ?>" multiple>
25
-			<option value="" <?php gv_selected( '', $search_field['value'], true ); ?>>&mdash;</option>
24
+		<select name="<?php echo esc_attr($search_field['name']); ?>[]" id="search-box-<?php echo esc_attr($search_field['name']); ?>" multiple>
25
+			<option value="" <?php gv_selected('', $search_field['value'], true); ?>>&mdash;</option>
26 26
 			<?php
27
-			foreach( $search_field['choices'] as $choice ) : ?>
28
-				<option value="<?php echo esc_attr( $choice['value'] ); ?>" <?php gv_selected( $choice['value'], $search_field['value'], true ); ?>><?php echo esc_html( $choice['text'] ); ?></option>
27
+			foreach ($search_field['choices'] as $choice) : ?>
28
+				<option value="<?php echo esc_attr($choice['value']); ?>" <?php gv_selected($choice['value'], $search_field['value'], true); ?>><?php echo esc_html($choice['text']); ?></option>
29 29
 			<?php endforeach; ?>
30 30
 		</select>
31 31
 	</p>
Please login to merge, or discard this patch.
includes/widgets/search-widget/templates/search-field-radio.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Display the search RADIO input field
4
- *
5
- * @see class-search-widget.php
6
- */
3
+			 * Display the search RADIO input field
4
+			 *
5
+			 * @see class-search-widget.php
6
+			 */
7 7
 
8 8
 $gravityview_view = GravityView_View::getInstance();
9 9
 $view_id = $gravityview_view->getViewId();
Please login to merge, or discard this 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">
20
-	<?php if( ! gv_empty( $search_field['label'], 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)) { ?>
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-search_all.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,8 +14,8 @@
 block discarded – undo
14 14
 
15 15
 <div class="gv-search-box">
16 16
 	<div class="gv-search">
17
-	<?php if( ! gv_empty( $label, false ) ) { ?>
18
-		<label for="gv_search_<?php echo $view_id; ?>"><?php echo esc_html( $label ); ?></label>
17
+	<?php if (!gv_empty($label, false)) { ?>
18
+		<label for="gv_search_<?php echo $view_id; ?>"><?php echo esc_html($label); ?></label>
19 19
 	<?php } ?>
20 20
 		<p><input type="text" name="gv_search" id="gv_search_<?php echo $view_id; ?>" value="<?php echo $value; ?>" /></p>
21 21
 	</div>
Please login to merge, or discard this patch.
includes/widgets/search-widget/templates/search-field-select.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-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
 
18 18
 ?>
19 19
 <div class="gv-search-box">
20
-	<?php if( ! gv_empty( $search_field['label'], 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)) { ?>
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
-		<select name="<?php echo esc_attr( $search_field['name'] ); ?>" id="search-box-<?php echo esc_attr( $search_field['name'] ); ?>">
25
-			<option value="" <?php selected( '', $search_field['value'], true ); ?>>&mdash;</option>
24
+		<select name="<?php echo esc_attr($search_field['name']); ?>" id="search-box-<?php echo esc_attr($search_field['name']); ?>">
25
+			<option value="" <?php selected('', $search_field['value'], true); ?>>&mdash;</option>
26 26
 			<?php
27
-			foreach( $search_field['choices'] as $choice ) : ?>
28
-				<option value="<?php echo esc_attr( $choice['value'] ); ?>" <?php selected( $choice['value'], $search_field['value'], true ); ?>><?php echo esc_html( $choice['text'] ); ?></option>
27
+			foreach ($search_field['choices'] as $choice) : ?>
28
+				<option value="<?php echo esc_attr($choice['value']); ?>" <?php selected($choice['value'], $search_field['value'], true); ?>><?php echo esc_html($choice['text']); ?></option>
29 29
 			<?php endforeach; ?>
30 30
 		</select>
31 31
 	</p>
Please login to merge, or discard this patch.
includes/widgets/search-widget/templates/search-field-single_checkbox.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Display the search single CHECKBOX input field ( on/off type)
4
- *
5
- * @see class-search-widget.php
6
- */
3
+			 * Display the search single CHECKBOX input field ( on/off type)
4
+			 *
5
+			 * @see class-search-widget.php
6
+			 */
7 7
 
8 8
 $gravityview_view = GravityView_View::getInstance();
9 9
 $view_id = $gravityview_view->getViewId();
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -12,8 +12,8 @@
 block discarded – undo
12 12
 ?>
13 13
 
14 14
 <div class="gv-search-box">
15
-	<label for="search-box-<?php echo esc_attr( $search_field['name'] ); ?>" class="gv-check-radio">
16
-		<input type="checkbox" name="<?php echo esc_attr( $search_field['name'] ); ?>" value="1" id="search-box-<?php echo esc_attr( $search_field['name'] ); ?>" <?php checked( '1', $search_field['value'], true ); ?>>
17
-			<?php if( ! gv_empty( $search_field['label'], false ) ) { echo esc_html(  $search_field['label'] ); } ?>
15
+	<label for="search-box-<?php echo esc_attr($search_field['name']); ?>" class="gv-check-radio">
16
+		<input type="checkbox" name="<?php echo esc_attr($search_field['name']); ?>" value="1" id="search-box-<?php echo esc_attr($search_field['name']); ?>" <?php checked('1', $search_field['value'], true); ?>>
17
+			<?php if (!gv_empty($search_field['label'], false)) { echo esc_html($search_field['label']); } ?>
18 18
 	</label>
19 19
 </div>
20 20
\ No newline at end of file
Please login to merge, or discard this patch.
includes/widgets/search-widget/templates/widget-search.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 
14 14
 ?>
15 15
 
16
-<form class="gv-widget-search <?php echo GravityView_Widget_Search::get_search_class(); ?>" method="get" action="<?php echo esc_url( GravityView_Widget_Search::get_search_form_action() ); ?>">
16
+<form class="gv-widget-search <?php echo GravityView_Widget_Search::get_search_class(); ?>" method="get" action="<?php echo esc_url(GravityView_Widget_Search::get_search_form_action()); ?>">
17 17
 
18 18
 	<?php
19 19
 
@@ -21,14 +21,14 @@  discard block
 block discarded – undo
21 21
 	 * @action `gravityview_search_widget_fields_before` Inside the `<form>` tag of the GravityView search form, before inputs are rendered
22 22
 	 * @param GravityView_Widget_Search $this GravityView Widget instance
23 23
 	 */
24
-	do_action( 'gravityview_search_widget_fields_before', $this );
24
+	do_action('gravityview_search_widget_fields_before', $this);
25 25
 
26
-	foreach( $this->search_fields as $search_field ) {
26
+	foreach ($this->search_fields as $search_field) {
27 27
 		$gravityview_view->search_field = $search_field;
28
-		$this->render( 'search-field', $search_field['input'], false );
28
+		$this->render('search-field', $search_field['input'], false);
29 29
 
30 30
 		// show/hide the search button if there are input type fields
31
-		if( !$has_inputs &&  $search_field['input'] != 'link' ) {
31
+		if (!$has_inputs && $search_field['input'] != 'link') {
32 32
 			$has_inputs = true;
33 33
 		}
34 34
 	}
@@ -37,9 +37,9 @@  discard block
 block discarded – undo
37 37
 	 * @action `gravityview_search_widget_fields_after` Inside the `<form>` tag of the GravityView search form, after inputs are rendered
38 38
 	 * @param GravityView_Widget_Search $this GravityView Widget instance
39 39
 	 */
40
-	do_action( 'gravityview_search_widget_fields_after', $this );
40
+	do_action('gravityview_search_widget_fields_after', $this);
41 41
 
42
-	if( $has_inputs ) { ?>
42
+	if ($has_inputs) { ?>
43 43
 		<div class="gv-search-box gv-search-box-submit">
44 44
 			<?php
45 45
 
@@ -47,8 +47,8 @@  discard block
 block discarded – undo
47 47
 			GravityView_Widget_Search::the_clear_search_button();
48 48
 
49 49
 			?>
50
-			<input type="hidden" name="mode" value="<?php echo esc_attr( $gravityview_view->search_mode ); ?>" />
51
-			<input type="submit" class="button gv-search-button" id="gv_search_button_<?php echo $view_id; ?>" value="<?php esc_attr_e( 'Search', 'gravityview' ); ?>" />
50
+			<input type="hidden" name="mode" value="<?php echo esc_attr($gravityview_view->search_mode); ?>" />
51
+			<input type="submit" class="button gv-search-button" id="gv_search_button_<?php echo $view_id; ?>" value="<?php esc_attr_e('Search', 'gravityview'); ?>" />
52 52
 		</div>
53 53
 	<?php } ?>
54 54
 </form>
Please login to merge, or discard this patch.