• Resolved sinahosseinigst

    (@sinahosseinigst)


    Hello there!

    I have a WordPress project in which I have to use an API to retrieve some data to be display using WPGetAPI. I used both WPGetAPI to set up the API, and WPCode to inject some PHP snippets.

    However, the problem is that using this API, we can only have the information of 100 users per page and nothing more, and there are 300 users overall… And the temporarily solution? I’ve set up WPGetAPI three times to get the users 100 by 100.

    And here’s part of my PHP snippet that uses the API to be looped and finally gives us 300 users:

    $consultants_data = [
    json_decode(wpgetapi_endpoint('all_users', 'get_all_users_1', ['debug' => false])),
    json_decode(wpgetapi_endpoint('all_users', 'get_all_users_2', ['debug' => false])),
    json_decode(wpgetapi_endpoint('all_users', 'get_all_users_3', ['debug' => false]))
    ];

    But I don’t like that since it’s hard-coded, and I want it to dynamically uses some pagination, a feature that has no real example in the docs. Any idea? Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.