simplemediacode / hooks

Decoupled @WordPress Hooks (filters and actions)

Home Page:https://republa.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Decoupled WordPress Hooks (filters and actions)

Simple copy of WordPress' WP_Hook class with some adjustments to use outside of WordPress.

No dependencies!

Why?

Because I like these WordPress "filters" and they "cost" almost nothing. And sine I use them in other projects it's easier to make them public anyways.

Usage

Via composer

composer require simplemediacode/hooks

and then

use SimpleMediaCode\Hooks\WP_Hook;

See ActionHooks.php in example folder (which is autoloaded too). Or wrap in your own solution. I use them inside classes and/or in helper functions. Should be compatible with WordPress (works on my machine). "Tested" with PHP 8.2.22.

Changelog

Read at CHANGELOG.md.

Links

More about how to use WordPress hooks (filters and actions) read at wordpress.org: "WP_Hook: Next Generation Actions and Filters". Instead of $wp_* here use $wphook_* for compatiblity.


Thanks to WordPress team and collaborators

Most of job done by WordPress team and collaborators

License

This library is released under the GLP-2 license. See the complete license in the bundled LICENSE file.

About

Decoupled @WordPress Hooks (filters and actions)

https://republa.com

License:GNU General Public License v2.0


Languages

Language:PHP 100.0%