PHP Class Fieldmanager_Colorpicker, vip-mu-plugins-public

Provides an interface to navigate colors and submits the 6-character hex code e.g. #ffffff. This field uses the {@link https://make.wordpress.org/core/2012/11/30/new-color-picker-in-wp-3-5/ WordPress core color picker introduced in WordPress 3.5}.
Inheritance: extends Fieldmanager_Field
Afficher le fichier Open project: Automattic/vip-mu-plugins-public Class Usage Examples

Méthodes publiques

Свойство Type Description
$field_class string Override field_class.
$has_registered_statics boolean Static variable so we only load static assets once.

Méthodes publiques

Méthode Description
__construct ( string $label = '', array $options = [] ) Build the colorpicker object and enqueue assets.
form_element ( mixed $value = '' ) : string Form element.
sanitize_hex_color ( string $color ) : string Sanitizes a hex color.

Method Details

__construct() public méthode

Build the colorpicker object and enqueue assets.
public __construct ( string $label = '', array $options = [] )
$label string
$options array

form_element() public méthode

Form element.
public form_element ( mixed $value = '' ) : string
$value mixed
Résultat string HTML

sanitize_hex_color() public méthode

Returns either '', a 3 or 6 digit hex color (with #), or nothing. This was copied from core; sanitize_hex_color() is not available outside of the customizer. {@see https://core.trac.wordpress.org/ticket/27583}.
public sanitize_hex_color ( string $color ) : string
$color string
Résultat string

Property Details

$field_class public_oe property

Override field_class.
public string $field_class
Résultat string

$has_registered_statics public_oe static_oe property

Static variable so we only load static assets once.
public static bool $has_registered_statics
Résultat boolean