-
Notifications
You must be signed in to change notification settings - Fork 573
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
Add new function eligible_to_save #500
Conversation
Creats a check to see if a field should be saved based on the attributes set for it. Otherwise fields set to disabled and/or readonly will be written to.
Related to #346 |
I would advise against this change as disabled and/or readonly field attributes are often the initial state of a field, with the attribute(s) being removed via javascript if certain conditions apply. |
That being said, I could see using a field attribute, |
Perhaps adding a filter that is checked instead would be a reasonable option? It's been a bit since I worked on the project needing this and I had to change my process completely because there wasn't any way to correct this flaw. |
It has been so long I don't remember the specifics on the use case there, but those filters all happened much to late. It was related to a security issue where the original coder assumed that marking a field as read-only was really read-only and not just set in HTML. Adding an additional setting is a reasonable solution, if nobody else gets to it first I'll submit a PR for it. |
#500 For disabling the saving of a field. Useful if you want to display the value of another field, or use a disabled/read-only field. See example in example-functions.php
@jamesgol oops, I just pushed an update to include this, but please submit your PR and I will merge it in for the unit tests, etc, and will give you props. |
Creates a check to see if a field should be saved based on the attributes set for it. Otherwise fields set to disabled and/or readonly will be written to.
Setting a field to readonly just sets the HTML input form to readonly, it's trivial for someone to pass a different value in and change it.