Skip to content

Instantly share code, notes, and snippets.

@petenelson
Created August 26, 2015 18:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save petenelson/8324b91c0042dfe1743a to your computer and use it in GitHub Desktop.
Save petenelson/8324b91c0042dfe1743a to your computer and use it in GitHub Desktop.
WordPress REST API: Modify Request Parameters
<?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