Title: [Plugin: Basic Google Maps Placemarks] Including Shortcodes in Info Box
Last modified: August 20, 2016

---

# [Plugin: Basic Google Maps Placemarks] Including Shortcodes in Info Box

 *  Resolved [Gillian](https://wordpress.org/support/users/ridgididgi/)
 * (@ridgididgi)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/plugin-basic-google-maps-placemarks-including-shortcodes-in-info-box/)
 * Hi Ian
 * I am trying to include a shortcode in the pop-up info box for the placemark (
   which gets its data from the custom post) but the shortcode operation is ignored
   and the info box just outputs the shortcode text eg `[this is my shortcode]`.
 * Is there support for shortcode usage in the BGMP custom post? If not, is it planned,
   or might there be a workaround?
 * Thanks in advance.
 * Ridgididgi
 * [http://wordpress.org/extend/plugins/basic-google-maps-placemarks/](http://wordpress.org/extend/plugins/basic-google-maps-placemarks/)

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

 *  Plugin Author [Ian Dunn](https://wordpress.org/support/users/iandunn/)
 * (@iandunn)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/plugin-basic-google-maps-placemarks-including-shortcodes-in-info-box/#post-2471032)
 * The plugin doesn’t support that by default, but it might not be too hard to add
   it. I’ll look into it for one of the upcoming versions.
 * In the meantime, you could try adding some code like this to your theme’s function.
   php file
 *     ```
       function bgmp_parse_shortcodes( $placemarks )
       {
       	for( $i = 0; $i < count( $placemarks ); $i++ )
       		$placemarks[ $i ][ 'details' ] = do_shortcode( $placemarks[ $i ][ 'details' ] );
       }
       add_filter( 'bgmp_get-placemarks-return', 'bgmp_parse_shortcodes' );
       ```
   
 *  Thread Starter [Gillian](https://wordpress.org/support/users/ridgididgi/)
 * (@ridgididgi)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/plugin-basic-google-maps-placemarks-including-shortcodes-in-info-box/#post-2471044)
 * Hi Ian
 * Many thanks for the code 🙂
 * I created a child theme and included the code in the child theme’s functions.
   php file, but unfortunately all my placemarks disappeared 🙁
 * Help! I have temporarily disabled the child theme’s functions.php file to get
   my placemarks back in the meantime.
 * Ridgididgi
 *  Plugin Author [Ian Dunn](https://wordpress.org/support/users/iandunn/)
 * (@iandunn)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/plugin-basic-google-maps-placemarks-including-shortcodes-in-info-box/#post-2471054)
 * Er, I forgot to return the `$placemarks` variable. Try this…
 *     ```
       function bgmp_parse_shortcodes( $placemarks )
       {
       	for( $i = 0; $i < count( $placemarks ); $i++ )
       		$placemarks[ $i ][ 'details' ] = do_shortcode( $placemarks[ $i ][ 'details' ] );
   
       	return $placemarks;
       }
       add_filter( 'bgmp_get-placemarks-return', 'bgmp_parse_shortcodes' );
       ```
   
 *  Thread Starter [Gillian](https://wordpress.org/support/users/ridgididgi/)
 * (@ridgididgi)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/plugin-basic-google-maps-placemarks-including-shortcodes-in-info-box/#post-2471056)
 * Hi Ian
 * That is supercalifragilisticexpialidocious 🙂
 * It’s all working now, many thanks. It would be great to have the ability to include
   shortcodes in the custom post in an upcoming version of your plug-in.
 * For your info, the shortcode I wanted to include pulls data from the database
   so that a number (and its related percentage) is automatically updated in the
   info box as new entries are recorded in the database. The shortcode works fine
   in a page, but returns a zero (and divide by zero error for the percentage operation)
   in the placemark post. I got around that difficulty by using the Shortcode Exec
   PHP plug-in and creating two more shortcodes (one for the count and one for the
   percent) and then using the “echo do_shortcode” command to call up the respective
   original shortcodes.
 * I’m sure my convoluted solution isn’t optimal, but at least it works so I’m happy
   🙂
 * Many thanks again for your great support and a belated Merry Christmas!
 * Ridgididgi

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

The topic ‘[Plugin: Basic Google Maps Placemarks] Including Shortcodes in Info Box’
is closed to new replies.

 * ![](https://ps.w.org/basic-google-maps-placemarks/assets/icon-128x128.png?rev
   =1152531)
 * [Basic Google Maps Placemarks](https://wordpress.org/plugins/basic-google-maps-placemarks/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/basic-google-maps-placemarks/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/basic-google-maps-placemarks/)
 * [Active Topics](https://wordpress.org/support/plugin/basic-google-maps-placemarks/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/basic-google-maps-placemarks/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/basic-google-maps-placemarks/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Gillian](https://wordpress.org/support/users/ridgididgi/)
 * Last activity: [14 years, 5 months ago](https://wordpress.org/support/topic/plugin-basic-google-maps-placemarks-including-shortcodes-in-info-box/#post-2471056)
 * Status: resolved