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"
|
2023-03-16 16:45:04 +00:00
|
|
|
"github.com/fthvgb1/wp-go/internal/plugins/wphandle/hiddenlogin"
|
2023-03-02 15:49:28 +00:00
|
|
|
"github.com/fthvgb1/wp-go/internal/theme/wp"
|
|
|
|
)
|
|
|
|
|
|
|
|
var plugins = wp.HandlePlugins{
|
2023-03-16 16:45:04 +00:00
|
|
|
"enlightjs": enlightjs.EnlighterJS,
|
|
|
|
"hiddenLogin": hiddenlogin.HiddenLogin,
|
2023-03-02 15:49:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|