← All changes
|
Libs/adminify-framework/fields/backup/backup.php
+28
-23
4.2.13
→
3.2.4.1
View file →
| @@ -1,5 +1,6 @@ | ||
| 1 | -<?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly. | |
| 1 | +<?php if ( ! defined( 'ABSPATH' ) ) { | |
| 2 | + die; } // Cannot access directly. | |
| 2 | 3 | /** |
| 3 | 4 | * |
| 4 | 5 | * Field: backup |
| 5 | 6 | * |
| @@ -4,35 +5,39 @@ | ||
| 4 | 5 | * Field: backup |
| 5 | 6 | * |
| 6 | 7 | * @since 1.0.0 |
| 7 | 8 | * @version 1.0.0 |
| 8 | - * | |
| 9 | 9 | */ |
| 10 | 10 | if ( ! class_exists( 'ADMINIFY_Field_backup' ) ) { |
| 11 | - class ADMINIFY_Field_backup extends ADMINIFY_Fields { | |
| 11 | + class ADMINIFY_Field_backup extends ADMINIFY_Fields { | |
| 12 | 12 | |
| 13 | - public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) { | |
| 14 | - parent::__construct( $field, $value, $unique, $where, $parent ); | |
| 15 | - } | |
| 13 | + public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) { | |
| 14 | + parent::__construct( $field, $value, $unique, $where, $parent ); | |
| 15 | + } | |
| 16 | 16 | |
| 17 | - public function render() { | |
| 17 | + public function render() { | |
| 18 | + $unique = $this->unique; | |
| 19 | + $nonce = wp_create_nonce( 'adminify_backup_nonce' ); | |
| 20 | + $export = add_query_arg( | |
| 21 | + [ | |
| 22 | + 'action' => 'adminify-export', | |
| 23 | + 'unique' => $unique, | |
| 24 | + 'nonce' => $nonce, | |
| 25 | + ], | |
| 26 | + admin_url( 'admin-ajax.php' ) | |
| 27 | + ); | |
| 18 | 28 | |
| 19 | - $unique = $this->unique; | |
| 20 | - $nonce = wp_create_nonce( 'adminify_backup_nonce' ); | |
| 21 | - $export = add_query_arg( array( 'action' => 'adminify-export', 'unique' => $unique, 'nonce' => $nonce ), admin_url( 'admin-ajax.php' ) ); | |
| 29 | + echo wp_kses_post( $this->field_before() ); | |
| 22 | 30 | |
| 23 | - echo wp_kses_post( $this->field_before() ); | |
| 31 | + echo '<textarea name="adminify_import_data" class="adminify-import-data"></textarea>'; | |
| 32 | + echo '<button type="submit" class="button button-primary adminify-confirm adminify-import" data-unique="' . esc_attr( $unique ) . '" data-nonce="' . esc_attr( $nonce ) . '">' . esc_html__( 'Import', 'adminify' ) . '</button>'; | |
| 33 | + echo '<hr />'; | |
| 34 | + echo '<textarea readonly="readonly" class="adminify-export-data">' . esc_attr( json_encode( get_option( $unique ) ) ) . '</textarea>'; | |
| 35 | + echo '<a href="' . esc_url( $export ) . '" class="button button-primary adminify-export" target="_blank">' . esc_html__( 'Export & Download', 'adminify' ) . '</a>'; | |
| 36 | + echo '<hr />'; | |
| 37 | + echo '<button type="submit" name="adminify_transient[reset]" value="reset" class="button adminify-warning-primary adminify-confirm adminify-reset" data-unique="' . esc_attr( $unique ) . '" data-nonce="' . esc_attr( $nonce ) . '">' . esc_html__( 'Reset', 'adminify' ) . '</button>'; | |
| 24 | 38 | |
| 25 | - echo '<textarea name="adminify_import_data" class="adminify-import-data"></textarea>'; | |
| 26 | - echo '<button type="submit" class="button button-primary adminify-confirm adminify-import" data-unique="'. esc_attr( $unique ) .'" data-nonce="'. esc_attr( $nonce ) .'">'. esc_html__( 'Import', 'adminify' ) .'</button>'; | |
| 27 | - echo '<hr />'; | |
| 28 | - echo '<textarea readonly="readonly" class="adminify-export-data">'. esc_attr( wp_json_encode( get_option( $unique ) ) ) .'</textarea>'; | |
| 29 | - echo '<a href="'. esc_url( $export ) .'" class="button button-primary adminify-export" target="_blank">'. esc_html__( 'Export & Download', 'adminify' ) .'</a>'; | |
| 30 | - echo '<hr />'; | |
| 31 | - echo '<button type="submit" name="adminify_transient[reset]" value="reset" class="button adminify-warning-primary adminify-confirm adminify-reset" data-unique="'. esc_attr( $unique ) .'" data-nonce="'. esc_attr( $nonce ) .'">'. esc_html__( 'Reset', 'adminify' ) .'</button>'; | |
| 39 | + echo wp_kses_post( $this->field_after() ); | |
| 40 | + } | |
| 32 | 41 | |
| 33 | - echo wp_kses_post( $this->field_after() ); | |
| 34 | - | |
| 35 | - } | |
| 36 | - | |
| 37 | - } | |
| 42 | + } | |
| 38 | 43 | } |