-
Notifications
You must be signed in to change notification settings - Fork 191
Closed
Description
After nearly two weeks of trying to get WP-API working for my simple project/use, I've landed here thanks to @kadamwhite. I'm running a simple JS app within a Wordpress page. I want to save data specific to the logged-in user to the database. Using WP-API is ideal for this in my case. I'm nearly there, finally! Except for that bloody infuriating authentication again. I'm accessing draft/private posts.
So, how exactly do I;
function getPosts() {
//wp.users().auth("USER","PASS").me();
wp.posts().users().me().context('edit').param('status', 'draft').then(function (posts) {
console.log(posts);
});
};
But make sure the current WP User is authenticated? wp.users().me() looks about right, but what is the correct method?
Thanks!
Metadata
Metadata
Assignees
Labels
No labels