/** * Class Constructor * * @since 1.0 * @access public * @return void */ public function __construct($parent) { $this->parent = $parent; if (!is_admin()) { return; } //Hides importer section if anything but true returned. Way to abort :) if (true !== apply_filters('wbc_importer_abort', true)) { return; } if (empty($this->extension_dir)) { $this->extension_dir = trailingslashit(str_replace('\\', '/', dirname(__FILE__))); $this->extension_url = site_url(str_replace(trailingslashit(str_replace('\\', '/', ABSPATH)), '', $this->extension_dir)); $this->demo_data_dir = apply_filters("wbc_importer_dir_path", $this->extension_dir . 'demo-data/'); } //Delete saved options of imported demos, for dev/testing purpose // delete_option('wbc_imported_demos'); $this->getImports(); $this->field_name = 'wbc_importer'; self::$instance = $this; add_filter('redux/' . $this->parent->args['opt_name'] . '/field/class/' . $this->field_name, array(&$this, 'overload_field_path')); add_action('wp_ajax_redux_wbc_importer', array($this, 'ajax_importer')); add_filter('redux/' . $this->parent->args['opt_name'] . '/field/wbc_importer_files', array($this, 'addImportFiles')); //Adds Importer section to panel $this->add_importer_section(); }