This repo shows how to use the hooks provided by WP Google Maps to add your own filtering widgets.
Please note the distinction between a "filter" (logic) and a "filtering widget" (UI).
- Define a class extending
\WPGMZA\CustomFieldFilterWidget
see here - Add a filter on
wpgmza_get_custom_field_filter_widget
, returning an instance of your widget when the input$filter
requests it by filter type. - Add a filter on
wpgmza_custom_fields_widget_type_options
, returning an<option>
element. This will allow the user to select your widget from the widget type dropdown.
- Define a class extending
\WPGMZA\CustomFieldFilter
see here - Override the
getFilteringSQL
method in this class. It receives the$value
passed from the user, and should return a statement prepared by$wpdb->prepare
. - Add a filter on
wpgmza_get_custom_field_filter
, returning an instance of this class when the input$filter
requests it by filter type.