gmw_default_form_values
This filter is executed before the form or any of its elements ( search form, map or search results ) are being displayed. Use this filter to modify the default values of the form.
Usage
add_filter( 'gmw_default_form_values' , 'gmw_modify_form_values', 50, 1 );
Parameters
- $form ( array ) - the form that needs to be modified.
Examples
In this example, we modify the default map type of the form and set it to "TERRAIN".
function gmw_modify_default_map_type( $gmw ) { $gmw['results_map']['map_type'] = 'TERRAIN'; return $gmw; } add_filter( 'gmw_default_form_values', 'gmw_modify_default_map_type', 50 );
Placement
This code should be placed in the functions.php file of your active theme.
Source Code
The filter is located in GMW_Form::setup_defaults() in geo-my-wp/includes/class-gmw-form.php
Since
GEO my WP version 2.0.