wpdiggerstudio/wpzylos-hooks
最新稳定版本:v1.0.0
Composer 安装命令:
composer require wpdiggerstudio/wpzylos-hooks
包简介
WordPress hook management with plugin-scoped custom hooks for WPZylos framework
README 文档
README
WordPress hook management with plugin-scoped custom hooks for WPZylos framework.
📖 Full Documentation | 🐛 Report Issues
✨ Features
- Plugin-scoped Hooks — Automatically prefixed actions and filters
- Hook Manager — Centralized hook registration
- Fluent API — Chainable hook methods
- Priority Control — Easy priority management
- Bulk Registration — Register multiple hooks at once
📋 Requirements
| Requirement | Version |
|---|---|
| PHP | ^8.0 |
| WordPress | 6.0+ |
🚀 Installation
composer require wpdiggerstudio/wpzylos-hooks
📖 Quick Start
use WPZylos\Framework\Hooks\HookManager; $hooks = new HookManager($context); // Add WordPress action $hooks->action('init', [$this, 'initialize']); // Add WordPress filter $hooks->filter('the_content', [$this, 'modifyContent']); // Plugin-scoped hooks (auto-prefixed) $hooks->pluginAction('activated', [$this, 'onActivate']); $hooks->pluginFilter('settings', [$this, 'filterSettings']);
🏗️ Core Features
WordPress Hooks
// Actions $hooks->action('wp_enqueue_scripts', [$this, 'enqueueAssets']); $hooks->action('admin_menu', [$this, 'registerMenu'], 20); // Filters $hooks->filter('the_title', [$this, 'filterTitle']); $hooks->filter('body_class', [$this, 'addBodyClasses'], 10, 2);
Plugin-Scoped Hooks
// Creates: myplugin_user_created $hooks->pluginAction('user_created', [$listener, 'onUserCreated']); // Creates: myplugin_settings filter $hooks->pluginFilter('settings', [$this, 'filterSettings']);
Triggering Hooks
// Trigger plugin action $hooks->doPluginAction('user_created', $user); // Apply plugin filter $settings = $hooks->applyPluginFilter('settings', $defaults);
📦 Related Packages
| Package | Description |
|---|---|
| wpzylos-core | Application foundation |
| wpzylos-events | PSR-14 event dispatcher |
| wpzylos-scaffold | Plugin template |
📖 Documentation
For comprehensive documentation, tutorials, and API reference, visit wpzylos.com.
☕ Support the Project
If you find this package helpful, consider buying me a coffee! Your support helps maintain and improve the WPZylos ecosystem.
📄 License
MIT License. See LICENSE for details.
🤝 Contributing
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
Made with ❤️ by WPDiggerStudio
统计信息
- 总下载量: 231
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 5
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-02-01