tonik / theme

Tonik is a WordPress Starter Theme which aims to modernize, organize and enhance some aspects of WordPress theme development.
http://labs.tonik.pl/theme/
MIT License
1.33k stars 140 forks source link

new Config instance is binded twice when located config was found #12

Closed jedrzejchalubek closed 7 years ago

jedrzejchalubek commented 7 years ago

On theme bootstrapping, new Config instance is bonded twice when located config file was found (https://github.com/tonik/theme/blob/master/bootstrap/theme.php#L28-L36). $config variable need to be overwritten with merged one when this happens.

$config = require __DIR__ . '/../config/theme.php';

if ($locatedConfig = locate_template('config/theme.php', false, false)) {
    $config = array_merge_recursive($config, require $locatedConfig);
}

$theme->bind('config', new Tonik\Gin\Foundation\Config($config));