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

Allow end user to define a label for the empty option in a select #802

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

anubisthejackle
Copy link
Contributor

@anubisthejackle anubisthejackle commented Mar 20, 2021

Exactly as it says. This PR adds a parameter "first_empty_label" that allows changing of the displayed name for empty options. The value of this option remains empty.

Copy link

@renatonascalves renatonascalves left a comment

Choose a reason for hiding this comment

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

🗡️

@dlh01 dlh01 added this to the 1.5.0 milestone Mar 22, 2021
@dlh01
Copy link
Member

dlh01 commented Mar 22, 2021

This seems useful to me. A unit test for this behavior would be helpful alongside the other first_empty-related tests: https://github.com/alleyinteractive/wordpress-fieldmanager/blob/1994637fbe962b94c943d0dab591ab75609f605e/tests/php/test-fieldmanager-select-field.php. I would also offer that it might be beneficial for the property to be [something]_label, like first_empty_label, for greater consistency with other field properties like add_more_label and button_label.

@anubisthejackle
Copy link
Contributor Author

@dlh01 You're right. I've updated the label name and added a test for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants