Skip to content

Commit 924336c

Browse files
committed
Docs.
1 parent 0abcbff commit 924336c

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@johnbillion/wp-hooks-generator",
33
"version": "0.8.0",
4-
"description": "Scans the WordPress actions and filters in your code and saves them as JSON.",
4+
"description": "Generates a JSON representation of the WordPress actions and filters in your code",
55
"private": true,
66
"repository": {
77
"type": "git",

readme.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# wp-hooks-generator
1+
# WP Hooks Generator
22

33
Generates a JSON representation of the WordPress actions and filters in your code. Can be used with WordPress plugins, themes, and core.
44

@@ -14,14 +14,16 @@ composer require wp-hooks/generator
1414

1515
## Generating the Hook Files
1616

17-
./bin/wp-hooks-generator --input=src --output=hooks
17+
```shell
18+
./bin/wp-hooks-generator --input=src --output=hooks
19+
```
1820

1921
## Usage of the Generated Hook Files in PHP
2022

2123
```php
2224
// Get hooks as JSON:
23-
$actions_json = file_get_contents( 'hook/actions.json' );
24-
$filters_json = file_get_contents( 'hook/filters.json' );
25+
$actions_json = file_get_contents( 'hooks/actions.json' );
26+
$filters_json = file_get_contents( 'hooks/filters.json' );
2527

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

0 commit comments

Comments
 (0)