PHPackages                             arnaud-ritti/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. arnaud-ritti/wp-hook

ActiveLibrary

arnaud-ritti/wp-hook
====================

Use PHP Docblock (annotations) to register WordPress hooks, filters and shortcodes.

0.0.1(3y ago)01.2k↑200%[3 PRs](https://github.com/arnaud-ritti/wp-hook/pulls)1MITPHPPHP ^7.1 || ^8.0

Since Aug 20Pushed 3y agoCompare

[ Source](https://github.com/arnaud-ritti/wp-hook)[ Packagist](https://packagist.org/packages/arnaud-ritti/wp-hook)[ RSS](/packages/arnaud-ritti-wp-hook/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (6)Used By (1)

WP Hook
=======

[](#wp-hook)

[![PHPUnit](https://github.com/arnaud-ritti/wp-hook/actions/workflows/php.yml/badge.svg)](https://github.com/arnaud-ritti/wp-hook/actions/workflows/php.yml)[![Latest Unstable Version](https://camo.githubusercontent.com/f15a63cb5e3208a2988f5fb78e124a14aab5fb911f5ec02de1531671666d3488/68747470733a2f2f706f7365722e707567782e6f72672f647567616a65616e2f77702d686f6f6b2d616e6e6f746174696f6e732f762f756e737461626c65)](https://packagist.org/packages/arnaud-ritti/wp-hook)[![Total Downloads](https://camo.githubusercontent.com/f78e06125f235819324bfe826ce5dcbf0ef2e5c7a8635b142a646d66f412233d/68747470733a2f2f706f7365722e707567782e6f72672f61726e6175642d72697474692f77702d686f6f6b2f646f776e6c6f616473)](https://packagist.org/packages/arnaud-ritti/wp-hook)[![License](https://camo.githubusercontent.com/5f4f04211ea854e13433e7bc1b3c258bdb517e9faa0ee5e342a42c267fa55266/68747470733a2f2f706f7365722e707567782e6f72672f61726e6175642d72697474692f77702d686f6f6b2f6c6963656e7365)](https://packagist.org/packages/arnaud-ritti/wp-hook)

Register WordPress hooks, filters and shortcodes.

- With PHP Docblock (annotations)
- Or with PHP 8.0 Attributes

Requirements
------------

[](#requirements)

- PHP 7.1 or greater (tested on PHP 7.4, 8.0 and 8.1)

Install
-------

[](#install)

Via Composer

```
composer require arnaud-ritti/wp-hook
```

Usage
-----

[](#usage)

To automatically wire up your class, simply call the `HookRegistry::bootstrap` method, like so:

```
