PHPackages                             kaiseki/wp-hook - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. kaiseki/wp-hook

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

kaiseki/wp-hook
===============

Register classes with add\_filter and add\_action hooks

2.0.0(1mo ago)13.2k20MITPHPPHP ^8.2CI passing

Since Feb 5Pushed 3w ago2 watchersCompare

[ Source](https://github.com/kaisekidev/kaiseki-wp-hook)[ Packagist](https://packagist.org/packages/kaiseki/wp-hook)[ Docs](https://github.com/kaisekidev/kaiseki-wp-hook)[ RSS](/packages/kaiseki-wp-hook/feed)WikiDiscussions master Synced yesterday

READMEChangelog (3)Dependencies (28)Versions (8)Used By (20)

kaiseki/wp-hook
===============

[](#kaisekiwp-hook)

Register classes with `add_filter` and `add_action` hooks.

A hook provider is any object implementing `HookProviderInterface` — its single `addHooks()` method is where you wire WordPress callbacks with `add_action()` and `add_filter()`. You list your provider classes under the `hook.provider` config key, and `HookProviderRegistry` instantiates them through the container and calls `addHooks()`on each, so every theme or plugin registers its hooks from one place.

Installation
------------

[](#installation)

```
composer require kaiseki/wp-hook
```

Requires PHP 8.2 or newer.

Usage
-----

[](#usage)

Implement `HookProviderInterface` and register your WordPress hooks inside `addHooks()`:

```
use Kaiseki\WordPress\Hook\HookProviderInterface;

final class SetupTheme implements HookProviderInterface
{
    public function addHooks(): void
    {
        add_action('after_setup_theme', [$this, 'registerMenus']);
    }

    public function registerMenus(): void
    {
        // register_nav_menus(...);
    }
}
```

Add the class name to the `hook.provider` config key:

```
return [
    'hook' => [
        'provider' => [
            SetupTheme::class,
        ],
    ],
];
```

`ConfigProvider` maps `HookProviderRegistry` to `HookProviderRegistryFactory`, which reads `hook.provider` from the container, instantiates each provider, and builds the registry. Calling `addHooks()` on the registry then fans out to every provider:

```
use Kaiseki\WordPress\Hook\HookProviderRegistry;

/** @var HookProviderRegistry $registry */
$registry = $container->get(HookProviderRegistry::class);
$registry->addHooks();
```

Wire `ConfigProvider` into your application's config aggregator (e.g. laminas-config-aggregator) to register the factory.

Development
-----------

[](#development)

```
composer install
composer check   # check-deps, cs-check, phpstan, phpunit
```

License
-------

[](#license)

MIT — see [LICENSE](LICENSE).

###  Health Score

55

—

FairBetter than 97% of packages

Maintenance95

Actively maintained with recent releases

Popularity24

Limited adoption so far

Community24

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~787 days

Total

3

Last Release

33d ago

Major Versions

1.0.1 → 2.0.02026-05-31

PHP version history (2 changes)1.0.0PHP ^7.4

2.0.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/1c3a6b11aea9668c9e9ca0c0f8515ef114d344acb552c695d715d35d5b388ea4?d=identicon)[woda](/maintainers/woda)

---

Top Contributors

[![davidmondok](https://avatars.githubusercontent.com/u/3883758?v=4)](https://github.com/davidmondok "davidmondok (10 commits)")[![wolfgangschaefer](https://avatars.githubusercontent.com/u/26325205?v=4)](https://github.com/wolfgangschaefer "wolfgangschaefer (10 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")[![szepeviktor](https://avatars.githubusercontent.com/u/952007?v=4)](https://github.com/szepeviktor "szepeviktor (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/kaiseki-wp-hook/health.svg)

```
[![Health](https://phpackages.com/badges/kaiseki-wp-hook/health.svg)](https://phpackages.com/packages/kaiseki-wp-hook)
```

###  Alternatives

[symfony/dependency-injection

Allows you to standardize and centralize the way objects are constructed in your application

4.2k455.6M9.6k](/packages/symfony-dependency-injection)[illuminate/contracts

The Illuminate Contracts package.

706130.3M13.3k](/packages/illuminate-contracts)[illuminate/container

The Illuminate Container package.

31182.0M2.4k](/packages/illuminate-container)[api-platform/core

Build a fully-featured hypermedia or GraphQL API in minutes!

2.6k51.2M338](/packages/api-platform-core)[ecotone/ecotone

Enterprise architecture layer for Laravel and Symfony — CQRS, Event Sourcing, Durable Workflows (Sagas, Orchestrators), Projections, and Outbox messaging via PHP attributes.

564576.7k51](/packages/ecotone-ecotone)[symfony/type-info

Extracts PHP types information.

20069.8M269](/packages/symfony-type-info)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
