-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
36 lines (34 loc) · 999 Bytes
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
/**
Plugin Name: VCWB Pro Elements
Plugin URI: https://github.com/konutis/vcwb-pro-elements
Description: VCWB Pro Elements
Version: 1.0
Author: Janis Konutis
Author URI: https://github.com/konutis/vcwb-pro-elements
*/
// don't load directly
if (!defined('ABSPATH')) {
die('-1');
}
add_action(
/**
* @param $api \VisualComposer\Modules\Api\Factory
*/
'vcv:api',
function ($api) {
$elementsToRegister = [
'proScrollToTopButton',
'proHeading',
'proModalBox',
];
$pluginBaseUrl = rtrim(plugins_url(basename(__DIR__)), '\\/');
/** @var \VisualComposer\Modules\Elements\ApiController $elementsApi */
$elementsApi = $api->elements;
foreach ($elementsToRegister as $tag) {
$manifestPath = __DIR__ . '/elements/' . $tag . '/manifest.json';
$elementBaseUrl = $pluginBaseUrl . '/elements/' . $tag;
$elementsApi->add($manifestPath, $elementBaseUrl);
}
}
);