MaxtDesign

Developer Guide

Filters and actions

The plugin exposes public extension points (all prefixed md_usmaps_):

  • md_usmaps_sanitize_config — validate or attach data to a map config on save
  • md_usmaps_runtime_data — add keys to the JSON the front-end runtime reads
  • md_usmaps_area_template_html — append content to an area's tooltip or lightbox template
  • md_usmaps_pack_sources — register additional pack directories (the Pro add-on uses this)
  • md_usmaps_enqueue_frontend (action) — fires when a map's assets are enqueued, so add-ons can enqueue their own
  • Storage

    Maps are a custom post type (md_usmaps_map). Each map's config is stored as JSON in a custom table ({prefix}md_usmaps_maps), object-cached, with a separate snapshot table ({prefix}md_usmaps_legacy) that records imported legacy data so the plugin owns it independently of the old plugin.

    REST API

    The editor talks to a first-party REST namespace, md-usmaps/v1, with per-post capability checks and nonce protection. Pack geometry is read-only and public; everything that writes a map requires edit_post on that map.

    Packs

    A pack is data only: geometry.svg (the boundary paths), areas.json (keys, labels, indices), and meta.json. The free plugin ships us-states and us-regions. Add-ons register more packs through md_usmaps_pack_sources.