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. [Utility &amp; Helpers](/categories/utility)
4. /
5. offsetwp/hook-wordpress

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

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

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

1.0.1(6mo ago)023MITPHPPHP &gt;=8.1

Since Dec 18Pushed 6mo 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 3w ago

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

33

—

LowBetter than 72% of packages

Maintenance69

Regular maintenance activity

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity45

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

184d 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

438937.3k22](/packages/tormjens-eventy)[php-stubs/wordpress-stubs

WordPress function and class declaration stubs for static analysis.

19915.0M378](/packages/php-stubs-wordpress-stubs)[wpsitecare/carelib

A collection of helpful functions to make creating an awesome theme more enjoyable.

164.6k](/packages/wpsitecare-carelib)

PHPackages © 2026

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