wp-go/app/plugins/wphandle/tests/tt.go

23 lines
649 B
Go
Raw Normal View History

2023-05-03 15:57:49 +00:00
package tests
import (
"fmt"
2023-05-04 12:37:06 +00:00
"github.com/fthvgb1/wp-go/app/pkg/constraints"
"github.com/fthvgb1/wp-go/app/theme/wp"
2023-05-03 15:57:49 +00:00
)
func Tt(h *wp.Handle) {
2024-01-22 12:29:17 +00:00
h.HookHandle(constraints.PipeMiddleware, constraints.AllScene, func(call wp.HandleCall) (wp.HandleCall, bool) {
2023-05-03 15:57:49 +00:00
return call, false
})
/*h.PushPipeHook(constraints.Home, func(pipe wp.Pipe) (wp.Pipe, bool) {
return wp.Pipe{}, false
})*/
//h.DeletePipe(constraints.Home, constraints.PipeMiddleware)
h.ReplacePipe(constraints.Home, constraints.PipeMiddleware, wp.NewPipe("log", 500, func(next wp.HandleFn[*wp.Handle], h *wp.Handle) {
fmt.Println("ffff")
next(h)
fmt.Println("iiiii")
}))
}