Mashup map > post__in not working
-
Dear,
I am using the mashup functionality. I allow visitors to make a search on zip and another variable. I obtain the post IDs of the result of the query and I want to display the search result on a mashup map, but the pronamic mashup code doesn’t work with post__in neither include.
My search result returns a string of following post ids : 3901, 3900, 3898, 3703, 3699, 3519, 3470, 3912.
post__in requires an array. To convert my string to an array I use following code:
$googleIDS = explode(', ', $string);
But it doesn’t work.
If I hard code the array as follow
array(3901, 3900, 3898, 3703, 3699, 3519, 3470, 3912)
then it works.
I also tried to replace'post__in' => $googleIDS,
by'include' => $string,
but it doesn’t work neither.
Here is my codeif ( function_exists( 'pronamic_google_maps_mashup' ) ) { pronamic_google_maps_mashup( array( 'post_type' => 'cpt', 'post__in' => $googleIDS, ), array( 'width' => '100%', 'height' => 400, 'map_type_id' => 'roadmap', 'marker_options' => array( 'icon' => 'https://www.mywebsite.com/mymarker.png', 'latitude' => 52, 'longitude' => 8, 'zoom' => 4, 'fit_bounds' => false, ), ) ); } } showProfessionnels( $atts );
Any help hardly appreciate.
- The topic ‘Mashup map > post__in not working’ is closed to new replies.