Skip to main content

PDF for GravityView Hooks – gfpdf_gv_share_pdf_limit_exempt_caps

Description​

Logged-in users with any of these capabilities skip the Share PDF limits, and their emails aren't counted. By default that's anyone with the Gravity Forms gravityforms_view_entries capability (administrators, unless you've given it to other roles).

Use this filter to exempt another role, or return an empty array to apply the limits to everyone. It doesn't affect the render budget, which has its own exemptions.

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 limit the exemption is for. An exemption from share_client also covers the share_address and share_network counters.
  • Valid values include: share_client share_recipient share_recipient_daily share_site

Usage​

Also exempt users who can moderate entries in GravityView (Editors, by default):

add_filter( 'gfpdf_gv_share_pdf_limit_exempt_caps', function( $caps, $context ) {
$caps[] = 'gravityview_moderate_entries';

return $caps;
}, 10, 2 );

Apply the limits to everyone, including administrators:

add_filter( 'gfpdf_gv_share_pdf_limit_exempt_caps', '__return_empty_array' );

Source Code​

This filter is located in src/Pdf/Access/RenderBudget.php of the PDF for GravityView extension.