/** * Registered callback function for the WordPress Importer * * Manages the three separate stages of the WXR import process */ function dispatch() { $cherry_widget_data = new myWidget_Data(); $step = empty($_GET['step']) ? 1 : (int) $_GET['step']; switch ($step) { case 1: $this->header($step); $this->greet(); $this->footer(); break; case 2: $this->header($step); check_admin_referer('import-upload'); if ($this->handle_upload()) { $this->import_options(); } $this->footer(); break; case 3: // check_admin_referer( 'import-wordpress' ); $this->fetch_attachments = !empty($_POST['fetch_attachments']) && $this->allow_fetch_attachments(); if (array_key_exists('import_id', $_POST)) { $this->id = (int) $_POST['import_id']; $file = get_attached_file($this->id); set_time_limit(0); $this->import($file); $this->settings(); } // call widget settings import $cherry_widget_data->import_settings_page(); break; case 4: // call widget settings import $cherry_widget_data->import_settings_page(); break; default: break; } }
/** * admin_screen_logic() * * The processing code to generate the backup or restore from a previous backup. * * @since 1.0.0 */ function admin_screen_logic () { if ( ! isset( $_POST['OptionsFramework-backup-export'] ) && isset( $_POST['OptionsFramework-backup-import'] ) && ( $_POST['OptionsFramework-backup-import'] == true ) ) { $this->import(); } if ( ! isset( $_POST['OptionsFramework-backup-import'] ) && isset( $_POST['OptionsFramework-backup-export'] ) && ( $_POST['OptionsFramework-backup-export'] == true ) ) { $this->export(); } if ( isset ( $_POST['Widget-Settings-export'] ) && ( $_POST['Widget-Settings-export'] == true ) ) { $myWidget_Data = new myWidget_Data(); $myWidget_Data->export_widget_settings(); } } // End admin_screen_logic()