Yesterday was GIS Day, according to Esri, which makes today PostGIS day! To celebrate the two special days it seemed appropriate to release a new version of WP-GeoMeta. The main new feature of WP-GeoMeta version 0.2.2 is support for separate latitude and longitude meta fields.
When plugin developers want to implement location information they tend to implement it with separate latitude and longitude fields. If they do any spatial searching it’s using trigonometry functions and custom queries.
WordPress itself supports method of storing spatial points, it’s the WordPress Geodata standard, with key names geo_latitude and geo_longitude.
Starting with version 0.2.2 WP-GeoMeta supports the WordPress Geodata standard out of the box, and additional key name pairs can be added as simply as calling:
// WP_GeoMeta::add_latlng_field( <latitude field name>, <longitude field name>, <spatial meta_key name> ); WP_GeoMeta::add_latlng_field( 'myplugin_lat', 'myplugin_lng', 'myplugin_geo' );
A few new hooks were added in this release as well. Documentation for WP_GeoMeta::add_latlng_field and the new hooks can be found on on GitHub.