Created
August 26, 2015 18:46
-
-
Save petenelson/8324b91c0042dfe1743a to your computer and use it in GitHub Desktop.
WordPress REST API: Modify Request Parameters
This file contains 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 | |
add_filter( 'rest_dispatch_request', 'map_legacy_parameters', 10, 2 ); | |
function map_legacy_parameters( $response, $request ) { | |
$request->set_param( 'per_page' , $request->get_param( 'limit' ) ); | |
return $response; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment