You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: legacy/v2/response.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ Description: Manage the HTTP JSON response for the REST API.
3
3
4
4
---
5
5
6
-
The TypeRocket `Response` class is used to manage the HTTP JSON response for the [REST API](/docs/rest-api/). The `Response` is also used to declare the validity of the HTTP request with the method `setInvalid()`.
6
+
The TypeRocket `Response` class is used to manage the HTTP JSON response for the [REST API](/docs/v2/rest-api/). The `Response` is also used to declare the validity of the HTTP request with the method `setInvalid()`.
7
7
8
8
When a `Response` is defined as "invalid" by the middleware, before the controller is called, the controller will be skipped.
Theme options are commonly used to manage the global elements of a WordPress theme's design. These elements could be as simple as the copy right information at the bottom of every page; to API keys for Google Maps or Facebook Sharing.
18
18
19
-
You can use any of the fields that come with the [forms api](https://typerocket.com/docs/forms/). This means you can have 18+ types of fields.
19
+
You can use any of the fields that come with the [forms api](/docs/v2/forms/). This means you can have 18+ types of fields.
Copy file name to clipboardExpand all lines: legacy/v3/post-and-page-fields.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ Custom fields are a necessity when your client needs to edit their own content.
9
9
10
10
## Adding custom fields to posts
11
11
12
-
With just a few lines of code you can add the banner and subheading fields to the WordPress `post` post type using TypeRocket. All you need to do is create a [meta box](https://typerocket.com/docs/meta-boxes/) and add it to the `post` screen. Then you can define a content callback and create the fields you need using the [forms API](https://typerocket.com/docs/forms/).
12
+
With just a few lines of code you can add the banner and subheading fields to the WordPress `post` post type using TypeRocket. All you need to do is create a [meta box](/docs/v3/meta-boxes/) and add it to the `post` screen. Then you can define a content callback and create the fields you need using the [forms API](/docs/v3/forms/).
13
13
14
14
Here you can add everything you need in your theme's `functions.php` file.
Copy file name to clipboardExpand all lines: v1/curl-client.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ Description: A simple cURL client.
7
7
8
8
**IMPORTANT**: You must have the PHP cURL extension installed to use this class.
9
9
10
-
TypeRocket provides a simple [cURL]([https://www.php.net/manual/en/book.curl.php](https://www.php.net/manual/en/book.curl.php)) Http client. Take a look at sending a POST request.
10
+
TypeRocket provides a simple [cURL](https://www.php.net/manual/en/book.curl.php) Http client. Take a look at sending a POST request.
`useErrors()` looks for the cookie `tr_redirect_errors` and the `tr_redirect_errors` WordPress transient. The `tr_redirect_errors` cookie and transient can only be accessed once (after this is will be deleted).
742
742
743
-
If the `tr_redirect_errors` cookie is found the form will use the field errors within that cookie to display inline field errors. The best way to set the `tr_redirect_errors` cookie and apply fields to that cookie is to use [HTTP fields](docs/v1/http-fields) or a [validator](/docs/vs/validator)[redirect errors](/docs/v1/validator/#section-get-errors-redirect-on-error).
743
+
If the `tr_redirect_errors` cookie is found the form will use the field errors within that cookie to display inline field errors. The best way to set the `tr_redirect_errors` cookie and apply fields to that cookie is to use [HTTP fields](/docs/v1/http-fields) or a [validator](/docs/v1/validator)[redirect errors](/docs/v1/validator/#section-get-errors-redirect-on-error).
744
744
745
745
If you do not want to use cookies for the validation, you can provide an override array.
746
746
@@ -773,7 +773,7 @@ $form->disableAjax();
773
773
774
774
## Use TypeRocket REST API
775
775
776
-
You can tell forms to use the [TypeRocket REST API](https://typerocket.com/docs/v1/json-api/) using the `useRest()` method. This method enables AJAX mode for the form as well.
776
+
You can tell forms to use the [TypeRocket REST API](https://typerocket.com/docs/v1/rest-api/) using the `useRest()` method. This method enables AJAX mode for the form as well.
Copy file name to clipboardExpand all lines: v1/theme-templating.md
+3-3
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ To understand the TypeRocket theme templating system lets walk through an exampl
9
9
10
10
## Template Routing & Controllers
11
11
12
-
WordPress uses what is called the [template hierarchy]([https://developer.wordpress.org/themes/basics/template-hierarchy/](https://developer.wordpress.org/themes/basics/template-hierarchy/)) to route user http requests.
12
+
WordPress uses what is called the [template hierarchy](https://developer.wordpress.org/themes/basics/template-hierarchy/) to route user http requests.
13
13
14
14
In WordPress, the theme templates do three things:
15
15
@@ -24,7 +24,7 @@ On the other hand, TypeRocket's template router seamlessly integrates into the W
24
24
- WordPress core templates only allow for 400 error handling. The template router allows for 500, 401, 403, or any other error templates to be used.
25
25
- Takes your view out of the global scope, greatly reducing your chances of variable naming collisions, thus reducing the odds for bugs.
26
26
- Affords you the opportunity to routes requests based on the HTTP methods of `POST`, `PUT`, `GET`, or `DELETE` in an eloquent way.
27
-
- Empowers the practice of [the SOLID design principle]([https://en.wikipedia.org/wiki/SOLID](https://en.wikipedia.org/wiki/SOLID)).
27
+
- Empowers the practice of [the SOLID design principle](https://en.wikipedia.org/wiki/SOLID).
28
28
29
29
Take a look at an example `single-post.php` file.
30
30
@@ -128,7 +128,7 @@ class Post extends WPPost
128
128
}
129
129
```
130
130
131
-
These methods allow us to access [the WordPress template tags for the post]([https://developer.wordpress.org/themes/references/list-of-template-tags/#post-tags](https://developer.wordpress.org/themes/references/list-of-template-tags/#post-tags)). You can add as many of these as your site needs.
131
+
These methods allow us to access [the WordPress template tags for the post](https://developer.wordpress.org/themes/references/list-of-template-tags/#post-tags). You can add as many of these as your site needs.
132
132
133
133
The main benefit of using models over the WordPress loops, in our view, will be the ability to encapsulate the logic of our views into the model.
Copy file name to clipboardExpand all lines: v4/post-and-page-fields.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ Custom fields are a necessity when your client needs to edit their own content.
9
9
10
10
## Adding custom fields to posts
11
11
12
-
With just a few lines of code, you can add the banner and subheading fields to the WordPress `post` post type using TypeRocket. All you need to do is create a [meta box](https://typerocket.com/docs/meta-boxes/) and add it to the `post` screen. Then you can define a content callback and create the fields you need using the [forms API](https://typerocket.com/docs/forms/).
12
+
With just a few lines of code, you can add the banner and subheading fields to the WordPress `post` post type using TypeRocket. All you need to do is create a [meta box](/docs/v4/meta-boxes/) and add it to the `post` screen. Then you can define a content callback and create the fields you need using the [forms API](/docs/v4/forms/).
13
13
14
14
Here you can add everything you need in your theme's `functions.php` file.
If you are [registering a post type with TypeRocket](https://typerocket.com/post-types-stacked/) and only want the main title field you can use the `setArgument()` method instead.
38
+
If you are [registering a post type with TypeRocket](https://typerocket.com/docs/v4/post-types) and only want the main title field you can use the `setArgument()` method instead.
To set an icon for the admin page use the `setIcon()` method. Use a [WordPress dashicon]([https://developer.wordpress.org/resource/dashicons/#heart](https://developer.wordpress.org/resource/dashicons/#heart)).
67
+
To set an icon for the admin page use the `setIcon()` method. Use a [WordPress dashicon](https://developer.wordpress.org/resource/dashicons/#heart).
Copy file name to clipboardExpand all lines: v5/controllers.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -104,7 +104,7 @@ Because WordPress does not use an MVC architecture TypeRocket spoofs this design
104
104
105
105
## Dynamically Set Middleware
106
106
107
-
There are times when you do not want the global resource [middleware](/docs/v5/middleware/) stack to be called for specific methods of a controller by the [kernel](/docs/v5/kernel/). To dynamically set the middleware stack use the `__construct()` method on a controller and the `addMiddleware()` method.
107
+
There are times when you do not want the global resource [middleware](/docs/v5/middleware/) stack to be called for specific methods of a controller by the [kernel](/docs/v5/middleware/#section-register-middleware). To dynamically set the middleware stack use the `__construct()` method on a controller and the `addMiddleware()` method.
108
108
109
109
For example, take a member controller where you want to have different middleware for the login methods.
Copy file name to clipboardExpand all lines: v5/curl-client.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ Description: A simple cURL client.
9
9
10
10
**IMPORTANT**: You must have the PHP cURL extension installed to use this class.
11
11
12
-
TypeRocket provides a simple [cURL]([https://www.php.net/manual/en/book.curl.php](https://www.php.net/manual/en/book.curl.php)) Http client. Take a look at sending a POST request.
12
+
TypeRocket provides a simple [cURL](https://www.php.net/manual/en/book.curl.php) Http client. Take a look at sending a POST request.
`useErrors()` looks for the cookie `tr_redirect_errors` and the `tr_redirect_errors` WordPress transient. The `tr_redirect_errors` cookie and transient can only be accessed once (after this is will be deleted).
757
757
758
-
If the `tr_redirect_errors` cookie is found the form will use the field errors within that cookie to display inline field errors. The best way to set the `tr_redirect_errors` cookie and apply fields to that cookie is to use [HTTP fields](docs/v1/http-fields) or a [validator](/docs/vs/validator)[redirect errors](/docs/v5/validator/#section-get-errors-redirect-on-error).
758
+
If the `tr_redirect_errors` cookie is found the form will use the field errors within that cookie to display inline field errors. The best way to set the `tr_redirect_errors` cookie and apply fields to that cookie is to use [HTTP fields](/docs/v1/http-fields) or a [validator](/docs/v5/validator)[redirect errors](/docs/v5/validator/#section-get-errors-redirect-on-error).
759
759
760
760
If you do not want to use cookies for the validation, you can provide an override array.
761
761
@@ -788,7 +788,7 @@ $form->disableAjax();
788
788
789
789
## Use TypeRocket REST API
790
790
791
-
You can tell forms to use the [TypeRocket REST API](https://typerocket.com/docs/v5/json-api/) using the `useRest()` method. This method enables AJAX mode for the form as well.
791
+
You can tell forms to use the [TypeRocket REST API](https://typerocket.com/docs/v5/rest-api/) using the `useRest()` method. This method enables AJAX mode for the form as well.
Copy file name to clipboardExpand all lines: v5/theme-templating.md
+3-3
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ To understand the TypeRocket theme templating system lets walk through an exampl
11
11
12
12
## Template Routing & Controllers
13
13
14
-
WordPress uses what is called the [template hierarchy]([https://developer.wordpress.org/themes/basics/template-hierarchy/](https://developer.wordpress.org/themes/basics/template-hierarchy/)) to route user http requests.
14
+
WordPress uses what is called the [template hierarchy](https://developer.wordpress.org/themes/basics/template-hierarchy/) to route user http requests.
15
15
16
16
In WordPress, the theme templates do three things:
17
17
@@ -26,7 +26,7 @@ On the other hand, TypeRocket's template router seamlessly integrates into the W
26
26
- WordPress core templates only allow for 400 error handling. The template router allows for 500, 401, 403, or any other error templates to be used.
27
27
- Takes your view out of the global scope, greatly reducing your chances of variable naming collisions, thus reducing the odds for bugs.
28
28
- Affords you the opportunity to routes requests based on the HTTP methods of `POST`, `PUT`, `GET`, or `DELETE` in an eloquent way.
29
-
- Empowers the practice of [the SOLID design principle]([https://en.wikipedia.org/wiki/SOLID](https://en.wikipedia.org/wiki/SOLID)).
29
+
- Empowers the practice of [the SOLID design principle](https://en.wikipedia.org/wiki/SOLID).
30
30
31
31
Take a look at an example `single-post.php` file.
32
32
@@ -162,7 +162,7 @@ class Post extends WPPost
162
162
}
163
163
```
164
164
165
-
These methods allow us to access [the WordPress template tags for the post]([https://developer.wordpress.org/themes/references/list-of-template-tags/#post-tags](https://developer.wordpress.org/themes/references/list-of-template-tags/#post-tags)). You can add as many of these as your site needs.
165
+
These methods allow us to access [the WordPress template tags for the post](https://developer.wordpress.org/themes/references/list-of-template-tags/#post-tags). You can add as many of these as your site needs.
166
166
167
167
The main benefit of using models over the WordPress loops, in our view, will be the ability to encapsulate the logic of our views into the model.
0 commit comments