ninja_forms_split_email_from

Function that looks at our "Email From" setting and breaks it up into "Name" and "Email.".

Description

($tmp_array) ninja_forms_split_email_from( $email_from ); 

Returns ($tmp_array)

array

Parameters (1)

0. $email_from
The email from.

Usage

  1. if ( !function_exists( 'ninja_forms_split_email_from' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'ninja-forms/deprecated/includes/from-setting-check.php'; 
  3.  
  4. // The email from. 
  5. $email_from = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = ninja_forms_split_email_from($email_from); 
  9.  

Defined (1)

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

/deprecated/includes/from-setting-check.php  
  1. function ninja_forms_split_email_from( $email_from ) { 
  2. $pat = '/\<([^\"]*?)\>/'; // text between quotes excluding quotes 
  3. $value = $email_from; 
  4. $tmp_array = array(); 
  5. if( preg_match( $pat, $value, $matches ) ) { 
  6. $arr = explode("<", $email_from, 2); 
  7. $tmp_array['email_from_name'] = $arr[0]; 
  8. $tmp_array['email_from'] = $matches[1]; 
  9. } else { 
  10. $tmp_array['email_from_name'] = ''; 
  11. $tmp_array['email_from'] = $email_from; 
  12. return $tmp_array;