-
-
Notifications
You must be signed in to change notification settings - Fork 816
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 is_numerical
check - See #6995
#7010
Conversation
src/Config.php
Outdated
@@ -356,6 +356,9 @@ protected function parseTaxonomy() | |||
if (!empty($taxonomy['options']) && is_array($taxonomy['options'])) { | |||
$options = []; | |||
foreach ($taxonomy['options'] as $optionKey => $optionValue) { | |||
if (is_numeric($optionKey)) { | |||
$optionKey = $optionValue; | |||
} |
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.
Oh wait, that will need to go below the line, um, below this … as the value should be slugged.
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.
New tests say you were right 😉
In the table, you save a slug and a value. The value should not be slugified, right? |
Yeah, I was getting lost in the sea of logic in that method … hence the tests 😉 |
Add `is_numerical` check for taxonomy options
See #6995 .
The numerical check is still required because you can define taxonomies as:
and
The code before this pull, would actually save it as: