[ Index ]

MailPress 544

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

title

Body

[close]

/ -> mp-load.php (source)

   1  <?php
   2  /**
   3   * Bootstrap file for 
   4          1. setting some constants
   5          2. loading pluggable functions
   6  
   7   * If the mailpress-config.php file is not found then default constant values apply.
   8  
   9  **/
  10  
  11  // 1.
  12  
  13  /** text domain for gettext. */
  14  define ('MP_TXTDOM', 'MailPress');
  15  
  16  /** Absolute path to the MailPress directory. */
  17  define ('MP_ABSPATH',    dirname(__FILE__) . '/');
  18  
  19  /** Folder name of MailPress plugin. */
  20  define ('MP_FOLDER',     basename( MP_ABSPATH ));
  21  
  22  /** Relative path to the MailPress directory. */
  23  define ('MP_PATH',     PLUGINDIR . '/' . MP_FOLDER . '/' );
  24  
  25  /** Plugin version. */
  26  require_once (ABSPATH . 'wp-admin/includes/plugin.php');
  27  $plugin_data = get_plugin_data( MP_ABSPATH . 'MailPress.php' );
  28  define ('MP_Version',    $plugin_data['Version']);
  29  
  30  /** Loading optional mailpress-config.php file in current directory or parent directory */
  31  $mp_config = 'mailpress-config.php';
  32  foreach (array(MP_ABSPATH . $mp_config, dirname(MP_ABSPATH) . '/' . $mp_config) as $mp_file)
  33  {
  34      if ( !is_file( $mp_file ) ) continue;
  35      require_once( $mp_file );
  36      break;
  37  }
  38  
  39  /** Folder name of MailPress 'mp-content'. */
  40  defined('MP_CONTENT_FOLDER')     or define ('MP_CONTENT_FOLDER',    'mp-content');
  41  
  42  /** Absolute path to the MailPress 'mp-content' folder. */
  43  defined('MP_CONTENT_DIR')         or define ('MP_CONTENT_DIR',    MP_ABSPATH . MP_CONTENT_FOLDER . '/');
  44  
  45  /** Relative path to the MailPress 'mp-content' folder. */
  46  defined('MP_PATH_CONTENT')     or define ('MP_PATH_CONTENT',    MP_PATH . MP_CONTENT_FOLDER . '/');
  47  
  48  if ( defined('WP_DEBUG') && WP_DEBUG && !defined('MP_DEBUG_LOG') ) 
  49      define('MP_DEBUG_LOG', true);
  50  
  51  // 2.
  52  
  53  global $mp_general, $mp_subscriptions;
  54  $mp_general      = get_option(MailPress::option_name_general);
  55  $mp_subscriptions = get_option(MailPress::option_name_subscriptions);
  56  
  57  if (isset($mp_general['wp_mail']))
  58      include  (MP_ABSPATH . 'mp-includes/wp_pluggable.php');


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