Roots\Soil\Options::init PHP Method

init() public static method

public static init ( $module, $options = [] )
    public static function init($module, $options = [])
    {
        if (!isset(self::$modules[$module])) {
            self::$modules[$module] = new static((array) $options);
        }
        return self::$modules[$module];
    }

Usage Example

コード例 #1
0
ファイル: soil.php プロジェクト: rku4er/gt-wp
function load_modules()
{
    global $_wp_theme_features;
    foreach (glob(__DIR__ . '/modules/*.php') as $file) {
        $feature = 'soil-' . basename($file, '.php');
        if (isset($_wp_theme_features[$feature])) {
            Options::init($feature, $_wp_theme_features[$feature]);
            require_once $file;
        }
    }
}