Download the PHP package johnbillion/wp-hooks without Composer
On this page you can find all versions of the php package johnbillion/wp-hooks. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download johnbillion/wp-hooks
More information about johnbillion/wp-hooks
Files in johnbillion/wp-hooks
Package wp-hooks
Short Description All the actions and filters from WordPress core in machine-readable JSON format.
License GPL-3.0-or-later
Informations about the package wp-hooks
WordPress Hooks Reference
All the actions and filters from WordPress core in machine-readable JSON format.
Last updated for WordPress 6.6.
Installation
-
As a Composer package for use in PHP:
- As an npm package for use in JavaScript or TypeScript:
Usage in PHP
Usage in JavaScript
Importing in TypeScript
Interfaces for the components of the hooks can be imported too, if you need them:
Actions, Filters, and Schemas
- The actions can be found in hooks/actions.json
- The filters can be found in hooks/filters.json
- The JSON schema can be found in hooks/schema.json
- The TypeScript interfaces can be found in interface/index.d.ts
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
- Autocomplete WordPress action and filter names in Vim
- WordPress plugin for Psalm
Regenerating the Hook Files
Change the roots/wordpress-full
version in composer.json to the required WordPress version, or dev-main
for nightly.
Install the dependencies:
Then run:
Some scripts are available for checking the data:
-
Check everything:
-
Find hooks with missing
@since
tags: - Find hooks with incorrect number of
@param
tags (not completely accurate, not sure why):
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. It can generate hook files for WordPress plugins and themes as well as core.
Sponsors
The time that I spend maintaining this library and others is in part sponsored by:
Plus all my kind sponsors on GitHub: