Created
July 30, 2016 13:24
-
-
Save chasecmiller/665819bf69c3ba3c3a26f87c16d7c91a to your computer and use it in GitHub Desktop.
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
/** | |
* 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')); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For anyone who wants to bring the functionality of Visual Composer into EventEspresso.
Only tested on VC 4.11 and EE4.