首页 > 其他技术 > WordPress4.4之后原生支持REST API 2018年04月10日

WordPress4.4之后原生支持REST API

WordPress4.4之后REST API
格式:www.网址/wp-json/wp/v2,例:www.v5u.win/wp-json/wp/v2
路由参数有五个,posts,pages,categories,tags,comments。
例:www.v5u.win/wp-json/wp/v2/posts
url参数有:
per_page(每页记录数),
page(页码),
orderby(排序规则),
order(排序方式)
例:?per_page=8&page=1&orderby=date&order=desc每页显示8条,第一页,以时间排序,降序展示。

官方文档REST API在这里查看: https://developer.wordpress.org/rest-api/


仅有 1 条评论

  1. 2018/04/16

    I know this if off topic but I’m looking into starting my
    own blog and was wondering what all is required to get set up?
    I’m assuming having a blog like yours would cost a pretty penny?
    I’m not very web smart so I’m not 100% sure. Any recommendations or advice would be greatly appreciated.
    Kudos

添加新评论

© 2018 范子-金玉游龙 . 由 WordPress 强力驱动 | Theme By Jimmy & PCDotFan