Skip to content

Commit

Permalink
New plugin-compatibility.php file
Browse files Browse the repository at this point in the history
Fixed issue with Mandrill line-breaks messing up Give emails

#458
  • Loading branch information
Devin Walker committed Mar 29, 2016
1 parent a2d76a8 commit 08c6c84
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
3 changes: 2 additions & 1 deletion give.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public static function instance() {
self::$instance->html = new Give_HTML_Elements();
self::$instance->emails = new Give_Emails();
self::$instance->email_tags = new Give_Email_Template_Tags();
// self::$instance->donators_gravatars = new Give_Donators_Gravatars();
//self::$instance->donators_gravatars = new Give_Donators_Gravatars();
self::$instance->customers = new Give_DB_Customers();
self::$instance->template_loader = new Give_Template_Loader();

Expand Down Expand Up @@ -285,6 +285,7 @@ private function includes() {
require_once GIVE_PLUGIN_DIR . 'includes/process-purchase.php';
require_once GIVE_PLUGIN_DIR . 'includes/login-register.php';
require_once GIVE_PLUGIN_DIR . 'includes/user-functions.php';
require_once GIVE_PLUGIN_DIR . 'includes/plugin-compatibility.php';

require_once GIVE_PLUGIN_DIR . 'includes/payments/functions.php';
require_once GIVE_PLUGIN_DIR . 'includes/payments/actions.php';
Expand Down
24 changes: 24 additions & 0 deletions includes/plugin-compatibility.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php
/**
* Plugin Compatibility
*
* Functions for compatibility with other plugins.
*
* @package Give
* @subpackage Functions/Compatibility
* @copyright Copyright (c) 2016, WordImpress
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
* @since 1.0
*/


/**
* Disables the mandrill_nl2br filter while sending Give emails
*
* @since 1.4
* @return void
*/
function give_disable_mandrill_nl2br() {
add_filter( 'mandrill_nl2br', '__return_false' );
}
add_action( 'give_email_send_before', 'give_disable_mandrill_nl2br');

0 comments on commit 08c6c84

Please sign in to comment.