fields
3 months ago
images
6 months ago
modules
3 months ago
DiviAmelia.php
4 years ago
loader.php
6 months ago
loader.php
25 lines
| 1 | <?php |
| 2 | |
| 3 | if (!class_exists('ET_Builder_Element')) { |
| 4 | return; |
| 5 | } |
| 6 | |
| 7 | $module_files = glob(__DIR__ . '/modules/*/*.php'); |
| 8 | |
| 9 | $hidden_modules = ['Search', 'Events', 'Booking', 'Catalog']; |
| 10 | |
| 11 | // Check if we're in Divi builder context (admin or visual builder) |
| 12 | $is_builder = is_admin() |
| 13 | || isset($_GET['et_fb']) |
| 14 | || (function_exists('et_core_is_fb_enabled') && et_core_is_fb_enabled()); |
| 15 | |
| 16 | foreach ((array) $module_files as $module_file) { |
| 17 | if ($module_file && preg_match("/\/modules\/\b([^\/]+)\/\\1\.php$/", $module_file, $matches)) { |
| 18 | // Skip hidden modules in builder, but load them on frontend for existing pages |
| 19 | if (in_array($matches[1], $hidden_modules) && $is_builder) { |
| 20 | continue; |
| 21 | } |
| 22 | require_once $module_file; |
| 23 | } |
| 24 | } |
| 25 |