Uh oh!
There was an error while loading. Please reload this page.
Add filter for non-repeatable fields - #430
Conversation
This also streamlines how the field type is checked. isset() is more efficient than in_array().
jtsternberg
commented
Aug 13, 2015
I'm not sure I understand the value of reversing this to use array keys? |
JPry
commented
Aug 13, 2015
Here's a StackOverflow answer that should explain it. |
jtsternberg
commented
Aug 13, 2015
I was familiar w/ the fact that isset is faster than in_array, but having a hard time believing the value gained from using array keys (for the number of items that would live in this array), is worth developer confusion w/ using this filter with array keys. |
JPry
commented
Aug 13, 2015
@jtsternberg It's true that any single instance of this method being called won't produce any significant performance increase, and it may add some confusion. However, this method is called every single time an instance of Taking into account multiple fields and multiple metaboxes, this very quickly increases by a significant factor. Thus, the performance improvement can add up and be worth the slight confusion developers may have. |
jtsternberg
commented
Aug 13, 2015
Color me convinced. Thank you for thinking this through. |
Add filter for non-repeatable fields
This also streamlines how the field type is checked. Using
isset()is more efficient thanin_array().