global.register_theme_modules = (new_theme_modules)=>{
if (!new_theme_modules) {return;}
// theme_modules {key:showName,key2:showName2}
add_filter("_nv_theme_module",(old_theme_modules)=>{
old_theme_modules = old_theme_modules || {};
return {
...old_theme_modules,
...new_theme_modules,
}
})
}
global.unregister_theme_modules = (theme_module_keys) => {
//theme_module_keys [key1,key2]
add_filter("_nv_theme_module",(old_theme_modules)=>{
old_theme_modules = old_theme_modules || {};
theme_module_keys.forEach(key=>{
delete old_theme_modules[key]
})
return old_theme_modules;
})
}
global.get_registered_theme_modules = ()=>{
return apply_filters('_nv_theme_module',{});
}