PluginProbe
Cool Timeline (Horizontal & Vertical Timeline) / trunk
Cool Timeline (Horizontal & Vertical Timeline) vtrunk
3.4.0 3.3.6 3.3.5 3.3.4 3.3.3 3.3.2 2.2.3 2.3.3 2.4 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 2.6.1 2.7.1 2.8.3 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7 2.9.8 2.9.9 3.0.0 All 79 releases
cool-timeline / admin / codestar-framework / fields / backup / backup.php

backup.php in Cool Timeline (Horizontal & Vertical Timeline) trunk, at admin/codestar-framework/fields/backup/backup.php

54 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php if ( ! defined( 'ABSPATH' ) ) {
2 die;
3 } // Cannot access directly.
4 // phpcs:ignoreFile WordPress.Security.EscapeOutput.OutputNotEscaped
5 /**
6 *
7 * Field: backup
8 *
9 * @since 1.0.0
10 * @version 1.0.0
11 */
12 if ( ! class_exists( 'CSF_Field_backup' ) ) {
13 class CSF_Field_backup extends CSF_Fields {
14
15
16 public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
17
18 parent::__construct( $field, $value, $unique, $where, $parent );
19 }
20
21 public function render() {
22
23 $unique = $this->unique;
24 $nonce = wp_create_nonce( 'csf_backup_nonce' );
25 $export = add_query_arg(
26 array(
27 'action' => 'csf-export',
28 'unique' => $unique,
29 'nonce' => $nonce,
30 ),
31 admin_url( 'admin-ajax.php' )
32 );
33
34 echo $this->field_before();
35
36 echo '<textarea name="csf_import_data" class="csf-import-data"></textarea>';
37 // phpcs:ignore WordPress.WP.I18n.TextDomainMismatch
38 echo '<button type="submit" class="button button-primary csf-confirm csf-import" data-unique="' . esc_attr( $unique ) . '" data-nonce="' . esc_attr( $nonce ) . '">' . esc_html__( 'Import', 'csf' ) . '</button>';
39 echo '<hr />';
40 echo '<textarea readonly="readonly" class="csf-export-data">' . esc_attr( json_encode( get_option( $unique ) ) ) . '</textarea>';
41 // phpcs:ignore WordPress.WP.I18n.TextDomainMismatch
42 echo '<a href="' . esc_url( $export ) . '" class="button button-primary csf-export" target="_blank">' . esc_html__( 'Export & Download', 'csf' ) . '</a>';
43 echo '<hr />';
44 // phpcs:ignore WordPress.WP.I18n.TextDomainMismatch
45 echo '<button type="submit" name="csf_transient[reset]" value="reset" class="button csf-warning-primary csf-confirm csf-reset" data-unique="' . esc_attr( $unique ) . '" data-nonce="' . esc_attr( $nonce ) . '">' . esc_html__( 'Reset', 'csf' ) . '</button>';
46
47 echo $this->field_after();
48
49 }
50
51 }
52 }
53
54