| 1 |
import { registerPlugin } from '@wordpress/plugins'; |
| 2 |
|
| 3 |
import * as colorPalette from './plugins/color-palette'; |
| 4 |
import * as customCode from './plugins/custom-code'; |
| 5 |
import * as customizer from './plugins/customizer'; |
| 6 |
import * as editorIframeResize from './plugins/editor-iframe-resize'; |
| 7 |
import * as ghostkit from './plugins/ghostkit'; |
| 8 |
import * as templates from './plugins/templates'; |
| 9 |
import * as typography from './plugins/typography'; |
| 10 |
|
| 11 |
const { GHOSTKIT } = window; |
| 12 |
|
| 13 |
/** |
| 14 |
* Register plugins |
| 15 |
*/ |
| 16 |
[ |
| 17 |
ghostkit, |
| 18 |
templates, |
| 19 |
typography, |
| 20 |
customCode, |
| 21 |
colorPalette, |
| 22 |
customizer, |
| 23 |
editorIframeResize, |
| 24 |
].forEach(({ name, icon, Plugin }) => { |
| 25 |
if ( |
| 26 |
(name === 'ghostkit-color-palette' && |
| 27 |
!GHOSTKIT.allowPluginColorPalette) || |
| 28 |
(name === 'ghostkit-customizer' && !GHOSTKIT.allowPluginCustomizer) || |
| 29 |
(name === 'ghostkit-templates' && !GHOSTKIT.allowTemplates) |
| 30 |
) { |
| 31 |
return; |
| 32 |
} |
| 33 |
|
| 34 |
registerPlugin(name, { |
| 35 |
icon, |
| 36 |
render: Plugin, |
| 37 |
}); |
| 38 |
}); |
| 39 |
|