Since: 3.1.4
File: includes/wp-geo.php, includes/shortcodes.php
Param: $show_post_map Where to show map
Param: $post_id Post ID

The wpgeo_show_post_map filter allows you to override the default ‘Show Post Map’ setting. You can specify the following values:

  • TOP
  • Any other value to hide and use shortcode

The second parameter is the post id for the map that is showing. You could use this to find if the post is in a certain category and change the ‘Show Post Map’ setting for all posts in that category.


function my_wpgeo_show_post_map( $show_post_map, $post_id ) {
	// Show at the top for this post...
	if ( $post_id == 10 ) {
		return 'TOP';
	// ...otherwise return default
	return $show_post_map;
add_filter( 'wpgeo_show_post_map', 'my_wpgeo_show_post_map' );