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

Ability to deactivate licence domains within MasterPress account management

25th October 2024

We have just rolled out an account management feature which allows licence holders to have better control over the domains that use their licence key. From the MasterPress Account Management page, the list of Active Sites that use your licence now includes a function that allows you to remove a domain from your licence. Simply… 

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