diff --git a/modules/cms/classes/Theme.php b/modules/cms/classes/Theme.php index da5c5d9f4..31470a606 100644 --- a/modules/cms/classes/Theme.php +++ b/modules/cms/classes/Theme.php @@ -323,21 +323,13 @@ class Theme * * Example usage: * - * Event::listen('cms.theme.extendConfig', function ($themeCode, $config) { + * Event::listen('cms.theme.extendConfig', function ($themeCode, &$config) { * $config['name'] = 'October Theme'; * $config['description'] = 'Another great theme from October CMS'; - * return $config; * }); * */ - if ($results = Event::fire('cms.theme.extendConfig', [$this->getDirName(), $config])) { - foreach ($results as $result) { - if (!is_array($result)) { - continue; - } - $config = array_merge($config, $result); - } - } + Event::fire('cms.theme.extendConfig', [$this->getDirName(), &$config]); return $this->configCache = $config; } @@ -361,7 +353,7 @@ class Theme * * Example usage: * - * Event::listen('cms.theme.extendFormConfig', function ($themeCode, $config) { + * Event::listen('cms.theme.extendFormConfig', function ($themeCode, &$config) { * array_set($config, 'tabs.fields.header_color', [ * 'label' => 'Header Colour', * 'type' => 'colorpicker', @@ -369,18 +361,10 @@ class Theme * 'assetVar' => 'header-bg', * 'tab' => 'Global' * ]); - * return $config; * }); * */ - if ($results = Event::fire('cms.theme.extendFormConfig', [$this->getDirName(), $config])) { - foreach ($results as $result) { - if (!is_array($result)) { - continue; - } - $config = array_merge($config, $result); - } - } + Event::fire('cms.theme.extendFormConfig', [$this->getDirName(), &$config]); return $config; }