wp/wp-admin/export-personal-data.php
changeset 16 a86126ab1dd4
child 18 be944660c56a
equal deleted inserted replaced
15:3d4e9c994f10 16:a86126ab1dd4
       
     1 <?php
       
     2 /**
       
     3  * Privacy tools, Export Personal Data screen.
       
     4  *
       
     5  * @package WordPress
       
     6  * @subpackage Administration
       
     7  */
       
     8 
       
     9 /** WordPress Administration Bootstrap */
       
    10 require_once __DIR__ . '/admin.php';
       
    11 
       
    12 if ( ! current_user_can( 'export_others_personal_data' ) ) {
       
    13 	wp_die( __( 'Sorry, you are not allowed to export personal data on this site.' ) );
       
    14 }
       
    15 
       
    16 // Handle list table actions.
       
    17 _wp_personal_data_handle_actions();
       
    18 
       
    19 // Cleans up failed and expired requests before displaying the list table.
       
    20 _wp_personal_data_cleanup_requests();
       
    21 
       
    22 wp_enqueue_script( 'privacy-tools' );
       
    23 
       
    24 add_screen_option(
       
    25 	'per_page',
       
    26 	array(
       
    27 		'default' => 20,
       
    28 		'option'  => 'export_personal_data_requests_per_page',
       
    29 	)
       
    30 );
       
    31 
       
    32 $_list_table_args = array(
       
    33 	'plural'   => 'privacy_requests',
       
    34 	'singular' => 'privacy_request',
       
    35 );
       
    36 
       
    37 $requests_table = _get_list_table( 'WP_Privacy_Data_Export_Requests_List_Table', $_list_table_args );
       
    38 
       
    39 $requests_table->screen->set_screen_reader_content(
       
    40 	array(
       
    41 		'heading_views'      => __( 'Filter export personal data list' ),
       
    42 		'heading_pagination' => __( 'Export personal data list navigation' ),
       
    43 		'heading_list'       => __( 'Export personal data list' ),
       
    44 	)
       
    45 );
       
    46 
       
    47 $requests_table->process_bulk_action();
       
    48 $requests_table->prepare_items();
       
    49 
       
    50 require_once ABSPATH . 'wp-admin/admin-header.php';
       
    51 ?>
       
    52 
       
    53 <div class="wrap nosubsub">
       
    54 	<h1><?php esc_html_e( 'Export Personal Data' ); ?></h1>
       
    55 	<hr class="wp-header-end" />
       
    56 
       
    57 	<?php settings_errors(); ?>
       
    58 
       
    59 	<form action="<?php echo esc_url( admin_url( 'export-personal-data.php' ) ); ?>" method="post" class="wp-privacy-request-form">
       
    60 		<h2><?php esc_html_e( 'Add Data Export Request' ); ?></h2>
       
    61 		<p><?php esc_html_e( 'An email will be sent to the user at this email address asking them to verify the request.' ); ?></p>
       
    62 
       
    63 		<div class="wp-privacy-request-form-field">
       
    64 			<label for="username_or_email_for_privacy_request"><?php esc_html_e( 'Username or email address' ); ?></label>
       
    65 			<input type="text" required class="regular-text ltr" id="username_or_email_for_privacy_request" name="username_or_email_for_privacy_request" />
       
    66 			<?php submit_button( __( 'Send Request' ), 'secondary', 'submit', false ); ?>
       
    67 		</div>
       
    68 		<?php wp_nonce_field( 'personal-data-request' ); ?>
       
    69 		<input type="hidden" name="action" value="add_export_personal_data_request" />
       
    70 		<input type="hidden" name="type_of_action" value="export_personal_data" />
       
    71 	</form>
       
    72 	<hr />
       
    73 
       
    74 	<?php $requests_table->views(); ?>
       
    75 
       
    76 	<form class="search-form wp-clearfix">
       
    77 		<?php $requests_table->search_box( __( 'Search Requests' ), 'requests' ); ?>
       
    78 		<input type="hidden" name="filter-status" value="<?php echo isset( $_REQUEST['filter-status'] ) ? esc_attr( sanitize_text_field( $_REQUEST['filter-status'] ) ) : ''; ?>" />
       
    79 		<input type="hidden" name="orderby" value="<?php echo isset( $_REQUEST['orderby'] ) ? esc_attr( sanitize_text_field( $_REQUEST['orderby'] ) ) : ''; ?>" />
       
    80 		<input type="hidden" name="order" value="<?php echo isset( $_REQUEST['order'] ) ? esc_attr( sanitize_text_field( $_REQUEST['order'] ) ) : ''; ?>" />
       
    81 	</form>
       
    82 
       
    83 	<form method="post">
       
    84 		<?php
       
    85 		$requests_table->display();
       
    86 		$requests_table->embed_scripts();
       
    87 		?>
       
    88 	</form>
       
    89 </div>
       
    90 
       
    91 <?php
       
    92 require_once ABSPATH . 'wp-admin/admin-footer.php';