Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: phpmailer_init

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
184      $phpmailer->ClearCustomHeaders();
185
186      $phpmailer->FromName = "WordPress";
187      $phpmailer->AddAddress("$to", "");
188      $phpmailer->Subject = $subject;
189      $phpmailer->Body    = $message;
190      $phpmailer->IsHTML(false);
191      $phpmailer->IsMail(); // set mailer to use php mail()
192
193      do_action_ref_array('phpmailer_init', array(&$phpmailer));
194
195      $mailheaders = (array) explode( "\n", $headers );
196      foreach ( $mailheaders as $line ) {
197           $header = explode( ":", $line );
198           switch ( trim( $header[0] ) ) {
199                case "From":
200                     $from = trim( str_replace( '"', '', $header[1] ) );
201                     if ( strpos( $from, '<' ) ) {
202                          $phpmailer->FromName = str_replace( '"', '', substr( $header[1], 0, strpos( $header[1], '<' ) - 1 ) );