forked from soflyy/breakdance-custom-elements
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplugin.php
More file actions
63 lines (55 loc) · 1.72 KB
/
Copy pathplugin.php
File metadata and controls
63 lines (55 loc) · 1.72 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
/**
* Plugin Name: Brighter BD Elements
* Plugin URI: https://breakdance.com/
* Description: Custom elements created with Element Studio.
* Author: Breakdance
* Author URI: https://breakdance.com/
* License: GPLv2
* Text Domain: breakdance
* Domain Path: /languages/
* Version: 0.0.1
*/
namespace BreakdanceCustomElements;
use function Breakdance\Util\getDirectoryPathRelativeToPluginFolder;
// CPT Form Submission action + admin settings
add_action('init', function () {
if (!function_exists('\Breakdance\Forms\Actions\registerAction')) {
return;
}
require_once __DIR__ . '/form-actions/CptSubmissionAction.php';
\Breakdance\Forms\Actions\registerAction(new \BrighterElements\FormActions\CptSubmissionAction());
});
add_action('init', function () {
if (!is_admin()) {
return;
}
require_once __DIR__ . '/form-actions/CptSubmissionAdmin.php';
(new \BrighterElements\FormActions\CptSubmissionAdmin())->init();
});
add_action('breakdance_loaded', function () {
\Breakdance\ElementStudio\registerSaveLocation(
getDirectoryPathRelativeToPluginFolder(__DIR__) . '/elements',
'BreakdanceCustomElements',
'element',
'Custom Elements',
false
);
\Breakdance\ElementStudio\registerSaveLocation(
getDirectoryPathRelativeToPluginFolder(__DIR__) . '/macros',
'BreakdanceCustomElements',
'macro',
'Custom Macros',
false,
);
\Breakdance\ElementStudio\registerSaveLocation(
getDirectoryPathRelativeToPluginFolder(__DIR__) . '/presets',
'BreakdanceCustomElements',
'preset',
'Custom Presets',
false,
);
},
// register elements before loading them
9
);