Last active
April 4, 2017 21:04
-
-
Save Tmeister/789ab06c63ab49f4a0cc5752ed06c68d to your computer and use it in GitHub Desktop.
Change the Maximum per_page value in the Query
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function change_end_points_default_values($endpoints){ | |
/** | |
* Posts EndPoint | |
* print_r($endpoints['/wp/v2/posts']); | |
* | |
* Argumentos Originales | |
* | |
* Array | |
* ( | |
* [description] => Maximum number of items to be returned in result set. | |
* [type] => integer | |
* [default] => 10 | |
* [minimum] => 1 | |
* [maximum] => 100 | |
* [sanitize_callback] => absint | |
* [validate_callback] => rest_validate_request_arg | |
* ) | |
*/ | |
$endpoints['/wp/v2/posts'][0]['args']['per_page']['maximum'] = 1000; | |
return $endpoints; | |
} | |
add_filter('rest_endpoints', 'change_end_points_default_values'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment