public function __construct() { // An array of all the custom fields we have. $this->field_types = array('typography', 'color_alpha', 'spacing', 'dimensions'); // An array of all our extensions $this->extensions = array('search', 'repeater', 'accordion', 'vendorsupport'); $this->path = dirname(__FILE__); foreach ($this->field_types as $field_type) { add_action('avadaredux/' . Avada::get_option_name() . '/field/class/' . $field_type, array($this, 'register_' . $field_type)); } foreach ($this->extensions as $extension) { if (class_exists('AvadaRedux')) { AvadaRedux::setExtensions(Avada::get_option_name(), $this->path . '/extensions/' . $extension . '/extension_' . $extension . '.php'); } } }
public static function getInstanceExtensions($opt_name, $instance = array()) { if (!empty(self::$uses_extensions[$opt_name])) { return; } if (empty($instance)) { $instance = AvadaReduxFrameworkInstances::get_instance($opt_name); } if (empty($instance) || empty($instance->extensions)) { return; } foreach ($instance->extensions as $name => $extension) { if ($name == "widget_areas") { $new = new AvadaRedux_Widget_Areas($instance); } if (isset(self::$uses_extensions[$opt_name][$name])) { continue; } if (isset($extension->extension_dir)) { AvadaRedux::setExtensions($opt_name, str_replace($name, '', $extension->extension_dir)); } else { if (isset($extension->_extension_dir)) { AvadaRedux::setExtensions($opt_name, str_replace($name, '', $extension->_extension_dir)); } } } }