wpdiggerstudio / wpzylos-hooks
WordPress hook management with plugin-scoped custom hooks for WPZylos framework
Fund package maintenance!
Paypal
Installs: 231
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/wpdiggerstudio/wpzylos-hooks
Requires
- php: ^8.0
- wpdiggerstudio/wpzylos-core: ^1.0
Requires (Dev)
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^9.6 || ^10.0
- squizlabs/php_codesniffer: ^3.7
- szepeviktor/phpstan-wordpress: ^1.3
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