From d5002f8f055b253a4ffc503dec05558c0c8f5c7d Mon Sep 17 00:00:00 2001 From: chasecmiller Date: Fri, 29 Jul 2016 14:46:21 -0600 Subject: [PATCH] Include Visual Composer Only tested with VC 4.11 on EE4. --- third-party-integration/visual_composer_411 | 23 +++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 third-party-integration/visual_composer_411 diff --git a/third-party-integration/visual_composer_411 b/third-party-integration/visual_composer_411 new file mode 100644 index 0000000..0723381 --- /dev/null +++ b/third-party-integration/visual_composer_411 @@ -0,0 +1,23 @@ + /** + * 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')); +});