It's really possible to get more then 100 posts or terms (tags, categories).
You should use rest_{$this->post_type}_query
hook (for posts) or rest_{$this->taxonomy}_query
hook for terms.
But you have to know, that it's impossible to pass a per_page
arg in your GET
request with more then 100 value. WP API
will throw an error immediately (the hook will not help): per_page must be between 1 (inclusive) and 100 (inclusive)
(with 400 http status).
To get around this problem you should pass a per page
value in another get
argument. And after this to trace this value in your hook.
So the code is:
For posts
add_filter( 'rest_post_query', 's976_rest_post_per_page', 2, 10 );
function s976_rest_post_per_page( array $args, WP_REST_Request $request ) {
$post_per_page = $request->get_param('s976_per_page') ? $request->get_param('s976_per_page') : 10;
$args['posts_per_page'] = $post_per_page;
return $args;
}
For terms
add_filter( 'rest_category_query', 's976_rest_cats_per_page', 2, 10 );
function s976_rest_cats_per_page( array $prepared_args, WP_REST_Request $request ){
$cats_per_page = $request->get_param('s976_per_page') ? $request->get_param('s976_per_page') : 10;
$prepared_args['number'] = $cats_per_page;
return $prepared_args;
}
Of course, for this to work, you have to pass s976_per_page
(with any value like 500, 99999) argument in GET
request.