nf_modify_admin_mailto

The Ninja Forms nf modify admin mailto function.

Description

nf_modify_admin_mailto( $setting, (string) $setting_name, $id ); 

Parameters (3)

0. $setting
The setting.
1. $setting_name (string)
The setting name.
2. $id
The id.

Usage

  1. if ( !function_exists( 'nf_modify_admin_mailto' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'ninja-forms/deprecated/includes/deprecated.php'; 
  3.  
  4. // The setting. 
  5. $setting = null; 
  6.  
  7. // The setting name. 
  8. $setting_name = ''; 
  9.  
  10. // The id. 
  11. $id = null; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = nf_modify_admin_mailto($setting, $setting_name, $id); 
  15.  

Defined (1)

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

/deprecated/includes/deprecated.php  
  1. function nf_modify_admin_mailto( $setting, $setting_name, $id ) { 
  2. global $ninja_forms_processing; 
  3.  
  4. // Bail if this isn't our admin notification 
  5. if ( ! nf_get_object_meta_value( $id, 'admin_email' ) ) 
  6. return $setting; 
  7.  
  8. // Bail if this isn't the "to" setting. 
  9. if ( $setting_name != 'to' ) 
  10. return $setting; 
  11.  
  12. $admin_mailto = $ninja_forms_processing->get_form_setting( 'admin_mailto' ); 
  13. $ninja_forms_processing->update_form_setting( 'admin_mailto', '' ); 
  14.  
  15. if ( is_array( $admin_mailto ) && ! empty ( $admin_mailto ) ) { 
  16. $setting = array_merge( $setting, $admin_mailto ); 
  17.  
  18. return $setting;