Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
As alternative to multiple selects
- Loading branch information
Showing
1 changed file
with
36 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Nice start. I've always made this myself in plugins, so to have a core widget is ace.
I know that many other functions in this file have convoluted and awkward parameter lists, but I'd really like to move towards an API that's less cumbersome. Perhaps longer-term it'll become a class-based approach, but for now is there any chance this function's signature can be distilled a little?
Even (perhaps) employing associative arrays for similar options might be preferable, as they can be extended in future. Though they are more difficult to document. See this guy's checkbox or multicheck for examples. Notice the catch-all
$args
, which could be used in our case for$atts
and maybe$breakatts
if it's needed.As a rule of thumb, I'd say that any more than five args is getting unwieldy, especially when something like
id
is delegated to the last parameter.Side note: I think we've deprecated
breakclass
throughout (there were only a couple of tags that used it).