Skip to content

Instantly share code, notes, and snippets.

@DylanCodeCabin
Created January 17, 2023 05:48
Show Gist options
  • Save DylanCodeCabin/c1d3427c8c1899cef71adbdee965d0f5 to your computer and use it in GitHub Desktop.
Save DylanCodeCabin/c1d3427c8c1899cef71adbdee965d0f5 to your computer and use it in GitHub Desktop.
/* Demo of how you might replace the HTML template for Atlas Novus Panel info widnows
*
* This uses a dynamic hook, from the shortcode class, and can be applied to any module that is contained in a panel
*
* This assumes, you are targeting the "left" panel, but the same can be applied to the right panel if the anchor is set this way
*/
add_filter('wpgmza_map_panel_elements_left', 'wpgmza_infowindow_override', 10, 1);
function wpgmza_infowindow_override($elements){
if(is_array($elements)){
if(!empty($elements['infowindow'])){
$infowindowHtml = $elements['infowindow'];
/* Mutate/Replace info-window html, this could pull from your own theme file */
$infowindowHtml = "<div class='example-replacement'>{$infowindowHtml}<span>Added content</span></div>";
$elements['infowindow'] = $infowindowHtml;
}
}
return $elements;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment