Completed
Pull Request — master (#605)
by Zack
05:45
created
includes/widgets/register-gravityview-widgets.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -20,18 +20,18 @@
 block discarded – undo
20 20
  */
21 21
 function gravityview_register_gravityview_widgets() {
22 22
 
23
-	include_once( GRAVITYVIEW_DIR .'includes/widgets/class-gravityview-widget.php' );
23
+	include_once(GRAVITYVIEW_DIR.'includes/widgets/class-gravityview-widget.php');
24 24
 
25
-	include_once( GRAVITYVIEW_DIR .'includes/widgets/class-gravityview-widget-pagination-info.php' );
26
-	include_once( GRAVITYVIEW_DIR .'includes/widgets/class-gravityview-widget-page-links.php' );
27
-	include_once( GRAVITYVIEW_DIR .'includes/widgets/class-gravityview-widget-custom-content.php' );
28
-	include_once( GRAVITYVIEW_DIR .'includes/widgets/search-widget/class-search-widget.php' );
25
+	include_once(GRAVITYVIEW_DIR.'includes/widgets/class-gravityview-widget-pagination-info.php');
26
+	include_once(GRAVITYVIEW_DIR.'includes/widgets/class-gravityview-widget-page-links.php');
27
+	include_once(GRAVITYVIEW_DIR.'includes/widgets/class-gravityview-widget-custom-content.php');
28
+	include_once(GRAVITYVIEW_DIR.'includes/widgets/search-widget/class-search-widget.php');
29 29
 
30
-	if( class_exists('GFPolls') ) {
31
-		include_once( GRAVITYVIEW_DIR .'includes/widgets/poll/class-gravityview-widget-poll.php' );
30
+	if (class_exists('GFPolls')) {
31
+		include_once(GRAVITYVIEW_DIR.'includes/widgets/poll/class-gravityview-widget-poll.php');
32 32
 	}
33 33
 
34 34
 }
35 35
 
36 36
 // Load default widgets
37
-add_action( 'init', 'gravityview_register_gravityview_widgets', 11 );
38 37
\ No newline at end of file
38
+add_action('init', 'gravityview_register_gravityview_widgets', 11);
39 39
\ No newline at end of file
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">
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="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.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'] ); ?>" 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-date_range.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -13,11 +13,11 @@
 block discarded – undo
13 13
 ?>
14 14
 
15 15
 <div class="gv-search-box gv-search-date">
16
-	<?php if( ! gv_empty( $label, 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)) { ?>
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.
includes/widgets/search-widget/templates/search-field-entry_date.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -13,11 +13,11 @@
 block discarded – undo
13 13
 ?>
14 14
 
15 15
 <div class="gv-search-box gv-search-date">
16
-	<?php if( ! gv_empty( $label, false ) ) { ?>
17
-	<label for="gv_start_date_<?php echo $view_id; ?>"><?php echo esc_html( $label ); ?></label>
16
+	<?php if (!gv_empty($label, false)) { ?>
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-entry_id.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,8 +13,8 @@
 block discarded – undo
13 13
 
14 14
 <div class="gv-search-box">
15 15
 	<div class="gv-search">
16
-		<?php if( ! gv_empty( $label, false ) ) { ?>
17
-		<label for="gv_entry_id_<?php echo $view_id; ?>"><?php echo esc_html( $label ); ?></label>
16
+		<?php if (!gv_empty($label, false)) { ?>
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>
20 20
 	</div>
Please login to merge, or discard this patch.
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 1 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.