GravityPDF / gravity-pdf

Gravity PDF is a GPLv2-licensed WordPress plugin that allows you to automatically generate, email and download PDF documents using Gravity Forms.
https://gravitypdf.com
88 stars 21 forks source link

Add context to gfpdf_core_template hook #1410

Closed jakejackson1 closed 1 year ago

jakejackson1 commented 1 year ago

Description

Pass the $form, $entry, and $settings variables to the gfpdf_core_template hook so developers can conditionally display styles in any Core / Universal PDF template.

Also include form-specific hook gfpdf_core_template_$formId

Testing instructions

Implement https://docs.gravitypdf.com/v6/developers/actions/gfpdf_core_template but accept 3 arguments to the function, then conditionally display styles in the PDF. Verify the styles appear in the generated HTML.

Do the same for gfpdf_core_template_$formId

Screenshots

Checklist:

Additional Comments

codecov[bot] commented 1 year ago

Codecov Report

Merging #1410 (8dfcb9c) into development (4a4155b) will increase coverage by 0.00%. The diff coverage is 100.00%.

@@              Coverage Diff               @@
##             development    #1410   +/-   ##
==============================================
  Coverage          78.29%   78.30%           
  Complexity          2901     2901           
==============================================
  Files                243      243           
  Lines              10119    10120    +1     
  Branches             370      370           
==============================================
+ Hits                7923     7924    +1     
  Misses              2188     2188           
  Partials               8        8           
Impacted Files Coverage Δ
src/View/html/PDF/core_template_styles.php 98.03% <100.00%> (+0.03%) :arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.