@@ -34,11 +34,11 @@ |
||
| 34 | 34 | do_action( 'gravityview_search_widget_field_before', $widget, $search_field, $gravityview ); |
| 35 | 35 | |
| 36 | 36 | $template->push_template_data( $search_field, 'search_field' ); |
| 37 | - $template->get_template_part( 'field', $search_field['input'] ); |
|
| 37 | + $template->get_template_part( 'field', $search_field[ 'input' ] ); |
|
| 38 | 38 | $template->pop_template_data( 'search_field' ); |
| 39 | 39 | |
| 40 | 40 | // show/hide the search button if there are input type fields |
| 41 | - if ( ! $has_inputs && $search_field['input'] != 'link' ) { |
|
| 41 | + if ( ! $has_inputs && $search_field[ 'input' ] != 'link' ) { |
|
| 42 | 42 | $has_inputs = true; |
| 43 | 43 | } |
| 44 | 44 | |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | /** |
| 29 | 29 | * @action `gravityview_search_widget_field_before` Before each search input is rendered (other than the submit button) |
| 30 | 30 | * @param \GV\Widget $widget The widget. |
| 31 | - * @param array $search_field |
|
| 31 | + * @param array $search_field |
|
| 32 | 32 | * @param \GV\Template_Context $gravityview The context. |
| 33 | 33 | */ |
| 34 | 34 | do_action( 'gravityview_search_widget_field_before', $widget, $search_field, $gravityview ); |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | /** |
| 46 | 46 | * @action `gravityview_search_widget_field_after` After each search input is rendered (other than the submit button) |
| 47 | 47 | * @param \GV\Widget $widget The widget. |
| 48 | - * @param array $search_field |
|
| 48 | + * @param array $search_field |
|
| 49 | 49 | * @param \GV\Template_Context $gravityview The context. |
| 50 | 50 | */ |
| 51 | 51 | do_action( 'gravityview_search_widget_field_after', $widget, $search_field, $gravityview ); |
@@ -64,6 +64,6 @@ discard block |
||
| 64 | 64 | if ( gravityview()->request->is_search() ) { |
| 65 | 65 | echo sprintf( '<div class="gv-search-box gv-search-results">%s</div>', sprintf( __( 'Matches found: %d', 'gravityview' ), $gravityview->entries->total() ) ); |
| 66 | 66 | } |
| 67 | - } |
|
| 67 | + } |
|
| 68 | 68 | ?> |
| 69 | 69 | </form> |
@@ -23,9 +23,9 @@ |
||
| 23 | 23 | <p> |
| 24 | 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 } ?> |
@@ -15,11 +15,11 @@ |
||
| 15 | 15 | ?> |
| 16 | 16 | |
| 17 | 17 | <div class="gv-search-box gv-search-date gv-search-date-range gv-search-field-entry_date"> |
| 18 | - <?php if( ! gv_empty( $label, false, false ) ) { ?> |
|
| 18 | + <?php if ( ! gv_empty( $label, false, false ) ) { ?> |
|
| 19 | 19 | <label for="gv_start_date_<?php echo $gravityview->view->ID; ?>"><?php echo esc_html( $label ); ?></label> |
| 20 | 20 | <?php } ?> |
| 21 | 21 | <p> |
| 22 | - <input name="gv_start" id="gv_start_date_<?php echo $gravityview->view->ID; ?>" type="text" class="<?php echo esc_attr( $widget->datepicker_class ); ?>" placeholder="<?php esc_attr_e('Start date', 'gravityview' ); ?>" value="<?php echo $value['start']; ?>"> |
|
| 23 | - <input name="gv_end" id="gv_end_date_<?php echo $gravityview->view->ID; ?>" type="text" class="<?php echo esc_attr( $widget->datepicker_class ); ?>" placeholder="<?php esc_attr_e('End date', 'gravityview' ); ?>" value="<?php echo $value['end']; ?>"> |
|
| 22 | + <input name="gv_start" id="gv_start_date_<?php echo $gravityview->view->ID; ?>" type="text" class="<?php echo esc_attr( $widget->datepicker_class ); ?>" placeholder="<?php esc_attr_e( 'Start date', 'gravityview' ); ?>" value="<?php echo $value[ 'start' ]; ?>"> |
|
| 23 | + <input name="gv_end" id="gv_end_date_<?php echo $gravityview->view->ID; ?>" type="text" class="<?php echo esc_attr( $widget->datepicker_class ); ?>" placeholder="<?php esc_attr_e( 'End date', 'gravityview' ); ?>" value="<?php echo $value[ 'end' ]; ?>"> |
|
| 24 | 24 | </p> |
| 25 | 25 | </div> |
@@ -17,15 +17,15 @@ |
||
| 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 ) ) { ?> |
|
| 20 | + <?php if ( ! gv_empty( $search_field->label, false, false ) ) { ?> |
|
| 21 | 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 } ?> |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | ?> |
| 12 | 12 | |
| 13 | 13 | <div class="gv-search-box gv-search-date"> |
| 14 | - <?php if( ! gv_empty( $search_field->label, false, false ) ) { ?> |
|
| 14 | + <?php if ( ! gv_empty( $search_field->label, false, false ) ) { ?> |
|
| 15 | 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> |
@@ -47,22 +47,22 @@ |
||
| 47 | 47 | |
| 48 | 48 | <?php |
| 49 | 49 | |
| 50 | - $search_value = \GV\Utils::_GET( $search_field->name ); |
|
| 50 | + $search_value = \GV\Utils::_GET( $search_field->name ); |
|
| 51 | 51 | |
| 52 | - foreach ( $search_field->choices as $k => $choice ) { |
|
| 52 | + foreach ( $search_field->choices as $k => $choice ) { |
|
| 53 | 53 | |
| 54 | - if ( 0 != $k ) { |
|
| 55 | - echo esc_html( $links_sep ); |
|
| 56 | - } |
|
| 54 | + if ( 0 != $k ) { |
|
| 55 | + echo esc_html( $links_sep ); |
|
| 56 | + } |
|
| 57 | 57 | |
| 58 | - $active = ( '' !== $search_value && in_array( $search_value, array( $choice['text'], $choice['value'] ) ) ) ? ' class="active"' : false; |
|
| 58 | + $active = ( '' !== $search_value && in_array( $search_value, array( $choice['text'], $choice['value'] ) ) ) ? ' class="active"' : false; |
|
| 59 | 59 | |
| 60 | - if ( $active ) { |
|
| 61 | - $link = remove_query_arg( array( 'pagenum', $search_field->name ), $base_url ); |
|
| 62 | - } else { |
|
| 63 | - $link = add_query_arg( array( $search_field->name => urlencode( $choice['value'] ) ), remove_query_arg( array('pagenum'), $base_url ) ); |
|
| 64 | - } |
|
| 65 | - ?> |
|
| 60 | + if ( $active ) { |
|
| 61 | + $link = remove_query_arg( array( 'pagenum', $search_field->name ), $base_url ); |
|
| 62 | + } else { |
|
| 63 | + $link = add_query_arg( array( $search_field->name => urlencode( $choice['value'] ) ), remove_query_arg( array('pagenum'), $base_url ) ); |
|
| 64 | + } |
|
| 65 | + ?> |
|
| 66 | 66 | |
| 67 | 67 | <a href="<?php echo esc_url_raw( $link ); ?>" <?php echo $active; ?>><?php echo esc_html( $choice['text'] ); ?></a> |
| 68 | 68 | |
@@ -55,16 +55,16 @@ |
||
| 55 | 55 | echo esc_html( $links_sep ); |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | - $active = ( '' !== $search_value && in_array( $search_value, array( $choice['text'], $choice['value'] ) ) ) ? ' class="active"' : false; |
|
| 58 | + $active = ( '' !== $search_value && in_array( $search_value, array( $choice[ 'text' ], $choice[ 'value' ] ) ) ) ? ' class="active"' : false; |
|
| 59 | 59 | |
| 60 | 60 | if ( $active ) { |
| 61 | 61 | $link = remove_query_arg( array( 'pagenum', $search_field->name ), $base_url ); |
| 62 | 62 | } else { |
| 63 | - $link = add_query_arg( array( $search_field->name => urlencode( $choice['value'] ) ), remove_query_arg( array('pagenum'), $base_url ) ); |
|
| 63 | + $link = add_query_arg( array( $search_field->name => urlencode( $choice[ 'value' ] ) ), remove_query_arg( array( 'pagenum' ), $base_url ) ); |
|
| 64 | 64 | } |
| 65 | 65 | ?> |
| 66 | 66 | |
| 67 | - <a href="<?php echo esc_url_raw( $link ); ?>" <?php echo $active; ?>><?php echo esc_html( $choice['text'] ); ?></a> |
|
| 67 | + <a href="<?php echo esc_url_raw( $link ); ?>" <?php echo $active; ?>><?php echo esc_html( $choice[ 'text' ] ); ?></a> |
|
| 68 | 68 | |
| 69 | 69 | <?php } ?> |
| 70 | 70 | </p> |
@@ -10,7 +10,7 @@ |
||
| 10 | 10 | */ |
| 11 | 11 | ?> |
| 12 | 12 | <div class="gv-search-box gv-search-field-text"> |
| 13 | - <?php if( ! gv_empty( $search_field->label, false, false ) ) { ?> |
|
| 13 | + <?php if ( ! gv_empty( $search_field->label, false, false ) ) { ?> |
|
| 14 | 14 | <label for="search-box-<?php echo esc_attr( $search_field->name ); ?>"><?php echo esc_html( $search_field->label ); ?></label> |
| 15 | 15 | <?php } ?> |
| 16 | 16 | <p> |