PHP Класс 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}.
Наследование: extends Fieldmanager_Field
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$field_class string Override field_class.
$has_registered_statics boolean Static variable so we only load static assets once.

Открытые методы

Метод Описание
__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.

Описание методов

__construct() публичный Метод

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

form_element() публичный Метод

Form element.
public form_element ( mixed $value = '' ) : string
$value mixed
Результат string HTML

sanitize_hex_color() публичный Метод

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
Результат string

Описание свойств

$field_class публичное свойство

Override field_class.
public string $field_class
Результат string

$has_registered_statics публичное статическое свойство

Static variable so we only load static assets once.
public static bool $has_registered_statics
Результат boolean