Skip to content

feat: add button to appearance tab to toggle exclude custom css class - #38

Merged
Yannicvanveen merged 3 commits into
mainfrom
feat/exclude-from-pdf-button
Sep 22, 2026
Merged

Yannicvanveen merged 3 commits into
mainfrom
feat/exclude-from-pdf-button

Conversation

@Yannicvanveen

Copy link
Copy Markdown
Contributor

Voegt een button toe waarmee de exclude class die Gravity PDF gebruikt om velden uit te sluiten aan- en uitgezet kan worden. State wordt ook bijgewerkt bij handmatige wijzigingen aan het veld.

Screenshot 2026-09-16 at 10 01 39 Screenshot 2026-09-16 at 10 01 45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The toggle can report or preserve an incorrect exclusion state for valid custom CSS values.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds a Gravity PDF exclusion toggle to Gravity Forms’ Appearance tab.

Changes:

  • Adds an accessible exclusion toggle synchronized with custom CSS.
  • Shows the toggle only for forms with active PDF configurations.
  • Supports multiple PDF configurations when checking activity.
File summaries
File Description
src/Views/partials/gf-field-zgw-pdf-exclude-script.php Implements toggle behavior and state synchronization.
src/Views/partials/gf-field-zgw-pdf-exclude-option.php Renders the toggle and status text.
src/Providers/GravityFormsServiceProvider.php Registers editor hooks.
src/GravityForms/FormSettingsPDF.php Adds the active-PDF helper.
src/GravityForms/FieldSettings.php Conditionally renders the setting and script.
Review details

Suppressed comments (1)

src/Views/partials/gf-field-zgw-pdf-exclude-script.php:64

  • This removes only the first matching token. If the CSS field was manually given duplicate exclude classes, clicking “include” leaves another token behind, so the field remains excluded and the control stays pressed. Remove every exact match in the off branch.
				classes.splice(index, 1);
  • Files reviewed: 5/5 changed files
  • Comments generated: 1
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/Views/partials/gf-field-zgw-pdf-exclude-script.php Outdated

@mvdhoek1 mvdhoek1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Akkoord onder voorbehoud comments.

Comment thread src/GravityForms/FieldSettings.php
Comment thread src/GravityForms/FieldSettings.php
Comment thread src/GravityForms/FormSettingsPDF.php Outdated
Comment thread src/GravityForms/FormSettingsPDF.php
Comment thread src/Views/partials/gf-field-zgw-pdf-exclude-option.php
@Yannicvanveen
Yannicvanveen merged commit 94ee8d5 into main Sep 22, 2026
2 checks passed
@Yannicvanveen
Yannicvanveen deleted the feat/exclude-from-pdf-button branch September 22, 2026 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants