wordpress-rest-api

WooCommerce REST API GET multiple products by ID

僤鯓⒐⒋嵵緔 提交于 2021-01-27 05:39:39
问题 I need to display all related products by eah product I have in my list. Eg, In my app I have 3 products with id 1, 2, 3 product id 1 has 5,6,7 as related, product id 2 with related 8 and 9 etc.. Now I have an array with all the related [5,6,7,8,9..] How can I get only this ones from REST API? I can call by single ID like that site.com/wp-json/wc/v2/products/5/ But doesn't work with multiple IDs like ../products/5/6/ or ../products/5,6/ Is this possible? 回答1: you could use parameter 'include'

wordpress rest api v2 how to list taxonomy terms?

吃可爱长大的小学妹 提交于 2020-12-29 06:26:28
问题 i am new to v2, i use v1 for long time, currently upgrade to v2, i try to get all the terms belong to specific custom taxonomy. In v1 i can do this to get terms /taxonomies/location_category/terms but in v2 i try /taxonomies/terms it return json error "code":"rest_no_route","message":"No route was found matching the URL and request method","data":{"status" :404}} if just /taxonomies/location_category/ it didn't show anything terms belong to taxonomy. i search the question on google for few

How to include META fields in Wordpress API Post?

我是研究僧i 提交于 2020-12-26 06:37:00
问题 I am using Wordpress version 5.2.1 which means I am not using a plugin for the WP API. I have working code which creates a new post (using a custom post type) on my WP site, all good there. The problem is that i've created custom fields using ACF, but they're not appearing in the newly created post. The following is an example of what I am sending to WP via: /wp-json/wp/v2/experience . Note: experience is my custom post type. {'title': 'test', 'content': 'testing from python', 'status':

How to include META fields in Wordpress API Post?

人盡茶涼 提交于 2020-12-26 06:36:30
问题 I am using Wordpress version 5.2.1 which means I am not using a plugin for the WP API. I have working code which creates a new post (using a custom post type) on my WP site, all good there. The problem is that i've created custom fields using ACF, but they're not appearing in the newly created post. The following is an example of what I am sending to WP via: /wp-json/wp/v2/experience . Note: experience is my custom post type. {'title': 'test', 'content': 'testing from python', 'status':

Can not authenticate a user who is not an administrator

谁说胖子不能爱 提交于 2020-08-08 06:40:11
问题 I am building a flutter app and I want users to be able to authenticate using their wordpress credentials. I am using https://wordpress.org/plugins/jwt-authentication-for-wp-rest-api/#description and https://github.com/dreamsoftin/flutter_wordpress to make it easier. import 'package:flutter/material.dart'; import 'package:flutter_wordpress/flutter_wordpress.dart' as wp; void main() => runApp(MyApp()); wp.WordPress wordPress = wp.WordPress( baseUrl: 'https://sandbox.myfprod.fr/', authenticator