add_filter('get_city_id_by_name', function( $city ) {
global $wpdb;
-
+
if (is_string($city)) {
$citySql = "SELECT C.id FROM ".GLM_MEMBERS_PLUGIN_DB_PREFIX."cities C "
. "WHERE C.name = '$city' "
. "LIMIT 1"
. ";";
$city = $wpdb->get_var($citySql);
- }
+ }
return $city;
}, 10, 1);
add_filter('get_county_by_city', function( $city ) {
global $wpdb;
-
+
$sql = "SELECT C.id FROM ".GLM_MEMBERS_PLUGIN_DB_PREFIX."counties C "
. "WHERE C.id IN ("
. "SELECT M.county "
. ";";
$results = $wpdb->get_var($sql);
return $results;
-
+
}, 10, 1);
add_filter('glm-member-db-fields-front-list-query-params', function( $query ){
$queryParams = array();
}
}
}
-/*
+/*
* If a destination is searched for, display the ad for the city corresponding to that destination
* (e.g. Petoskey Area destination => Petoskey city => Petoskey Area CVB ad)
* If a city is searched for, if it is one of certain cities, display the ad for that city.
* If it is not one of those cities check the county associated with the city searched for
- * Otherwise, If a city is not searched for, check for the county that is searched for,
+ * Otherwise, If a city is not searched for, check for the county that is searched for,
* then display the ad for that county
- *
+ *
*/
function display_top_ads($city, $county, $destination) {
// To avoid duplicate code and ease maintenance, for destinations use the same ads that the cities use, below
break;
}
switch ($city) { // Find by city first, specific list given by client
- case 37: // Gaylord City
+ case 37: // Gaylord City
echo do_shortcode("[the_ad id='1182']"); // Show Gaylord Area CVB ad
break;
case 89: // Petoskey City
echo do_shortcode("[the_ad id='1180']"); // Show Petoskey Area CVB ad
break;
case 106: // Traverse City
- echo do_shortcode("[the_ad id='1186']"); // Show Traverse City CVB ad
+ echo do_shortcode("[the_ad id='1186']"); // Show Traverse City CVB ad
break;
default: // If a specific city override is not found, look at the county
switch ($county) {
break;
}
echo "<br>";
-}
\ No newline at end of file
+}
+
+add_filter( 'fallback_intermediate_image_sizes', '__return_empty_array' );