onetone_options_backup

// onetone options backup.

Description

onetone_options_backup(); 

Usage

  1. if ( !function_exists( 'onetone_options_backup' ) ) { 
  2. require_once '/includes/theme-functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = onetone_options_backup(); 
  7.  

Defined (1)

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

/includes/theme-functions.php  
  1. function onetone_options_backup() { 
  2.  
  3. $options = array(); 
  4. $keys = array(); 
  5. $option_name = optionsframework_option_name(); 
  6. $key = time(); 
  7. $keys = get_option('onetone_options_backup'); 
  8. $keys[] = $key; 
  9. update_option('onetone_options_backup', $keys, '', 'no'); 
  10.  
  11. $options = get_option( $option_name ); 
  12. add_option( 'onetone_options_backup_'.$key, $options, '', 'no' ); 
  13.  
  14. $list_item = '<tr id="tr-'.$key.'"> 
  15. <td style="padding-left:20px;"> '.__('Backup', 'onetone').' '.date('Y-m-d H:i:s', $key).'</td> 
  16. <td><a class="button" id="onetone-restore-btn" data-key="'.$key.'" href="#"><i class="fa fa-refresh"></i> '.__('Restore', 'onetone').'</a></td> 
  17. <td><a class="button" id="onetone-delete-btn" data-key="'.$key.'" href="#"><i class="fa fa-remove"></i> '.__('Delete', 'onetone').'</a></td> 
  18. </tr>'; 
  19. echo $list_item;