function __construct() { $this->set_settings(); parent::__construct($this->title, $this->slug, $this->settings); add_action('admin_init', array($this, 'disconnect')); add_action('admin_notices', array($this, 'connect_notice')); add_action('admin_notices', array($this, 'disconnect_notice')); }
function ninja_forms_upload_file_url($data) { nf_fu_load_externals(); $file_url = isset($data['file_url']) ? $data['file_url'] : ''; if (isset($data['upload_location']) && isset($data['upload_id']) && ninja_forms_upload_is_location_external($data['upload_location'])) { $external = NF_Upload_External::instance($data['upload_location']); if ($external && $external->is_connected()) { $file_url = admin_url('?nf-upload=' . $data['upload_id']); } } return $file_url; }
function nf_fu_load_externals() { // External location class loader require_once NINJA_FORMS_UPLOADS_DIR . '/includes/external/external.php'; $external_dir = glob(NINJA_FORMS_UPLOADS_DIR . '/includes/external/*.php'); if ($external_dir) { foreach ($external_dir as $dir) { if (basename($dir, '.php') == 'external') { continue; } $external = NF_Upload_External::instance($dir, true); } $external = NF_Upload_External::instance($dir, true); } }
function __construct() { $this->set_settings(); parent::__construct($this->title, $this->slug, $this->settings); }