kaiseki/wp-hook
最新稳定版本:1.0.1
Composer 安装命令:
composer require kaiseki/wp-hook
包简介
Register classes with add_filter and add_action hooks
README 文档
README
Register classes with add_filter and add_action hooks
Install
composer require kaiseki/wp-hook
Usage
- Implement a class with the
HookProviderInterface, e.g.:
final class DoSomething implements \Kaiseki\WordPress\Hook\HookProviderInterface { public function registerCallbacks(): void { \add_action('after_setup_theme', [$this, 'doSomething'], 10, 1); } public function doSomething(): string { /*...*/ } }
- Add class name to config key
hook/provider
return [ 'hook' => [ 'provider' => [ DoSomething::class ], ], ];
- Classes registered on this key will be called by using
HookProviderRegistryand callingregisterCallbacks
统计信息
- 总下载量: 1.41k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 2
- 依赖项目数: 26
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-02-05