|
FilterReference
Documentation on WordPress filters offered by Geo Mashup.
IntroductionJust like WordPress, some Geo Mashup data can be altered using filters. This is in the experimental phase in Geo Mashup 1.3, but hopefully will stabilize and grow. Filtersgeo_mashup_locations_json_objectAllows you to change the object data that gets sent to a map. Called once for each object. Arguments:
ExampleUse the saved name instead of the default object title (post_title for posts). function my_geo_mashup_locations_json_filter( $json_properties, $queried_object ) {
$json_properties['title'] = $queried_object->saved_name;
return $json_properties;
}
add_filter( 'geo_mashup_locations_json_object', 'my_geo_mashup_locations_json_filter', 10, 2 );Now you can access the data in custom javascript: GeoMashup.addAction( 'objectIcon', function( properties, object ) {
// Use a special icon for the saved location 'Swimming Pool'
if ( 'Swimming Pool' == object.title ) {
object.icon.image = properties.template_url_path + 'images/pool_icon.png';
}
} );geo_mashup_locations_fieldsModify the fields included in a map query. geo_mashup_locations_joinModify the tables joined in a map query. geo_mashup_locations_whereModify the where clause of a map query. geo_mashup_locations_orderbyModify the orderby clause of a map query. geo_mashup_locations_limitsModify the limit clause of a map query. | |