# easy-hotel/trunk/admin/includes/framework/fields/backup/backup.php

Easy Hotel – Powerful Hotel Booking, version trunk. 39 lines.

- Page: https://pluginprobe.com/plugins/easy-hotel/trunk/code/admin/includes/framework/fields/backup/backup.php
- Raw: https://pluginprobe.com/plugins/easy-hotel/trunk/raw/admin/includes/framework/fields/backup/backup.php
- Modified: 2026-07-15T12:14:36+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/easy-hotel/trunk/code/admin/includes/framework/fields/backup/backup.php#L10-L20`.

```php
<?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
/**
 *
 * Field: backup
 *
 * @since 1.0.0
 * @version 1.0.0
 *
 */
if ( ! class_exists( 'ESHB_Field_backup' ) ) {
  class ESHB_Field_backup extends ESHB_Fields {

    public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
      parent::__construct( $field, $value, $unique, $where, $parent );
    }

    public function render() {

      $unique = $this->unique;
      $nonce  = wp_create_nonce( 'eshb_backup_nonce' );
      $export = add_query_arg( array( 'action' => 'eshb-export', 'unique' => $unique, 'nonce' => $nonce ), admin_url( 'admin-ajax.php' ) );

      echo wp_kses_post($this->field_before());

      echo '<textarea name="eshb_import_data" class="eshb-import-data"></textarea>';
      echo '<button type="submit" class="button button-primary csf-confirm eshb-import" data-unique="'. esc_attr( $unique ) .'" data-nonce="'. esc_attr( $nonce ) .'">'. esc_html__( 'Import', 'easy-hotel' ) .'</button>';
      echo '<hr />';
      echo '<textarea readonly="readonly" class="eshb-export-data">'. esc_attr( wp_json_encode( get_option( $unique ) ) ) .'</textarea>';
      echo '<a href="'. esc_url( $export ) .'" class="button button-primary eshb-export" target="_blank">'. esc_html__( 'Export & Download', 'easy-hotel' ) .'</a>';
      echo '<hr />';
      echo '<button type="submit" name="eshb_transient[reset]" value="reset" class="button csf-warning-primary csf-confirm eshb-reset" data-unique="'. esc_attr( $unique ) .'" data-nonce="'. esc_attr( $nonce ) .'">'. esc_html__( 'Reset', 'easy-hotel' ) .'</button>';

      echo wp_kses_post($this->field_after());

    }

  }
}

```
