Skip to content

Commit 798e231

Browse files
authored
Merge pull request #109 from Oblivious1/patch-1
Update backbone-javascript-client.md
2 parents c1b1240 + df4e057 commit 798e231

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

using-the-rest-api/backbone-javascript-client.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ post.getRevisions().done( function( revisions ){
241241
});
242242
```
243243

244-
If you add custom endpoints to the API they will also become available as models/collections. For example, you will get new models and collections when you [add REST API support to your custom post type](https://developer.wordpress.org/rest-api/extending-the-rest-api/adding-rest-api-support-for-custom-content-types/). Note: Because the schema is stored in the user's session cache to avoid re-fetching, you may need to open a new tab to get a new read of the Schema.
244+
If you add custom endpoints to the API they will also become available as models/collections. For example, you will get new models and collections when you [add REST API support to your custom post type](https://developer.wordpress.org/rest-api/extending-the-rest-api/adding-rest-api-support-for-custom-content-types/). To access custom endpoints created, use the item's JSON endpoint name as CamelCase; for example if the item is found at the JSON path of /wp-json/wp/v2/my-custom-post, it can be accessed via the api at wp.api.collections.MyCustomPost. Note: Because the schema is stored in the user's session cache to avoid re-fetching, you may need to open a new tab to get a new read of the Schema.
245245

246246
```js
247247
// Extend wp.api.models.Post and wp.api.collections.Posts to load a custom post type

0 commit comments

Comments
 (0)