WOOF_HTML :: options( Array $options, Array / String $vals, Array $options_attr )

Returns:

Generates the set of option tags for an HTML select.

Notes:

  • 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) ¬†

Example:

Parameters:

  • Array $options

    An array of keys and values to use. See the description and example for more details on the formats supported.

  • Array / String $vals

    An array of selected values or a single selected value.

  • Array $options_attr

    An array of attribute arrays to attach to each option item.

Latest From the Blog

MasterPress 1.2.8 is now available

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.

Plugin Requirements

MasterPress requires a minimum of WordPress version 4.9, MySQL 5.6, and PHP version 5.6.20.

We also recommend that PHP is configured to use a memory limit of 64MB per request (128MB may be required for sites with higher complexity).

This plug-in is not compatible with the WordPress.com hosted service.

Three AM