Skip to content

Instantly share code, notes, and snippets.

@Pebblo
Created January 20, 2020 14:26
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 Pebblo/8b8d1968f39ce90530b6c1e447541d77 to your computer and use it in GitHub Desktop.
Save Pebblo/8b8d1968f39ce90530b6c1e447541d77 to your computer and use it in GitHub Desktop.
Fixes a conflict with eventON due to it changing `$typenow` on admin_init.
<?php //Please do not include the opening PHP tag if you already have one.
// Set `$typenow` back to empty when editing espresso_venues
add_action('admin_init', 'tw_ee_eventON_fix', 11);
function tw_ee_eventON_fix(){
global $typenow;
if (isset($_REQUEST['page'], $_REQUEST['action'])
&& $_REQUEST['page'] === 'espresso_venues'
&& $_REQUEST['action'] === 'edit'
){
$typenow = '';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment