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

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

wp-hooks/wordpress-core
=======================

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

1.12.0(1mo ago)125443.8k—9.9%6[1 issues](https://github.com/wp-hooks/wordpress-core-hooks/issues)[1 PRs](https://github.com/wp-hooks/wordpress-core-hooks/pulls)4GPL-3.0-or-laterShellCI passing

Since Oct 28Pushed 1mo ago7 watchersCompare

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

READMEChangelog (10)Dependencies (10)Versions (52)Used By (4)

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

[](#wordpress-hooks-reference)

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

Last updated for WordPress 7.0.

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) [![WP Staging](https://camo.githubusercontent.com/27614144605dcbbce9c3afe2584fc82e20a6a30d2b94b570d45930b08f9ce49e/68747470733a2f2f63646e2e6a7364656c6976722e6e65742f67682f6a6f686e62696c6c696f6e2f6a6f686e62696c6c696f6e406c61746573742f6173736574732f73706f6e736f72732f77702d73746167696e672e706e67)](https://wp-staging.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

63

—

FairBetter than 99% of packages

Maintenance91

Actively maintained with recent releases

Popularity52

Moderate usage in the ecosystem

Community21

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 96.2% 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 ~52 days

Recently: every ~133 days

Total

47

Last Release

42d 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 (302 commits)")[![szepeviktor](https://avatars.githubusercontent.com/u/952007?v=4)](https://github.com/szepeviktor "szepeviktor (12 commits)")

---

Tags

wordpress

### Embed Badge

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

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

###  Alternatives

[tanigami/specification

Basic classes for Specification pattern in PHP.

3351.3k1](/packages/tanigami-specification)[prodigious/sonata-menu-bundle

This bundle provides menu management by sonata admin bundle (compatible with sonata page bundle).

1029.6k](/packages/prodigious-sonata-menu-bundle)

PHPackages © 2026

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