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

[5.x] Add filter_empty modifier #10961

Closed

Conversation

godismyjudge95
Copy link
Contributor

Ran into this issue a few times and noticed a few references #7678 statamic/ideas#1222

There are sometimes you have data that may contain empty strings, null values, or empty arrays. In these cases it would be nice to be able to filter out these empty values similar to the collect()->filter() method.

This PR implements a filter_empty modifier. I was specific in how I named it so that people hopefully won't confuse it with the collect()->filter() method as that method allows you to pass a custom callback to perform extra filtering which this modifier does not support.

Let me know what you think.

@jasonvarga
Copy link
Member

jasonvarga commented Oct 15, 2024

Going with #10962, but calling it filter_empty. Thanks!

@jasonvarga jasonvarga closed this Oct 15, 2024
@godismyjudge95 godismyjudge95 deleted the add-filter-empty-modifier branch October 15, 2024 20:50
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.

2 participants