Created
September 19, 2016 22:31
-
-
Save cliffordp/4699d8373ea15967307374e51cad33c5 to your computer and use it in GitHub Desktop.
The Events Calendar: Show map for each event in List View -- https://cl.ly/1g2R2f3Q1k2Y
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* The Events Calendar: Show map for each event in List View | |
* Video preview: https://cl.ly/1g2R2f3Q1k2Y | |
* | |
* By Nico 2016-08-09 | |
* From https://gist.github.com/cliffordp/4699d8373ea15967307374e51cad33c5 | |
*/ | |
function tribe_print_map_in_list_view ( ) { | |
// bail if not in list view | |
if ( ! class_exists('Tribe__Events__Embedded_Maps' ) || ! function_exists( 'tribe_is_list_view' ) || ! tribe_is_list_view() ) return false; | |
$maps = Tribe__Events__Embedded_Maps::instance(); | |
echo $maps->get_map( null, null, null, false ); | |
} | |
add_action ( 'tribe_events_after_the_meta', 'tribe_print_map_in_list_view' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment