Title: Query by sub_admin_code
Last modified: August 22, 2016

---

# Query by sub_admin_code

 *  Resolved [RaffaelT](https://wordpress.org/support/users/raffaelt/)
 * (@raffaelt)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/query-by-sub_admin_code/)
 * Hi Dylan,
 * First of all, thank you for this great plugin !
 * I easily managed to query locations by sub_admin_code by adding ‘sub_admin_code’
   => null, at line 33
    AND sub_admin_code in $where_fields, at line 134 in gm-location-
   query.php.
 * But each time the plugin is updated, I need to add those lines again.
 * So I was wondering if you could please add this feature.
 * That would be really nice to you.
 * [https://wordpress.org/plugins/geo-mashup/](https://wordpress.org/plugins/geo-mashup/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Dylan Kuhn](https://wordpress.org/support/users/cyberhobo/)
 * (@cyberhobo)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/query-by-sub_admin_code/#post-5447563)
 * Sure, I don’t think there’s any harm in that. I think I didn’t offer it by default
   because sub_admin_code is often not included in geocoding results, so may not
   be as reliable as the other fields. Let’s track progress here:
 * [https://code.google.com/p/wordpress-geo-mashup/issues/detail?id=701&thanks=701&ts=1415125573](https://code.google.com/p/wordpress-geo-mashup/issues/detail?id=701&thanks=701&ts=1415125573)
 *  Thread Starter [RaffaelT](https://wordpress.org/support/users/raffaelt/)
 * (@raffaelt)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/query-by-sub_admin_code/#post-5447578)
 * Thank you Dylan !
 * You are absolutely right. In many cases, queries on the sub_admin_code field 
   are not as reliable as we would expect. But the adresses I have to filter are
   all located in Paris or its suburbs, and the information provided by Google is
   quite good in this area.
 * I tried more complex queries in order to achieve the same goal, but results were
   even less reliable. That’s why I finally decided to modify your code. Simpler
   query, better results !
 *  Plugin Author [Dylan Kuhn](https://wordpress.org/support/users/cyberhobo/)
 * (@cyberhobo)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/query-by-sub_admin_code/#post-5447700)
 * GeoMashup 1.8.2 includes this change.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Query by sub_admin_code’ is closed to new replies.

 * ![](https://ps.w.org/geo-mashup/assets/icon.svg?rev=1631806)
 * [Geo Mashup](https://wordpress.org/plugins/geo-mashup/)
 * [Support Threads](https://wordpress.org/support/plugin/geo-mashup/)
 * [Active Topics](https://wordpress.org/support/plugin/geo-mashup/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/geo-mashup/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/geo-mashup/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Dylan Kuhn](https://wordpress.org/support/users/cyberhobo/)
 * Last activity: [11 years, 5 months ago](https://wordpress.org/support/topic/query-by-sub_admin_code/#post-5447700)
 * Status: resolved