Theme.php
public function registerModule($key, $instance)
    {
        do_action("before_theme_module_register");
        apply_filters("before_theme_module_init", $key, $instance);

        $this->modules[$key] = $instance;
        $this->module($key)->init();

        apply_filters("after_theme_module_init", $key, $instance);
        do_action("after_theme_module_register");
    }
public function registerModule($key, $instance)
    {
        do_action("before_theme_module_register");
        apply_filters("before_theme_module_init", $key, $instance);

        $this->modules[$key] = $instance;
        $this->module($key)->init();

        apply_filters("after_theme_module_init", $key, $instance);
        do_action("after_theme_module_register");
    }
Register theme module

@param $key string Register module under this key
@param $instance