protected function getOptions(array $data = null) { $options = $this->newOptionsGroupInstance(); $this->onSetupOptions($options); \Drone\do_action('shortcode_' . $this->tag . '_on_setup_options', $options, $this); if ($data !== null) { $options->fromArray($data, array($this, 'onOptionsCompatybility')); if (has_filter('shortcode_atts_' . $this->tag)) { $options->fromArray(apply_filters('shortcode_atts_' . $this->tag, $options->toArray(), $options->getDefaults(), $data)); } } return $options; }
protected function getOptions(array $data = null) { $options = new Options\Group\Widget(str_replace('[#]', '', $this->get_field_name('#'))); $this->onSetupOptions($options); \Drone\do_action('widget_' . str_replace('-', '_', $this->_id) . '_on_setup_options', $options, $this); if (isset(self::$_on_setup_options[$this->_id]) && is_callable(self::$_on_setup_options[$this->_id])) { _deprecated_function(__METHOD__ . '::$_on_setup_options', '5.0', 'drone_widget_' . str_replace('-', '_', $this->_id) . '_on_setup_options action'); call_user_func_array(self::$_on_setup_options[$this->_id], array($this, $options)); } if ($data !== null) { $options->fromArray($data, array($this, 'onOptionsCompatybility')); } return $options; }