fix bug
This commit is contained in:
parent
2d61243ef1
commit
3ba2c02db5
|
@ -153,7 +153,7 @@ func MergeBy[K comparable, V any](fn func(k K, v1, v2 V) (V, bool), m ...map[K]V
|
|||
|
||||
func FilterZeroMerge[K comparable, V any](m ...map[K]V) map[K]V {
|
||||
if len(m) < 1 {
|
||||
panic("no map")
|
||||
return nil
|
||||
} else if len(m) < 2 {
|
||||
return m[0]
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ func Archive(h *wp.Handle, id string) string {
|
|||
conf := reload.GetAnyValBys("widget-archive-conf", h, func(h *wp.Handle) map[any]any {
|
||||
archivesConfig := archivesConfig()
|
||||
conf := wpconfig.GetPHPArrayVal("widget_archives", archivesConfig, int64(2))
|
||||
return conf
|
||||
return maps.FilterZeroMerge(archivesConfig, conf)
|
||||
})
|
||||
|
||||
args := reload.GetAnyValBys("widget-archive-args", h, func(h *wp.Handle) map[string]string {
|
||||
|
|
Loading…
Reference in New Issue
Block a user