Skip to content

Commit 76fdf2f

Browse files
committed
update hooks in docs
1 parent 38eb955 commit 76fdf2f

2 files changed

Lines changed: 38 additions & 10 deletions

File tree

v5/extension-seo.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ The SEO extension comes with several hooks.
8282
4. Filter - `typerocket_seo_post_types` - Used to control which post types have the SEO meta box.
8383
6. Filter - `typerocket_seo_url` - Used to control the URL used for OG.
8484

85-
### tr_seo_post_types
85+
### typerocket_seo_post_types
8686

8787
If you want to control what post types the meta box is added too, you can use the `typerocket_seo_post_types` filter hook. Only post types added will have the meta box added.
8888

@@ -92,7 +92,7 @@ add_filter('typerocket_seo_post_types', function($types) {
9292
});
9393
```
9494

95-
### tr_seo_fields
95+
### typerocket_seo_fields
9696

9797
If you want to add fields to the SEO metabox, use the `typerocket_seo_fields` action hook.
9898

@@ -102,7 +102,7 @@ add_action('typerocket_seo_fields', function($form) {
102102
});
103103
```
104104

105-
### tr_seo_meta
105+
### typerocket_seo_meta
106106

107107
If you want to add fields to the SEO metabox, you will also want to display them on each page. You can use the `typerocket_seo_meta` action hook to output new meta.
108108

v5/wordpress-hooks.md

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,29 @@ Description: Extend and hook into TypeRocket with actions and filters.
77

88
TypeRocket comes with several hooks to help you extend its core functionality. Not all the hooks are listed here.
99

10-
## Core Loaded
10+
## Actions
1111

12-
The `typerocket_loaded` hook runs during `after_setup_theme`, after TypeRocket core has loaded, and before the TypeRocket registry runs.
12+
### typerocket_loaded
1313

14-
This hook allows WordPress plugins to interact with TypeRocket.
14+
The `typerocket_loaded` hook runs during `after_setup_theme`, after TypeRocket core has loaded, and before the TypeRocket registry runs. This hook allows WordPress plugins to interact with TypeRocket.
1515

1616
```php
1717
add_action('typerocket_loaded', function() {
1818
// do stuff
1919
});
2020
```
2121

22+
### typerocket_before_load
23+
2224
You can also use `typerocket_before_load` if you want to run code before the TypeRocket system is loaded.
2325

24-
! **Note**: If you are creating plugins that interact with TypeRocket you will want to install TypeRocket as an MU plugin.
26+
```php
27+
add_action('typerocket_before_load', function() {
28+
// do stuff
29+
});
30+
```
2531

26-
## Models
32+
### typerocket_model
2733

2834
The `typerocket_model` action hook runs after a model is constructed.
2935

@@ -33,7 +39,29 @@ add_action('typerocket_model', function($model) {
3339
});
3440
```
3541

36-
## Middleware
42+
### typerocket_after_routes
43+
44+
The `typerocket_after_routes` action hook runs after the TypeRocket `public.php` route file is loaded.
45+
46+
```php
47+
add_action('typerocket_after_routes', function() {
48+
// do stuff
49+
});
50+
```
51+
52+
### typerocket_kernel
53+
54+
The `typerocket_kernel` action hook runs when `TypeRocket\Http\HttpKernel` is instantiated.
55+
56+
```php
57+
add_action('typerocket_kernel', function($kernel) {
58+
// do stuff
59+
});
60+
```
61+
62+
## Filters
63+
64+
### typerocket_middleware
3765

3866
Return the middleware stack for the current hook call or REST API request.
3967

@@ -43,7 +71,7 @@ add_filter('typerocket_middleware', function($middleware, $globalGroup) {
4371
}, 10, 2);
4472
```
4573

46-
## Extensions List
74+
### typerocket_extensions
4775

4876
Modify the plugins that should be loaded.
4977

0 commit comments

Comments
 (0)