monsterinsights_process_export_settings

MonsterInsights settings export.

Description

monsterinsights_process_export_settings(); 

Usage

  1. if ( !function_exists( 'monsterinsights_process_export_settings' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'google-analytics-for-wordpress-by-monsterinsights/includes/admin/pages/tools.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = monsterinsights_process_export_settings(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/includes/admin/pages/tools.php  
  1. function monsterinsights_process_export_settings() { 
  2. if ( !isset( $_POST['monsterinsights_action'] ) || empty( $_POST['monsterinsights_action'] ) ) { 
  3. return; 
  4.  
  5. if ( ! current_user_can( 'monsterinsights_save_settings' ) ) { 
  6. return; 
  7.  
  8. if ( $_POST['monsterinsights_action'] !== 'monsterinsights_export_settings' ) { 
  9. return; 
  10.  
  11. if ( empty( $_POST['monsterinsights_export_settings'] ) || ! wp_verify_nonce( $_POST['monsterinsights_export_settings'], 'monsterinsights_export_settings' ) ) { 
  12. return; 
  13.  
  14. ignore_user_abort( true ); 
  15.  
  16. nocache_headers(); 
  17. header( 'Content-Type: application/json; charset=utf-8' ); 
  18. header( 'Content-Disposition: attachment; filename=monsterinsights-settings-export-' . date( 'm-d-Y' ) . '.json' ); 
  19. header( "Expires: 0" ); 
  20.  
  21. echo $settings; 
  22. exit;