PDF for GravityView Hooks – gfpdf_gv_render_budget_exempt_caps
Description
Set which capabilities exempt a logged-in user from the render budget. Exempt users are never limited, and their PDFs aren't counted. By default that's anyone with Gravity Forms' gravityforms_view_entries capability (administrators, unless you've given it to other roles).
Add a capability to exempt another role, or return an empty array to put everyone under the budget.
Version
This hook was introduced in PDF for GravityView 2.0.
Arguments
The following arguments are passed to functions that use this hook:
$caps | array
- The capabilities that exempt a user. Holding any one of them is enough.
- Logged-out visitors are never exempt.
- An empty array exempts nobody.
- The default value is
[ 'gravityforms_view_entries' ].
$context | string
- Which PDF type the exemption is for.
- Valid values include:
singledirectory(Multiple Entries PDF)
Usage
Also exempt users who can moderate entries in GravityView (Editors, by default):
add_filter( 'gfpdf_gv_render_budget_exempt_caps', function( $caps, $context ) {
$caps[] = 'gravityview_moderate_entries';
return $caps;
}, 10, 2 );
Put everyone under the budget, including administrators:
add_filter( 'gfpdf_gv_render_budget_exempt_caps', '__return_empty_array' );
Source Code
This filter is located in src/Pdf/Access/RenderBudget.php of the PDF for GravityView extension.