PDF for GravityView Hooks – gfpdf_gv_render_budget_logged_in_multiplier
Description
Change how much larger a logged-in user's render budget is than a logged-out visitor's. The default is twice as large. The multiplier is applied after gfpdf_gv_render_budget, so changing the base budget keeps the same ratio. It has no effect when the budget is turned off.
Version
This hook was introduced in PDF for GravityView 2.0.
Arguments
The following arguments are passed to functions that use this hook:
$multiplier | int|float
- What the budget is multiplied by for a logged-in user. The result is rounded to a whole number.
- Fractions are allowed, such as
1.5. - A value of
0or below gives logged-in users a budget of 1 unit (one PDF per window). To turn the budget off, use gfpdf_gv_render_budget. - The default value is
2.
$context | string
- Which PDF type the budget is for.
- Valid values include:
singledirectory(Multiple Entries PDF)
Usage
Give logged-in users five times the budget for Multiple Entries PDFs:
add_filter( 'gfpdf_gv_render_budget_logged_in_multiplier', function( $multiplier, $context ) {
return $context === 'directory' ? 5 : $multiplier;
}, 10, 2 );
Treat logged-in users the same as logged-out visitors:
add_filter( 'gfpdf_gv_render_budget_logged_in_multiplier', function( $multiplier, $context ) {
return 1;
}, 10, 2 );
Source Code
This filter is located in src/Pdf/Access/RenderBudget.php of the PDF for GravityView extension.