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.3.10 is now available

9th November 2023

MasterPress 1.3.10 is a feature and bugfix release. Workaround for fatal error introduced by changes to WordPress’ wpdb class in WordPress 6.4. Added actions to MPC files upload_field & WF image save_image functions.

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