PHPackages                             dbout/wp-module-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. [Search &amp; Filtering](/categories/search)
4. /
5. dbout/wp-module-hook

ActivePackage[Search &amp; Filtering](/categories/search)

dbout/wp-module-hook
====================

Magic hook autoloader for WordPress.

v1.0.1(11mo ago)5476[1 PRs](https://github.com/dimitriBouteille/wp-module-hook/pulls)MITPHPPHP &gt;=8.3CI passing

Since Jul 21Pushed 5mo ago2 watchersCompare

[ Source](https://github.com/dimitriBouteille/wp-module-hook)[ Packagist](https://packagist.org/packages/dbout/wp-module-hook)[ Docs](https://github.com/dimitriBouteille/wp-module-hook)[ RSS](/packages/dbout-wp-module-hook/feed)WikiDiscussions main Synced yesterday

READMEChangelog (4)Dependencies (8)Versions (8)Used By (0)

WordPress hook autoloader
=========================

[](#wordpress-hook-autoloader)

[![GitHub Release](https://camo.githubusercontent.com/0b763d955521d7e76ddcd5aa4630c01bfa58cc52dc5efe8d304b2edade377efc/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f64696d69747269426f757465696c6c652f77702d6d6f64756c652d686f6f6b)](https://camo.githubusercontent.com/0b763d955521d7e76ddcd5aa4630c01bfa58cc52dc5efe8d304b2edade377efc/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f64696d69747269426f757465696c6c652f77702d6d6f64756c652d686f6f6b) [![Packagist Downloads](https://camo.githubusercontent.com/8cb6446a161148c61be4401a9c73784e3fa90e91c72483eed1a5ff3d3234c6af/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f64626f75742f77702d6d6f64756c652d686f6f6b3f636f6c6f723d79656c6c6f77)](https://packagist.org/packages/dbout/wp-module-hook)

WordPress module developed for developers who want to quickly add WordPress hooks (action &amp; filter) without having to manually add each hook in the `function.php` file (or elsewhere).

Tip

To simplify the integration of this library, we recommend using WordPress with one of the following tools: [Bedrock](https://roots.io/bedrock/), [Themosis](https://framework.themosis.com/) or [Wordplate](https://github.com/wordplate/wordplate#readme).

Documentation
-------------

[](#documentation)

This documentation only covers the specific points of this library, if you want to know more about WordPress `action` or `filter`, the easiest is to look at [the documentation of WordPress](https://developer.wordpress.org/plugins/hooks/).

You can find all the documentation in [the wiki](https://github.com/dimitriBouteille/wp-module-hook/wiki) or [here](#usage).

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

[](#installation)

**Requirements**

The server requirements are basically the same as for [WordPress](https://wordpress.org/about/requirements/) with the addition of a few ones :

- PHP &gt;= 8.3
- [Composer](https://getcomposer.org/)

**Installation**

You can use [Composer](https://getcomposer.org/). Follow the [installation instructions](https://getcomposer.org/doc/00-intro.md) if you do not already have composer installed.

```
composer require dbout/wp-module-hook
```

In your PHP script, make sure you include the autoloader:

```
require __DIR__ . '/vendor/autoload.php';
```

Usage
-----

[](#usage)

Before creating your first hook, you must initialize the module. It is advisable to add this code at the beginning of the `functions.php` file of your theme or in a `mu-plugin`.

```
$loader = new \Dbout\Framework\Hook\HookLoader(
    directory: get_template_directory() . '/hooks',
);

$loader->register();
```

Now you have initialized the module, you just need to create your first action in the hooks folder in your theme.

```
use Dbout\Framework\Hook\Attributes\Action;
use Dbout\Framework\Hook\Attributes\Filter;

class MyFirstHook {

    #[Action(name: 'wp_dashboard_setup', priority: 999)]
    public function setupDashboard(): void
    {
        // Do something
    }

    #[Filter(name: 'crontrol/filtered-events', acceptedArgs: 2)]
    public function filterEvents(array $filtered, array $events): array
    {
        // Do something
        return $filtered;
    }
}
```

Contributing
------------

[](#contributing)

💕 🦄 We encourage you to contribute to this repository, so everyone can benefit from new features, bug fixes, and any other improvements. Have a look at our [contributing guidelines](CONTRIBUTING.md) to find out how to raise a pull request.

Licence
-------

[](#licence)

Licensed under the MIT license, see [LICENSE](LICENSE).

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance63

Regular maintenance activity

Popularity20

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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 ~5 days

Total

4

Last Release

330d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3e5be30a5fa3cbb2c1ec8b80f81d752a6700dbca5a9ab419a508293e68fbde7c?d=identicon)[dimitriBouteille](/maintainers/dimitriBouteille)

---

Top Contributors

[![dimitriBouteille](https://avatars.githubusercontent.com/u/34821762?v=4)](https://github.com/dimitriBouteille "dimitriBouteille (22 commits)")

---

Tags

hooksphpwordpresswordpress-actionswordpress-developmentwordpress-starterwordpressfilterwpHOOKwordpress-developmentwordpress-starter

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[mjohnson/decoda

A lightweight lexical string parser for BBCode styled markup.

1921.3M14](/packages/mjohnson-decoda)[tormjens/eventy

The WordPress filter/action system in Laravel

439951.1k24](/packages/tormjens-eventy)[api-platform/metadata

API Resource-oriented metadata attributes and factories

275.0M218](/packages/api-platform-metadata)[millat/laravel-hooks

The WordPress filter, action system in Laravel

5817.5k](/packages/millat-laravel-hooks)[dbout/wp-module-rest-api

Quickly add routes to the WordPress Rest API.

141.4k](/packages/dbout-wp-module-rest-api)

PHPackages © 2026

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