WC_Email::__construct()
Constructor.
Description Description
Source Source
File: includes/emails/class-wc-email.php
public function __construct() {
// Find/replace.
$this->placeholders = array_merge(
array(
'{site_title}' => $this->get_blogname(),
'{site_address}' => wp_parse_url( home_url(), PHP_URL_HOST ),
'{site_url}' => wp_parse_url( home_url(), PHP_URL_HOST ),
),
$this->placeholders
);
// Init settings.
$this->init_form_fields();
$this->init_settings();
// Default template base if not declared in child constructor.
if ( is_null( $this->template_base ) ) {
$this->template_base = WC()->plugin_path() . '/templates/';
}
$this->email_type = $this->get_option( 'email_type' );
$this->enabled = $this->get_option( 'enabled' );
add_action( 'phpmailer_init', array( $this, 'handle_multipart' ) );
add_action( 'woocommerce_update_options_email_' . $this->id, array( $this, 'process_admin_options' ) );
}