question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I can’t seem to add a post. I’m getting this error when I follow the example in the readme:

TypeError: wp.posts(…).create is not a function

Code:

wp.posts().create({
    // "title" and "content" are the only required properties
    title: 'Your Post Title',
    content: 'Your post content',
    // Post will be created as a draft by default if a specific "status"
    // is not specified
    status: 'publish'
}).then(function( response ) {
    // "response" will hold all properties of your newly-created post,
    // including the unique `id` the post was assigned on creation
    console.log( response.id );
})

I also tried to change it to wp.posts().post which gives me this error:

Unhandled rejection Error: Unauthorized

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:12

github_iconTop GitHub Comments

1reaction
kadamwhitecommented, Jul 26, 2016

@mrkrumhausen Can I ask you to ask that other question in a new issue? 😃 I’m going to close this one.

As to the documentation note, we currently mention the basic auth plugin both in the authentication section of this plugin and the authentication guide on the docs site, but I’m open to adding more references if you have suggestions for other callouts.

0reactions
kadamwhitecommented, Jul 26, 2016

Good suggestion, thank you! We’re close to v0.9 (with media support) and could sneak a docs reorg in there.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Free Graphic Maker: Make Your Own Social Media Posts
The Adobe Express free online social media graphic maker helps you easily create your own custom social media designs in minutes. All creative...
Read more >
Design Awesome Social Media Graphics With Canva
1. Open up Canva and search for "Social Media Graphics" to start designing. 2. Explore social media graphics for every industry and theme,...
Read more >
Free Online Facebook Post Maker - Create - VistaCreate
Want your Facebook posts to get noticed, liked, and shared? Create your own stunning DIY designs using the VistaCreate's free post maker.
Read more >
Free Facebook Post Maker - Create Beautiful Posts - Visme
Creating beautiful posts is easy with our free Facebook post maker. Take your Facebook page to the next level with our editable Facebook...
Read more >
How to Create a Facebook Post - YouTube
Posting on Facebook is key to engaging and growing your followers. You can use posts to share your business updates (hours of operation), ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found