简体   繁体   English

如何限制JSON API WordPress插件

[英]How to limited JSON API WordPress plugin

I want use WordPress to create a website, and I want export the site posts with JSON API . 我想使用WordPress创建网站,并希望使用JSON API导出网站帖子。

I want to limit displayed posts by category but when click this link: get_category_posts (JSON API plugin in wordpress setting), I get this error: 我想按类别限制显示的帖子,但是当单击此链接: get_category_posts (wordpress设置中的JSON API插件)时,出现此错误:

{"status":"error","error":"Include 'id' or 'slug' var in your request."} {“状态”:“错误”,“错误”:“在您的请求中包括'id'或'slug'变量。”}

get_category_posts link : link . get_category_posts链接: 链接

How can I limit posts by category in JSON API WordPress plugin? 如何在JSON API WordPress插件中按类别限制帖子?

You've neglected to specify which category you actually want; 您已经忽略了指定实际需要的类别;

http://tellfa.com/tafrihgah/?json=get_category_posts=1

Correctly returns the data for category one for example. 例如,正确返回类别一的数据。

I'm assuming you are using the plugin I've linked to below, you can use either the category ID or the slug. 我假设您使用的是我下面链接的插件,可以使用类别ID或插件。 But you need to specify a category. 但是您需要指定一个类别。

https://wordpress.org/plugins/json-api/other_notes/#Method:-get_category_posts https://wordpress.org/plugins/json-api/other_notes/#Method:-get_category_posts

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM