[wp-trac] [WordPress Trac] #40798: Backbone.js throws exception with custom endpoint
WordPress Trac
noreply at wordpress.org
Thu May 18 12:23:35 UTC 2017
#40798: Backbone.js throws exception with custom endpoint
--------------------------+-----------------------------------
Reporter: lucrus | Owner:
Type: defect (bug) | Status: closed
Priority: normal | Milestone:
Component: REST API | Version: 4.7.4
Severity: normal | Resolution: invalid
Keywords: | Focuses: javascript, rest-api
--------------------------+-----------------------------------
Changes (by adamsilverstein):
* status: new => closed
* resolution: => invalid
* milestone: Awaiting Review =>
Comment:
@lucrus i looked at your code briefly and it looks like you aren't setting
up the wp-api client correctly.
Please see the original documentation here:
https://developer.wordpress.org/rest-api/using-the-rest-api/backbone-
javascript-client/
Also, see this ticket which discusses connecting to multiple namespaces -
if your endpoint isn't in the wp/v2 namespace, you need to call
wp.api.init with the new namespace. #39683
make sure you clear sessionStorage in your browser when making init
changes as the client caches the parsed endpoints.
Closing this ticket because I don't think there is a bug, happy to help
you get your code working - ping me in the #core-rest-api slack channel or
leave a follow up on your existing stackexchange post.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/40798#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list