按它们在管理员中出现的顺序查询 WordPress (REST) 帖子 [英] Query WordPress (REST) posts by the order they appear on the admin

查看:41
本文介绍了按它们在管理员中出现的顺序查询 WordPress (REST) 帖子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Post Types Order 插件重新排序 WP 上的帖子管理员.

I am using the Post Types Order plugin to re-order posts on WP Admin.

有没有办法按那个顺序获取 WP REST API?

Is there a way to fetch WP REST API by that order?

/wp-json/wp/v2/posts?orderby ??

WP Rest Api 文档仅显示以下顺序:日期、ID、包含、标题、slug

WP Rest Api docs only shows order by: date, id, include, title, slug

推荐答案

只需在查询中省略 orderby 即可:

Just omit orderby from the query and it will do it:

/wp-json/wp/v2/posts?per_page=20&page=1

这篇关于按它们在管理员中出现的顺序查询 WordPress (REST) 帖子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆