-
Notifications
You must be signed in to change notification settings - Fork 24
Refactor: Prevent some undefined
array key warnings.
#104
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
Refactor: Prevent some undefined
array key warnings.
#104
Conversation
continue; | ||
} | ||
// bail early if choice already exists | ||
if ( in_array( $esc_value, $this->_values, true ) ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was this intentionally changed to a strict comparison?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, otherwise phpcs was complaining about it. It should not be risky. As both values come from esc_attr
functions, which should return a string.
I wonder if it might be best to have a helper function for all these |
I found indeed an |
What
While working on SCF. I have been receiving several warnings that made field creation difficult. Something like this:
Test