Title: Conditional test for single map ?
Last modified: July 8, 2021

---

# Conditional test for single map ?

 *  Resolved [aljuk](https://wordpress.org/support/users/aljuk/)
 * (@aljuk)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/conditional-test-for-single-map/)
 * I need to check if a map exists for a single post, eg.
 * if(single_map_esists($post->ID)) {
    // do something }
 * Is there a built-in conditional for this?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Eyal Fitoussi](https://wordpress.org/support/users/ninjew/)
 * (@ninjew)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/conditional-test-for-single-map/#post-14639956)
 * Hello [@aljuk](https://wordpress.org/support/users/aljuk/),
 * You can probably use the function:
 *     ```
       gmw_get_post_location( $post->ID );
       ```
   
 * The function will try to get the location of a post. If it returns empty it means
   that the post does not have a location.
 * So something like:
 *     ```
       $post_location = gmw_get_post_location( $post->ID );
   
       if ( ! empty( $post_location ) ) {
           // do something.
       }
       ```
   
    -  This reply was modified 4 years, 11 months ago by [Eyal Fitoussi](https://wordpress.org/support/users/ninjew/).
 *  Thread Starter [aljuk](https://wordpress.org/support/users/aljuk/)
 * (@aljuk)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/conditional-test-for-single-map/#post-14650560)
 * Great stuff!
 * Many thanks.
 *  Plugin Author [Eyal Fitoussi](https://wordpress.org/support/users/ninjew/)
 * (@ninjew)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/conditional-test-for-single-map/#post-14675587)
 * You are welcome, [@aljuk](https://wordpress.org/support/users/aljuk/).

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Conditional test for single map ?’ is closed to new replies.

 * ![](https://ps.w.org/geo-my-wp/assets/icon-256x256.gif?rev=2803407)
 * [GEO my WP](https://wordpress.org/plugins/geo-my-wp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/geo-my-wp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/geo-my-wp/)
 * [Active Topics](https://wordpress.org/support/plugin/geo-my-wp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/geo-my-wp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/geo-my-wp/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Eyal Fitoussi](https://wordpress.org/support/users/ninjew/)
 * Last activity: [4 years, 10 months ago](https://wordpress.org/support/topic/conditional-test-for-single-map/#post-14675587)
 * Status: resolved