Shortcode_Button::get_cmb_config PHP Method

get_cmb_config() public method

Get the cmb config array from button args
Since: 0.1.0
public get_cmb_config ( ) : mixed
return mixed CMB2 form args (or false)
    public function get_cmb_config()
    {
        if (isset($this->cmbmc)) {
            return $this->cmbmc;
        }
        $this->cmbmc = false;
        if (!empty($this->args['cmb_metabox_config'])) {
            // Config can be passed as an array or a callback (which returns the array).
            $this->cmbmc = is_callable($this->args['cmb_metabox_config']) ? call_user_func($this->args['cmb_metabox_config'], $this->button_data, $this->args) : (array) $this->args['cmb_metabox_config'];
        }
        if ($this->button_data['mceView'] && $this->button_data['include_close'] && is_array($this->cmbmc['fields'])) {
            $this->cmbmc['fields'][] = array('name' => $this->button_data['l10nsccontents'], 'desc' => $this->button_data['l10nsccontents_desc'], 'id' => 'sccontent', 'type' => 'wysiwyg', 'options' => array('textarea_rows' => 5, 'teeny' => true));
        }
        self::$buttons_data[$this->index]['cmb'] = array('id' => $this->cmbmc['id'], 'fields' => $this->cmbmc['fields']);
        return $this->cmbmc;
    }