Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty value filter for checkbox field with no selected option #208

Merged
merged 3 commits into from
Dec 18, 2024

Conversation

doekenorg
Copy link
Collaborator

@doekenorg doekenorg commented Dec 16, 2024

In response to https://wordpress.org/support/topic/how-to-handle-empty-dropdown-fields-in-the-export-using-hooks/#post-18198528 i've added a gfexcel_field_checkbox_empty filter. This receives the default value of '', the entry and the field object. It can also be hooked into as gfexcel_field_checkbox_empty_<form_id> or gfexcel_field_checkbox_empty_<formid>_<fieldid>.

It also removes any Type Errors that PHP throws when retrieving the value from the original field. Some fields internal fields, as well as custom fields, have these errors on higher PHP versions. This will silently fail, and log the error.

💾 Build file (135d542).

@doekenorg doekenorg merged commit 8e5aef3 into develop Dec 18, 2024
4 checks passed
@doekenorg doekenorg deleted the feature/empty-choice-hook branch December 18, 2024 08:15
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.

1 participant