mirror of
https://github.com/flextype/flextype.git
synced 2025-08-05 12:47:45 +02:00
feat(core): Load Shortcodes extensions based on settings.shortcodes.extensions array #352
This commit is contained in:
@@ -158,10 +158,17 @@ if ($flextype['registry']->get('settings.errors.display')) {
|
||||
date_default_timezone_set($flextype['registry']->get('settings.timezone'));
|
||||
|
||||
/**
|
||||
* Get and Include default shortcodes
|
||||
* Init shortocodes
|
||||
*
|
||||
* Load Flextype Shortcodes extensions from directory /flextype/shortcodes/ based on settings.shortcodes.extensions array
|
||||
*/
|
||||
foreach (Filesystem::listContents(ROOT_DIR . '/flextype/shortcodes') as $shortcode) {
|
||||
include_once $shortcode['path'];
|
||||
$shortcodes_extensions = $flextype['registry']->get('settings.shortcodes.extensions');
|
||||
|
||||
foreach($shortcodes_extensions as $shortcodes_extension) {
|
||||
$shortcodes_extension_file_path = ROOT_DIR . '/flextype/shortcodes/' . $shortcodes_extension . 'ShortcodeExtension.php';
|
||||
if (file_exists($shortcodes_extension_file_path)) {
|
||||
include_once $shortcodes_extension_file_path;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -231,3 +231,9 @@ slugify:
|
||||
# - driver: gd or imagick
|
||||
image:
|
||||
driver: gd
|
||||
|
||||
# Shortcodes
|
||||
#
|
||||
# - extensions: Flextype Shortcodes Extension to load.
|
||||
shortcodes:
|
||||
extensions: ['BaseUrl', 'Entries', 'Registry', 'Snippets']
|
||||
|
Reference in New Issue
Block a user