node-wpapi icon indicating copy to clipboard operation
node-wpapi copied to clipboard

I have a custom post type "coupon" can I use wpapi to create a new coupon entry?

Open Goussaka opened this issue 4 years ago • 1 comments

I have a custom post type "coupon" can I use wpapi to create a new coupon entry? i use this code await wp.types().type('coupon').get({}) i get the result below

================ DONE ==================== { description: '', hierarchical: false, name: 'Coupons', slug: 'coupon', taxonomies: [ 'coupon-category', 'coupon-store' ], rest_base: 'coupon',

.....

Goussaka avatar Sep 02 '21 09:09 Goussaka

Try this: wp.coupon().create({title: 'My Coupon', status: 'publish'}).then(data => {/* do something with response */});

northwest-dev avatar Dec 16 '21 13:12 northwest-dev