WordPress.org

Forums

WP REST API (WP API)
Basic Usage Questions (4 posts)

  1. daitoku
    Member
    Posted 1 year ago #

    Some basic questions.

    1. Out of the box if writing(POST) disabled? Most of my use cases are read only. If not how can I make it read only?

    2. I noticed that the returns are based on post count under settings>reading, how can I return all posts if I want to? I tried:
    test.dev/wp-json/posts?posts_per_page=-1
    test.dev/wp-json/posts?nopaging=true

    Thanks,
    Eric

    https://wordpress.org/plugins/json-rest-api/

  2. aryanduntley
    Member
    Posted 11 months ago #

    1) Out of the box, valid authorization (correct user privileges) must be set before anyone accessing the API can successfully resolve any create/edit/put requests. The same goes with certain get requests.

    2) wp-json/posts/?type=myposttype&page=1&filter[posts_per_page]=1

  3. jarace87
    Member
    Posted 11 months ago #

    For all posts it would be -1

    wp-json/posts?filter[posts_per_page]=-1

  4. aryanduntley
    Member
    Posted 11 months ago #

    correct

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP REST API (WP API)
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic