Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function pec_bgmp_shortcode_check()
- {
- global $post;
- $shortcodePageSlugs = array(
- 'home',
- );
- if( $post )
- if( in_array( $post->post_name, $shortcodePageSlugs ) )
- add_filter( 'bgmp_map-shortcode-called', 'setBGMPMapShortcodeArguments' );
- }
- add_action( 'wp', 'pec_bgmp_shortcode_check' );
- function setBGMPMapShortcodeArguments( $options )
- {
- global $bgmp;
- $coordinates = $bgmp->geocode( 'Seattle' );
- $options[ 'mapWidth' ] = '500';
- $options[ 'mapHeight' ] = '400';
- $options[ 'latitude' ] = $coordinates[ 'latitude' ];
- $options[ 'longitude' ] = $coordinates[ 'longitude' ];
- $options[ 'zoom' ] = '10';
- $options[ 'type' ] = 'ROADMAP';
- $options[ 'typeControl' ] = 'HORIZONTAL_BAR';
- $options[ 'navigationControl' ] = 'SMALL';
- $options[ 'infoWindowMaxWidth' ] = '350';
- return $options;
- }
- add_filter( 'bgmp_map-shortcode-called', 'setBGMPMapShortcodeArguments' );
Advertisement
Add Comment
Please, Sign In to add comment