Carbon_Fields\Field\Predefined_Options_Field::set_options PHP Method

set_options() public method

Accepts either array of data or a callback that returns the data.
public set_options ( array | callable $options )
$options array | callable
    public function set_options($options)
    {
        $this->options = array();
        if (is_callable($options)) {
            $this->options = $options;
        } elseif (is_array($options)) {
            $this->add_options($options);
        } else {
            $this->options = array();
            Incorrect_Syntax_Exception::raise('Only arrays and callbacks are allowed in the <code>set_options()</code> method.');
        }
        return $this;
    }