[ Index ]

MailPress 544

[ Index ]     [ Classes ]     [ Functions ]     [ Variables ]     [ Constants ]     [ Statistics ]    

title

Body

[close]

/mp-content/add-ons/ -> MailPress_wp_fromemail.php (source)

   1  <?php
   2  if (class_exists('MailPress') && !class_exists('MailPress_wp_fromemail'))
   3  {
   4  /*
   5  Plugin Name: MailPress_wp_fromemail
   6  Plugin URI: http://blog.mailpress.org/tutorials/add-ons/wp_fromemail/
   7  Description: New Mail : FROM email & name replaced by current user wp values
   8  Version: 5.4.4
   9  */
  10  
  11  class MailPress_wp_fromemail
  12  {
  13  	function __construct()
  14      {
  15          add_filter('MailPress_write_fromemail',         array(__CLASS__, 'fromemail'), 1, 1);
  16          add_filter('MailPress_write_fromname',         array(__CLASS__, 'fromname'), 1, 1);
  17      }
  18  
  19  ////  Admin  ////
  20  
  21  	public static function fromemail($fromemail)
  22      {
  23          $user = wp_get_current_user();
  24          if ($user) return $user->user_email;
  25          return $fromemail;
  26      }
  27  
  28  	public static function fromname($fromname)
  29      {
  30          $user = wp_get_current_user();
  31          if ($user) return $user->user_nicename;
  32          return $fromname;
  33      }
  34  }
  35  new MailPress_wp_fromemail();
  36  }


Generated: Thu Apr 28 18:38:52 2016 Cross-referenced by PHPXref 0.7.1