This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if ( ! function_exists( 'array_replace_recursive' ) ) { | |
| function array_replace_recursive($base, $replacements) { | |
| foreach (array_slice(func_get_args(), 1) as $replacements) { | |
| $bref_stack = array(&$base); | |
| $head_stack = array($replacements); | |
| do { | |
| end($bref_stack); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function gmw_map_options( $gmw ) { | |
| ?> | |
| <script> | |
| jQuery(document).ready(function($) { | |
| //declare new map options array for form ID 1 | |
| gmwMapOptions['1'] = []; | |
| gmwMapOptions['1']['styles'] = [ | |
| { | |
| "featureType": "water", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function gmw_map_styles( $gmw ) { | |
| ?> | |
| <script> | |
| jQuery(document).ready(function($) { | |
| //declare new map options array for form ID 1 | |
| gmwMapOptions['1'] = []; | |
| }); | |
| </script> | |
| <?php |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function gmw_orderby_filter( $clauses, $gmw ) { | |
| global $wpdb; | |
| //check if order-by value was submitted. If it was we will use its value otherwise we set the default value to 'distance' | |
| $orderby_value = ( isset( $_GET['gmw_orderby'] ) && !empty( $_GET['gmw_orderby'] ) ) ? $_GET['gmw_orderby'] : 'distance'; | |
| //check the value of the order-by and modify the clause based on that | |
| //when order-by distance | |
| if ( $orderby_value == 'distance' ) { | |
| /* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| geo-my-wp/plugins/posts/includes/gmw-pt-search-functions.php |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apply_filters( 'gmw_pt_location_query_clauses', $clauses, $this->form ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| do_action( 'gmw_search_form_before_distance', $gmw ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function gmw_orderby_dropdown( $gmw ) { | |
| //getting the chosen value so we could pre-select the selected value after page load | |
| $selected = ( isset( $_GET['gmw_orderby' ) && !empty( $_GET['gmw_orderby'] ) ) ? $_GET['gmw_orderby'] : ''; | |
| ?> | |
| <select class="gmw-orderby-dropdown" name="gmw_orderby"> | |
| <option value="distance" selected="selected">Distance</option> | |
| <option value="post_title" <?php if ( $selected == 'post_title' ) echo 'selected="selected"'; ?>>Alphabetically</option> | |
| <option value="post_date" <?php if ( $selected == 'post_date' ) echo 'selected="selected"'; ?>>Post Date</option> | |
| <option value="post_id" <?php if ( $selected == 'post_id' ) echo 'selected="selected"'; ?>>Post ID</option> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| gmw_orderby_dropdown( $gmw ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function gmw_orderby_dropdown( $gmw ) { | |
| //getting the chosen value so we could pre-select the selected value after page load | |
| $selected = ( isset( $_GET['gmw_orderby'] ) && !empty( $_GET['gmw_orderby'] ) ) ? $_GET['gmw_orderby'] : ''; | |
| ?> | |
| <select class="gmw-orderby-dropdown" name="gmw_orderby"> | |
| <option value="distance" selected="selected">Order By</option> | |
| <option value="distance" <?php if ( $selected == 'distance' ) echo 'selected="selected"'; ?>>Distance</option> | |
| <option value="post_title" <?php if ( $selected == 'post_title' ) echo 'selected="selected"'; ?>>Alphabetically</option> |