wp-go/internal/plugins/wphandle/handle.go

24 lines
453 B
Go
Raw Normal View History

2023-03-02 15:49:28 +00:00
package wphandle
import (
"github.com/fthvgb1/wp-go/helper/maps"
"github.com/fthvgb1/wp-go/internal/plugins/wphandle/enlightjs"
"github.com/fthvgb1/wp-go/internal/theme/wp"
)
var plugins = wp.HandlePlugins{
"enlightjs": enlightjs.EnlighterJS,
}
func Plugins() wp.HandlePlugins {
return maps.Copy(plugins)
}
func RegisterPlugins(h *wp.Handle, calls ...string) {
for _, call := range calls {
if fn, ok := plugins[call]; ok {
fn(h)
}
}
}