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

Settings Saving Consistencies #6898

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Settings Saving Consistencies #6898

wants to merge 2 commits into from

Conversation

spencerfinnell
Copy link
Contributor

Fixes #6891

Proposed Changes:

  1. When outputting the value of fields registered with the settings API avoid unneeded logic for determining the default value and instead use the $default argument in edd_get_option( $key, $default );
  2. When looking for a setting in edd_get_option() check if the key is set at all, and use that value if it is. Otherwise use the default. Previously checking for empty() would fail on things like blank strings or 0 strings.
  3. Allow empty setting values to be saved in settings.
  4. Respect allow_blank being set to false. No longer save a blank value and incorrect display the option value on the frontend. Blank options for text and rich editor fields are sanitized on input instead of output.

- When outputting the value of fields registered with the settings API avoid unneeded logic for determining the default value and instead use the $default argument in edd_get_option( $key, $default );
- When looking for a setting in edd_get_option() check if the key is set at all, and use that value if it is. Otherwise use the default. Previously checking for empty() would fail on things like blank strings for 0 strings.
- Allow empty setting values to be saved in settings. There is an option for allow_blank that is not used in any setting registrations and I am not sure of the original intention.
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