Reply To: Changed API > Need Mashup based on custom fields

Home Forums MapPress Support Changed API > Need Mashup based on custom fields Reply To: Changed API > Need Mashup based on custom fields

#19623
jcdesign
Participant

Hi Chris,

I’m circling back to this, still somewhat stuck. (BTW, my post type is “is”, that may have confused you earlier!)

I see that the mappress_post_query filter is run via AJAX. That seems like I could then manipulate on the fly from the front end — is that correct? And if so, is there any chance you can supply a short code example showing how to interact with the filter?

This is a very simplified version of what I have so far:

class MyMapClass {

public function __construct() {
add_filter( ‘mappress_post_query’, array( $this, ‘filter_map’ ), 10, 2 );
}

/**
* @param Mappress_Map $map
* @param array $args
*
* @return Mappress_Map
*/
public function filter_map( $map, $args ) {

// Do stuff here
$map->pois = [ ‘foo’ ]; // TESTING filter  to see if I can break things – no changes

return $map;
}

}

new MyMapClass();

I’m not seeing any effect on the maps I’ve generated via PHP. Any guidance would be appreciated — thank you.