PHPackages                             johnbillion/wp-hooks - 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. johnbillion/wp-hooks

Abandoned → [wp-hooks/wordpress-core](/?search=wp-hooks%2Fwordpress-core)Library

johnbillion/wp-hooks
====================

All the actions and filters from WordPress core in machine-readable JSON format.

1.11.0(5mo ago)125145.2k↓47.2%6[1 PRs](https://github.com/wp-hooks/wordpress-core-hooks/pulls)1GPL-3.0-or-laterShellCI passing

Since Oct 28Pushed 5mo ago7 watchersCompare

[ Source](https://github.com/wp-hooks/wordpress-core-hooks)[ Packagist](https://packagist.org/packages/johnbillion/wp-hooks)[ GitHub Sponsors](https://github.com/sponsors/johnbillion)[ RSS](/packages/johnbillion-wp-hooks/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (10)Dependencies (5)Versions (50)Used By (1)

WordPress Hooks Reference
=========================

[](#wordpress-hooks-reference)

All the actions and filters from WordPress core in machine-readable JSON format.

Last updated for WordPress 6.9.

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

[](#installation)

- As a Composer package for use in PHP: ```
    composer require wp-hooks/wordpress-core
    ```
- As an npm package for use in JavaScript or TypeScript: ```
    npm install @wp-hooks/wordpress-core
    ```

Usage in PHP
------------

[](#usage-in-php)

```
// Get hooks as JSON:
$actions_json = file_get_contents( 'vendor/wp-hooks/wordpress-core/hooks/actions.json' );
$filters_json = file_get_contents( 'vendor/wp-hooks/wordpress-core/hooks/filters.json' );

// Convert hooks to PHP:
$actions = json_decode( $actions_json, true )['hooks'];
$filters = json_decode( $filters_json, true )['hooks'];

// Search for filters matching a string:
$search = 'permalink';
$results = array_filter( $filters, function( array $hook ) use ( $search ) {
    return ( strpos( $hook['name'], $search ) !== false );
} );

var_dump( $results );
```

Usage in JavaScript
-------------------

[](#usage-in-javascript)

```
// Get hooks as array of objects:
const actions = require('@wp-hooks/wordpress-core/hooks/actions.json').hooks;
const filters = require('@wp-hooks/wordpress-core/hooks/filters.json').hooks;

// Search for actions matching a string:
const search = 'menu';
const results = actions.filter( hook => ( hook.name.match( search ) !== null ) );

console.log(results);
```

Importing in TypeScript
-----------------------

[](#importing-in-typescript)

```
import { hooks as actions } from '@wp-hooks/wordpress-core/hooks/actions.json';
import { hooks as filters } from '@wp-hooks/wordpress-core/hooks/filters.json';
```

Interfaces for the components of the hooks can be imported too, if you need them:

```
import { Hooks, Hook, Doc, Tags, Tag } from '@wp-hooks/wordpress-core/interface';
```

Actions, Filters, and Schemas
-----------------------------

[](#actions-filters-and-schemas)

- The actions can be found in [hooks/actions.json](hooks/actions.json)
- The filters can be found in [hooks/filters.json](hooks/filters.json)
- The JSON schema can be found in [hooks/schema.json](hooks/schema.json)
- The TypeScript interfaces can be found in [interface/index.d.ts](interface/index.d.ts)

What can I use this for?
------------------------

[](#what-can-i-use-this-for)

Anything that needs programmatic access to a list of available hooks, for example:

- [Autocomplete WordPress action and filter names in VS Code](https://github.com/johnbillion/vscode-wordpress-hooks)
- [Autocomplete WordPress action and filter names in Vim](https://github.com/Mte90/deoplete-wp-hooks)
- [WordPress plugin for Psalm](https://github.com/humanmade/psalm-plugin-wordpress)

Regenerating the Hook Files
---------------------------

[](#regenerating-the-hook-files)

Change the `roots/wordpress-full` version in composer.json to one of:

- The required major version, such as `6.8`
- `dev-main` for nightlies prior to RC
- An RC version, such as `6.9-RC1`

Install the dependencies:

```
npm i && composer i
```

Then run:

```
composer generate
```

During generation, a change and data integrity issues are saved in CHANGELOG.md and ISSUES.md respectively.

Hook Files for Plugins
----------------------

[](#hook-files-for-plugins)

Do you want the same hook files for your favourite plugins? The hook files in this repo are generated using [wp-hooks-generator](https://github.com/wp-hooks/generator). It can generate hook files for WordPress plugins and themes as well as core.

Sponsors
--------

[](#sponsors)

The time that I spend maintaining this library and others is in part sponsored by:

[![Automattic](https://camo.githubusercontent.com/b772ed2bbb2f490e5cf6117b2cdfea077c3949279bf5c48dbbeaaf2215c925dd/68747470733a2f2f63646e2e6a7364656c6976722e6e65742f67682f6a6f686e62696c6c696f6e2f6a6f686e62696c6c696f6e406c61746573742f6173736574732f73706f6e736f72732f6175746f6d61747469632e737667)](https://automattic.com)

[![ServMask](https://camo.githubusercontent.com/9d9e5722a5e02afaed959c20a630979fb55fa9e64bf62b38ac61d78242c7d3c1/68747470733a2f2f63646e2e6a7364656c6976722e6e65742f67682f6a6f686e62696c6c696f6e2f6a6f686e62696c6c696f6e406c61746573742f6173736574732f73706f6e736f72732f736572766d61736b2e737667)](https://servmask.com)

Plus all my kind sponsors on GitHub:

[![Sponsors](https://camo.githubusercontent.com/f21a9d0b4d63cceec70d4ceda15b47d46f71bd0a64d2932a05f83d9dd529910f/68747470733a2f2f63646e2e6a7364656c6976722e6e65742f67682f6a6f686e62696c6c696f6e2f6a6f686e62696c6c696f6e406c61746573742f73706f6e736f72732e737667)](https://github.com/sponsors/johnbillion)

[Click here to find out about supporting my open source tools and plugins](https://github.com/sponsors/johnbillion).

###  Health Score

55

—

FairBetter than 98% of packages

Maintenance71

Regular maintenance activity

Popularity46

Moderate usage in the ecosystem

Community17

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 96% 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 ~49 days

Recently: every ~126 days

Total

46

Last Release

166d ago

Major Versions

0.9.0 → 1.0.02022-06-03

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/208434?v=4)[John Blackbourn](/maintainers/johnbillion)[@johnbillion](https://github.com/johnbillion)

---

Top Contributors

[![johnbillion](https://avatars.githubusercontent.com/u/208434?v=4)](https://github.com/johnbillion "johnbillion (290 commits)")[![szepeviktor](https://avatars.githubusercontent.com/u/952007?v=4)](https://github.com/szepeviktor "szepeviktor (12 commits)")

---

Tags

wordpress

### Embed Badge

![Health badge](/badges/johnbillion-wp-hooks/health.svg)

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

PHPackages © 2026

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