Skip to content

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

Open
anubisthejackle wants to merge 3 commits into
mainfrom
feature/empty/string
Open

Allow end user to define a label for the empty option in a select#802
anubisthejackle wants to merge 3 commits into
mainfrom
feature/empty/string

Conversation

@anubisthejackle

@anubisthejackle anubisthejackle commented Mar 20, 2021

Copy link
Copy Markdown
Contributor

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.

@renatonascalves renatonascalves left a comment

Copy link
Copy Markdown

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

dlh01 commented Mar 22, 2021

Copy link
Copy Markdown
Member

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
Copy Markdown
Contributor Author

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

Comment thread php/class-fieldmanager-select.php Outdated
Co-authored-by: Matthew Boynes <mboynes+git@alley.co>
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