Skip to content

Instantly share code, notes, and snippets.

@Idealien
Created February 12, 2018 17:55
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 Idealien/e614d390529ab7bdb397339ddd3d4da0 to your computer and use it in GitHub Desktop.
Save Idealien/e614d390529ab7bdb397339ddd3d4da0 to your computer and use it in GitHub Desktop.
Gravity Forms Web API v2 - /form/##/entries/ - Authorisation by Form ID
<?php
add_filter( "gform_rest_api_capability_get_entries", "gfapi2_authorization_by_form", 10, 2);
function gfapi2_authorization_by_form( $capability, $request ) {
$form_id = $request->get_param("form_id");
if( $form_id == '16' ) {
$capability = 'read';
}
return $capability;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment