Geodata is opt-in per post type. A post type gets the geo fields, the editor panel and REST meta only when it is public, is not attachment, and declares support for lh_places-geo_support:
add_post_type_support( 'my_post_type', 'lh_places-geo_support' );
GatherPress venues (gatherpress_venue) get this support automatically. Declare support on init before priority 9999, which is when the meta fields are registered. The candidate list of public post types can be narrowed or extended with the lh_places_get_applicable_post_types filter.
Block editor
A Geo Data panel appears in the document sidebar with these fields:
- Latitude and Longitude: WGS84 decimal degrees. Editing them regenerates a Point in the GeoJSON field.
- Address: free text.
- GeoJSON: any Feature, FeatureCollection or geometry, for lines, polygons and multi-part shapes.
- Use my location: fills latitude and longitude from the browser.
- Import from media: reads GPS coordinates from the EXIF data of the post’s attached images and uses the first usable pair. It falls back to the original upload when WordPress’s image metadata has no coordinates.
- Clear all: empties every geo field.
Classic editor
Posts edited in the classic editor get a Geo Data meta box in the sidebar with the same fields, Use my location, Clear, and a View on map link to OpenStreetMap.
Keeping points and GeoJSON in sync
When geo_json is saved through REST or the block editor and holds a single Point, its coordinates are copied back to geo_latitude and geo_longitude. Anything that reads the post’s geometry uses geo_json when it is set and builds a Point from latitude and longitude otherwise.
