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_state_filter( $clauses, $gmw ) { | |
| global $wpdb; | |
| /* | |
| * we first do a form check to make sure we only filter the search form that we want. | |
| * for this example I will use form with ID 1 | |
| */ | |
| if ( $gmw['ID'] != 1 ) | |
| return $clauses; |
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_states_dropdown( $gmw ) { | |
| global $wpdb; | |
| //get states exist in locations table in database | |
| //Note that DISTINCT is being used to make sure each state called only once. | |
| $states = $wpdb->get_col(" | |
| SELECT DISTINCT `state_long` | |
| FROM {$wpdb->prefix}places_locator | |
| WHERE `state_long` IS NOT NULL |
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
| gmw_states_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
| function gmw_states_dropdown( $gmw ) { | |
| global $wpdb; | |
| //get states exist in locations table in database | |
| //Note that DISTINCT is being used to make sure each state called only once. | |
| $states = $wpdb->get_col(" | |
| SELECT DISTINCT `state_long` | |
| FROM {$wpdb->prefix}places_locator | |
| WHERE `state_long` IS NOT NULL |
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_single_location] |
NewerOlder