{
"code": "rest_invalid_param",
"message": "Invalid parameter(s): per_page",
"data": {
"status": 400,
"params": {
"per_page": "per_page must be between 1 (inclusive) and 100 (inclusive)"
}
}
}
I am trying to get the 150 categories from the woo-commerce using the wp JSON API. I can’t make it 100.is there any way to fix this using the hooks.
2
Answers
Don’t miss to replace customer with your post type in hook
Looking at the documentation here:
https://developer.wordpress.org/rest-api/using-the-rest-api/pagination/
It looks like the per_page parameter can have any integer value between 1 and 100. So the answer to your question is NO
If you want to hard code
/wp-includes/rest-api/endpoints/class-wp-rest-controller.php #L381