PHPackages                             offsetwp/hook-wordpress - 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. offsetwp/hook-wordpress

ActiveLibrary

offsetwp/hook-wordpress
=======================

Typed, secure, and maintainable WordPress Core action and filter hooks

1.0.1(3mo ago)012MITPHPPHP &gt;=8.1

Since Dec 18Pushed 3mo agoCompare

[ Source](https://github.com/offsetwp/hook-wordpress)[ Packagist](https://packagist.org/packages/offsetwp/hook-wordpress)[ Fund](https://www.buymeacoffee.com/w__jerome)[ Fund](https://ko-fi.com/w__jerome)[ RSS](/packages/offsetwp-hook-wordpress/feed)WikiDiscussions main Synced today

READMEChangelog (2)Dependencies (3)Versions (3)Used By (0)

[![OffsetWP Hook WordPress](https://raw.githubusercontent.com/offsetwp/offsetwp.github.io/refs/heads/main/public/common/cover/cover-hook-wordpress-light.png#gh-light-mode-only)](https://raw.githubusercontent.com/offsetwp/offsetwp.github.io/refs/heads/main/public/common/cover/cover-hook-wordpress-light.png#gh-light-mode-only)[![OffsetWP Hook WordPress](https://raw.githubusercontent.com/offsetwp/offsetwp.github.io/refs/heads/main/public/common/cover/cover-hook-wordpress-dark.png#gh-dark-mode-only)](https://raw.githubusercontent.com/offsetwp/offsetwp.github.io/refs/heads/main/public/common/cover/cover-hook-wordpress-dark.png#gh-dark-mode-only)

 OffsetWP Hook
===============

[](#----offsetwp-hook)

 Typed, secure, and maintainable WordPress Core action and filter hooks

About OffsetWP WordPress
------------------------

[](#about-offsetwp-wordpress)

WordPress makes extensive use of hooks for its internal functioning. Unfortunately, the way it was developed makes it difficult to work with hook data:

- the callback is public and accessible by any other function
- to find out the returned parameters, you have to consult the documentation
- no auto-completion

OffsetWP Hook provides ready-to-use wrappers for native WordPress hooks. The wrappers already include the exact callback signatures, allowing for optimal autocompletion in your IDE.

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

[](#installation)

```
composer require offsetwp/hook
```

Basic usage
-----------

[](#basic-usage)

```
use OffsetWP\Hook\WordPress\Filter\WPAdminFooterTextFilter;

new class extends WPAdminFooterTextFilter {
	protected function handle( $text ) {
		return 'Made with love by OffsetWP | ' . $text;
	}
};
```

### Hook with a dynamique name

[](#hook-with-a-dynamique-name)

```
use OffsetWP\Hook\WordPress\Filter\WPGetMetaTypeMetadataFilter;

new class extends WPGetMetaTypeMetadataFilter {
	public string $hook_name = 'get_post_metadata'; // 'get_{$meta_type}_metadata'

	protected function handle( $value, $object_id, $meta_key, $single, $meta_type ) {
		return $value;
	}
};
```

Advanced usage
--------------

[](#advanced-usage)

With more substantial development, it may be necessary for your hooks to use dependencies. All of this is possible, depending on your needs:

```
use OffsetWP\Hook\WordPress\Filter\WPAdminFooterTextFilter;

new class extends WPAdminFooterTextFilter {
	public function __construct( private $myServiceName = 'CustomService' ) {
		return parent::__construct();
	}

	protected function handle( $text ) {
		return $this->myServiceName . ' | ' . $text;
	}
}
```

###  Health Score

37

—

LowBetter than 84% of packages

Maintenance82

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity44

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

Total

2

Last Release

90d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f92310287db168bd8da8a7b15d26e9e0849a6c7ab9a30d7fc32497d7e5f4bab8?d=identicon)[w-jerome](/maintainers/w-jerome)

---

Top Contributors

[![w-jerome](https://avatars.githubusercontent.com/u/1685550?v=4)](https://github.com/w-jerome "w-jerome (2 commits)")

---

Tags

wordpressHOOKoffsetwpadd\_actionadd\_filter

### Embed Badge

![Health badge](/badges/offsetwp-hook-wordpress/health.svg)

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

###  Alternatives

[tormjens/eventy

The WordPress filter/action system in Laravel

438902.3k13](/packages/tormjens-eventy)[millat/laravel-hooks

The WordPress filter, action system in Laravel

5815.1k](/packages/millat-laravel-hooks)

PHPackages © 2026

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