ReversedK edited this page Aug 16, 2016 · 4 revisions

The Addon Helper Class doesn't provide a wrapper for every hook in LocateAnything. Here are some hooks you can use if needed.

Hook : locate_anything_marker_params

Description : Alters the "low level" params of the markers such as latitude, longitude, address, etc...before generation of the JSON.

[array] $marker_params : variables and respective values of the current marker [int] $map_id : Map ID
[int] $marker_id : marker ID
[string] $type : Post type (or 'user') or 'all'. Determines the scope.

Return : $marker_params


function alter_marker_params($marker_params,$marker_id,$map_id){  
	/* only for users */	
	if($post_params["post_type"]!=='user') return $post_params;	
	/* No latlon?*/
	if(empty($post_params["locate-anything-lat"]) || empty($post_params["locate-anything-lon"])) {		
	/* code  to get the lat/lon for marker... */
	return $marker_params

Hook : locate_anything_find_markers_query_args

Description : Alter parameters of the find query. Those parameters will be used in a query_posts call by LocateAnything_Tools::findSomething()

[array] $query_args : query parameters
[array] $settings : current map settings

Return : $query_args


function locate_anything_alter_query($query_args,$settings){
	if($settings['locate-anything-source']=="recipe") {
		$query_args['post_status'] = 'draft';
	return $query_args;
Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.