It was brought to our attention that MasterPress would give a tonne of warnings and deprecation notices when used with PHP 7.4 – this update addresses those.
WOOF_HTML :: options( Array $options, Array / String $vals, Array $options_attr )
Generates the set of option tags for an HTML select.
- This method supports some more advanced options setups, which are used heavily by some of the MasterPress field types. This method can get a little complex, and this method should only really be used when you need to generate an HTML string to return to another piece of code, as MasterPress frequently needs to do. If you’re just outputting HTML, it would be more concise to echo the dynamic parts within standard HTML code.
- If a value in the $options array is an array itself, it is assumed then an optgroup will be generated using the key of that value as the label.
- The 3rd parameter is used to attach attributes to each option.
- If attributes are needed in a option group value, you can split the value of each of the values in the option group into an associative array of options and option attributes (see example)