Plugin Author
Joe
(@morehawes)
Thanks for your suggestion. If I am understanding your correctly you would like (some) Map Meta displayed with the Map when embedding using the Shortcode? And the check box would determine if the Meta is displayed by the Shortcode, or just on the Map Details page?
Something similar has been requested before and is already on my list, I will give some more thought on how to integrate such a feature.
In the mean-time I wrote some code that outputs all Map meta underneath the Map displayed by the Shortcode. You can try this by adding the code to your theme’s functions.php file.
function waymark_shortcode_add($output, $tag, $attr){
global $post;
//Not on Map Details page
if(is_single() && $post->post_type == 'waymark_map') {
return $output;
}
//Is Waymark shortcode and has Map ID
if($tag == Waymark_Config::get_item('shortcode') && array_key_exists('map_id', $attr)){
//Get Map meta
$Map = new Waymark_Map($attr['map_id']);
$map_meta = Waymark_Helper::get_map_meta($Map);
//If we have Map Meta
if($map_meta) {
//Append table to shortcode output
$output .= Waymark_Helper::meta_table($map_meta);
}
}
return $output;
}
add_filter('do_shortcode_tag', 'waymark_shortcode_add', 10, 3);
Please note that this code is just a proof of concept and may need to be modified for your needs, but I hope your find it useful.
Joe
Plugin Author
Joe
(@morehawes)
Hi @doeleman,
I have just released a beta version of Waymark (v0.9.15-b1) ready for testing. This version includes the ability to display Meta using the Shortcode, as well as some other improvements. All feedback is appreciated.
You can find the full details here.
I suggest backing up your WordPress installation before activating beta releases, especially on production sites!
Cheers,
Joe