[ Index ]

MailPress 7.1

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

title

Body

[close]

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

   1  <?php
   2  if ( class_exists( 'MailPress' ) && !class_exists( 'MailPress_connection_sendmail_SMTPUTF8' ) )
   3  {
   4  /*
   5  Plugin Name: MailPress_connection_sendmail_SMTPUTF8 
   6  Plugin URI: http://blog.mailpress.org/tutorials/add-ons/connection_sendmail_SMTPUTF8/
   7  Description: Connection : use Sendmail and support SMTPUTF8 ( your SMTP server <span style="color:red;">MUST</span> support <a href="https://en.wikipedia.org/wiki/Extended_SMTP#SMTPUTF8" target="_blank">SMTPUTF8</a> ) 
   8  Version: 7.1
   9  */
  10  
  11  class MailPress_connection_sendmail_SMTPUTF8
  12  {
  13  	function __construct()
  14      {
  15          defined( 'SWIFT_ADDRESSENCODER' ) or define ( 'SWIFT_ADDRESSENCODER',    'utf8' );
  16  
  17          new MP_Swift_Connection_sendmail();
  18  
  19  // for wp admin
  20          if ( is_admin() )
  21          {
  22          // for link on plugin page
  23              add_filter( 'plugin_action_links',             array( __CLASS__, 'plugin_action_links' ), 10, 2 );
  24          // for settings
  25              add_filter( 'MailPress_scripts',             array( __CLASS__, 'scripts' ), 8, 2 );
  26          }
  27      }
  28  
  29  ////  ADMIN  ////
  30  ////  ADMIN  ////
  31  ////  ADMIN  ////
  32  ////  ADMIN  ////
  33  
  34  // for link on plugin page
  35  	public static function plugin_action_links( $links, $file )
  36      {
  37          return MailPress::plugin_links( $links, $file, plugin_basename( __FILE__ ), 'connection_sendmail' );
  38      }
  39  
  40  // for settings
  41  	public static function scripts( $scripts, $screen ) 
  42      {
  43          if ( $screen != MailPress_page_settings ) return $scripts;
  44  
  45          wp_register_script( 'mp-sendmail',     '/' . MP_PATH . 'mp-admin/js/settings_sendmail.js', array(), false, 1 );
  46          $scripts[] = 'mp-sendmail';
  47  
  48          return $scripts;
  49      }
  50  }
  51  new MailPress_connection_sendmail_SMTPUTF8();
  52  }


Generated: Mon Mar 11 18:33:33 2019 Cross-referenced by PHPXref 0.7.1