PHP Class WPDKHTMLTagSelect

Remeber to add this tag in WPDKHTMLTagName
Author: =undo= ([email protected])
Inheritance: extends WPDKHTMLTag
Afficher le fichier Open project: wpxtreme/wpdk Class Usage Examples

Méthodes publiques

Свойство Type Description
$_first_item string Used to display a special first item (disable and display none and non selectable) to use instead label
$autofocus * Interface.
$disabled
$form
$multiple
$name
$size
$value

Méthodes publiques

Méthode Description
__construct ( array | callback $options = [], string $name = '', string $id = '' ) Create an instance of WPDKHTMLTagSelect class
draw ( ) Override parent method for draw the options with selectd values.
options ( array $options ) : string Return the HTML markup for the option and optgroup tag.
selected ( string | array $haystack, mixed $current ) : string Return HTML selected attribute or empty string.

Private Methods

Méthode Description
_options ( array $options ) Recursive method to build the options and option group for select tag.

Method Details

__construct() public méthode

Create an instance of WPDKHTMLTagSelect class
public __construct ( array | callback $options = [], string $name = '', string $id = '' )
$options array | callback A key value pairs array with value/text or a callback function
$name string Attribute name
$id string Attribute id

draw() public méthode

Override parent method for draw the options with selectd values.
public draw ( )

options() public méthode

Return the HTML markup for the option and optgroup tag.
public options ( array $options ) : string
$options array A key value pairs array. If the value is an array then an optio group is created.
Résultat string

selected() public static méthode

Commodity to extends selected() WordPress function with array check.
Since: 1.2.0
public static selected ( string | array $haystack, mixed $current ) : string
$haystack string | array Single value or array
$current mixed (true) The other value to compare if not just true
Résultat string HTML attribute or empty string

Property Details

$_first_item public_oe property

Used to display a special first item (disable and display none and non selectable) to use instead label
Since: 1.4.8
public string $_first_item
Résultat string

$autofocus public_oe property

* Interface.
public $autofocus

$disabled public_oe property

public $disabled

$form public_oe property

public $form

$multiple public_oe property

public $multiple

$name public_oe property

public $name

$size public_oe property

public $size

$value public_oe property

public $value