-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathindex.php
43 lines (41 loc) · 1.16 KB
/
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
37
38
39
40
41
42
43
<?php
/**
Plugin Name: VCWB Elements API example
Plugin URI: http://visualcomposer.com
Description: VCWB Elements API example
Version: 1.0
Author: Visual Composer
Author URI: http://visualcomposer.com
*/
// don't load directly
if (!defined('ABSPATH')) {
die('-1');
}
add_action(
/**
* @param $api \VisualComposer\Modules\Api\Factory
*/
'vcv:api',
function ($api) {
$elementsToRegister = [
'logoSuperTest',
'textTest',
'imageGalleryWithTestZoom',
'cssVariablesButton',
'imageSlider',
'verticalChart',
'wpbsTestimonials',
'wpbsImageSlider',
'demoGrid',
'demoGridItem',
];
$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);
}
}
);