Is it safe to use PUT and DELETE requests
Is it safe to use PUT and DELETE requests
Is it safe to use PUT and DELETE requests
You get an 401 because your AJAX isn’t authorized to delete Posts. Would be a big Problem, if everyone could send such Kind of AJAX-requests to your WordPress and delete all your Content. As of the API, your JS code has to be modifyed to something like this: … //make the request var dataArray = … Read more
Assuming you’re running cron jobs under your user account, it will have access to any folder that your account has read access to. If you do not need them to be publicly accessible, and you have access to a folder outside your public web root, then for security purposes you should put them outside of … Read more
Well, you can add ?page={$page_number} to the URL that you’re requesting. See, for example, http://demo.wp-api.org/wp-json/wp/v2/posts/?page=2. It appears to split the posts into pages of 10. Reference WP-API documentation (I found this in the docs for v1 of the API, but per the sample URL above, it works on v2 as well)
GET request for media files in WP REST API 2 results in an empty array
Ok, that was quick. Pass in the parent id, and it works. someKey.save({parent: parentId});
Use the WP API to pull in content, posts, pages. I don’t think that menus are in the API and I found that I wanted my own menu structure for my WP/angular apps anyway.
Post ID is not an external ID of the post but an internal one and you should not expect any consistency in it. Since almost everything is stored at the post table the value of ID depends not only on the number of “true” posts but also the number of revisions, images and any other … Read more
You’re running the query but you’re immediately afterwards printing it out, you need to call the method get_posts or use something like a while statement with have_posts: https://codex.wordpress.org/Class_Reference/WP_Query
Take a look at this: https://jsfiddle.net/9j96jbxn/1/ Replace your data.forEach(function (element) {…} with a nested for loop. This should get you close to what you are looking for.