Releases: pixelwatt/cmb2-mapbox
Release list
v2.0.0-beta1
Method Theme Integration
The plugin can now register its settings inside the Method theme's unified options page instead of its own admin page. Enable via:
add_filter( 'cmb2_mapbox_use_method', '__return_true' );When the filter returns true:
- The standalone "CMB2 Mapbox" options page is suppressed.
- A new
cmb2_mapbox_register_custom_options()callback hooks intomethod_options_before_fieldsand appends the Access Token and Map Center fields to Method's options. - All option reads pull from the
method_optionsoption key instead ofcmb2_mapbox.
⚠️ Breaking — Option Key Renames
The two stored option keys have been renamed to be namespace-safe when sharing an option array with other Method modules:
| Old | New |
|---|---|
api_token |
mapbox_api_token |
map_center |
mapbox_map_center |
Existing standalone installs will need to re-enter their access token and map center (or migrate the values manually) after upgrading.
Geocoding on Save
New cmb2_mapbox_geocode( $pid, $kdata, $serialized ) helper performs a forward geocode against the Mapbox Search/Geocode v6 API using the plugin's access token.
- New field arg
geocode_serialized_keypoints at a post meta key containing a serialized address array (e.g. street/city/state/zip). When set, the field UI renders a Geocode on Save checkbox. - Ticking the checkbox before saving will look up the linked address, then overwrite the field's
lng,lat, andlnglatvalues with the geocoded coordinates. - The sanitize callback (
cmb2_sanitize_mapbox_map_callback) now receives$object_id,$field_args, and$field(signature widened from 2 args to 5; filter priority moved from10to48).
Library Updates
- Mapbox GL JS: 3.18.0 → 3.23.1
- mapbox-gl-draw: 1.4.3 → 1.5.1
Internal
get_option()calls now route through a singlecmb2_mapbox_method()check so the option key resolves correctly in both standalone and Method-integrated modes.CMB2_MB_Map::set_options()defaults updated to the new option key names.
1.5.3
1.5.1
Changes:
- Added key "pitch" to the set_map_options() method for specifying a map's pitch when using the CMB2_MB_Map php class to build a map.
- Added lnglat sanitization. Now, spaces are removed from the combined lnglate field if present, the lnglat field will automatically be filled with individual lng and lat values if they are specified but lnglat is not, and individual lng and lat values will be filled if lnglat has been specified by indivual values have not.
1.5.0
Added CMB2_MB_Map, map center fallbacks, better array key checks, and option to set default editor zoom.
1.0.3
1.0.2
Input ID fix.
This version fixes references to hidden input IDs that caused the field to not place markers unless the meta key was set as "map"