ninja_forms_replyto_change

The Ninja Forms ninja forms replyto change function.

Description

ninja_forms_replyto_change(); 

Usage

  1. if ( !function_exists( 'ninja_forms_replyto_change' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'ninja-forms/deprecated/includes/reply-to-check.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = ninja_forms_replyto_change(); 
  7.  

Defined (1)

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

/deprecated/includes/reply-to-check.php  
  1. function ninja_forms_replyto_change() { 
  2.  
  3. $plugin_settings = nf_get_settings(); 
  4. if ( !isset ( $plugin_settings['fix_field_reply_to'] ) or $plugin_settings['fix_field_reply_to'] != 1 ) { 
  5. foreach ($fields as $field) { 
  6. if ( $field['type'] = '_text' ) { 
  7. $change_required = false; 
  8. if ( isset( $field['data']['from_email'] ) and $field['data']['from_email'] == 1 ) { 
  9. $field['data']['replyto_email'] = 1; 
  10. unset( $field['data']['from_email'] ); 
  11. $change_required = true; 
  12. } elseif ( isset( $field['data']['from_email'] ) and $field['data']['from_email'] == 0 ) { 
  13. $field['data']['replyto_email'] = 0; 
  14. unset( $field['data']['from_email'] ); 
  15. $change_required = true; 
  16. if ( $change_required ) { 
  17. $data = serialize( $field['data'] ); 
  18. $args = array( 
  19. 'update_array' => array( 
  20. 'data' => $data,  
  21. ),  
  22. 'where' => array( 
  23. 'id' => $field['id'],  
  24. ),  
  25. ); 
  26. $plugin_settings['fix_field_reply_to'] = 1; 
  27. update_option( 'ninja_forms_settings', $plugin_settings );