Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshfeck/fa4bd6b11bccbc74e75b6cb02bd023dc to your computer and use it in GitHub Desktop.
Save joshfeck/fa4bd6b11bccbc74e75b6cb02bd023dc to your computer and use it in GitHub Desktop.
Ensure Event Espresso modal html gets injected at the correct location. Useful for sites with Beaver Builder.
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
function move_ee_notices_to_main_loop() {
add_filter('FHEE__EE_Front_Controller__display_errors', '__return_true');
return false;
}
function remove_ee_notices_from_early_loop() {
if(!did_action('wp_head')) {
add_filter(
'FHEE__EE_Front_Controller__display_errors',
'move_ee_notices_to_main_loop'
);
}
}
add_action('loop_start', 'remove_ee_notices_from_early_loop', 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment