Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save chasecmiller/665819bf69c3ba3c3a26f87c16d7c91a to your computer and use it in GitHub Desktop.
Save chasecmiller/665819bf69c3ba3c3a26f87c16d7c91a to your computer and use it in GitHub Desktop.
/**
* Here is a patch to bring Visual Composer into Event Espresso 4.
*
* Tested on Visual Composer 4.11 and Event Espresso 4.
*
* Instructions:
* 1) Add this to the end of functions.php or any is_admin() included file.
**/
add_action('admin_print_scripts', function() {
global $vc_manager;
if (!array_key_exists('page', $_REQUEST)) {
return;
}
if (!preg_match('#^espresso_.*#is', $_REQUEST['page'])) {
return;
}
if (!isset($vc_manager) || !$vc_manager) {
return;
}
$e = &$vc_manager->backendEditor();
call_user_func(array(&$e, 'printScriptsMessages'));
});
@chasecmiller
Copy link
Author

For anyone who wants to bring the functionality of Visual Composer into EventEspresso.

Only tested on VC 4.11 and EE4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment