From 023212ba7b8f7f5eae0efda2435805342d149d7c Mon Sep 17 00:00:00 2001 From: xing Date: Wed, 19 Apr 2023 15:50:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/theme/wp/components/widgetareadata.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/internal/theme/wp/components/widgetareadata.go b/internal/theme/wp/components/widgetareadata.go index ea4ca85..d414dd9 100644 --- a/internal/theme/wp/components/widgetareadata.go +++ b/internal/theme/wp/components/widgetareadata.go @@ -2,7 +2,6 @@ package components import ( "github.com/fthvgb1/wp-go/helper/slice" - "github.com/fthvgb1/wp-go/internal/cmd/reload" "github.com/fthvgb1/wp-go/internal/pkg/constraints" "github.com/fthvgb1/wp-go/internal/theme/wp" "github.com/fthvgb1/wp-go/internal/theme/wp/components/widget" @@ -25,11 +24,10 @@ type widgetComponent struct { } func WidgetArea(h *wp.Handle) { - sidebar := reload.GetAnyValBys("sidebarWidgets", h, sidebars) - h.PushComponents(constraints.SidebarsWidgets, sidebar...) + h.PushComponents(constraints.SidebarsWidgets, sidebars()...) } -func sidebars(*wp.Handle) []wp.Components[string] { +func sidebars() []wp.Components[string] { v := wpconfig.GetPHPArrayVal("sidebars_widgets", []any{}, "sidebar-1") return slice.FilterAndMap(v, func(t any) (wp.Components[string], bool) { vv := t.(string)