Fieldmanager_Colorpicker::__construct PHP Méthode

__construct() public méthode

Build the colorpicker object and enqueue assets.
public __construct ( string $label = '', array $options = [] )
$label string
$options array
    public function __construct($label = '', $options = array())
    {
        if (!self::$has_registered_statics) {
            add_action('admin_enqueue_scripts', function () {
                wp_enqueue_style('wp-color-picker');
            });
            fm_add_script('fm_colorpicker', 'js/fieldmanager-colorpicker.js', array('jquery', 'wp-color-picker'), '1.0', true);
            self::$has_registered_statics = true;
        }
        $this->sanitize = array($this, 'sanitize_hex_color');
        parent::__construct($label, $options);
    }