ninja_forms_save_impexp_forms

The Ninja Forms ninja forms save impexp function.

Description

ninja_forms_save_impexp_forms( $data ); 

Parameters (1)

0. $data
The data.

Usage

  1. if ( !function_exists( 'ninja_forms_save_impexp_forms' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'ninja-forms/deprecated/includes/admin/pages/ninja-forms-impexp/tabs/impexp-forms/impexp-forms.php'; 
  3.  
  4. // The data. 
  5. $data = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = ninja_forms_save_impexp_forms($data); 
  9.  

Defined (1)

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

/deprecated/includes/admin/pages/ninja-forms-impexp/tabs/impexp-forms/impexp-forms.php  
  1. function ninja_forms_save_impexp_forms($data) { 
  2. global $wpdb, $ninja_forms_admin_update_message; 
  3. $plugin_settings = nf_get_settings(); 
  4. $form_id = isset( $_REQUEST['form_id'] ) ? absint( $_REQUEST['form_id'] ) : ''; 
  5. $update_msg = ''; 
  6. if( $_REQUEST['submit'] == __('Export Form', 'ninja-forms') OR ( isset( $_REQUEST['export_form'] ) AND absint( $_REQUEST['export_form'] ) == 1 ) ) { 
  7. if($form_id != '') { 
  8. ninja_forms_export_form( $form_id ); 
  9. }else{ 
  10. $ninja_forms_admin_update_message = __( 'Please select a form.', 'ninja-forms' ); 
  11. }elseif($_REQUEST['submit'] == __('Import Form', 'ninja-forms')) { 
  12. if ($_FILES['userfile'][error] == UPLOAD_ERR_OK AND is_uploaded_file($_FILES['userfile']['tmp_name'])) { 
  13. $file = file_get_contents($_FILES['userfile']['tmp_name']); 
  14. $update_msg = __( 'Form Imported Successfully.', 'ninja-forms' ); 
  15. }else{ 
  16. //echo $_FILES['userfile'][error]; 
  17. $update_msg = __( 'Please select a valid exported form file.', 'ninja-forms' ); 
  18. return $update_msg;