From dd6fe5b61e5fa2180051e7748514ff968cbc9f10 Mon Sep 17 00:00:00 2001
From: Christoph Herbst <chris.p.herbst@gmail.com>
Date: Wed, 28 Feb 2018 13:26:21 +0100
Subject: [PATCH] use wpautop instead of nl2br in email content
---
bp-core/bp-core-filters.php | 2 +-
bp-core/classes/class-bp-email.php | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/bp-core/bp-core-filters.php b/bp-core/bp-core-filters.php
index 8d3be6e..fb43c32 100644
|
a
|
b
|
function bp_core_render_email_template( $template ) { |
| 1132 | 1132 | |
| 1133 | 1133 | // Make sure we add a <title> tag so WP Customizer picks it up. |
| 1134 | 1134 | $template = str_replace( '<head>', '<head><title>' . esc_html_x( 'BuddyPress Emails', 'screen heading', 'buddypress' ) . '</title>', $template ); |
| 1135 | | echo str_replace( '{{{content}}}', nl2br( get_post()->post_content ), $template ); |
| | 1135 | echo str_replace( '{{{content}}}', wpautop( get_post()->post_content ), $template ); |
| 1136 | 1136 | |
| 1137 | 1137 | /* |
| 1138 | 1138 | * Link colours are applied directly in the email template before sending, so we |
diff --git a/bp-core/classes/class-bp-email.php b/bp-core/classes/class-bp-email.php
index f4de900..19c22c6 100644
|
a
|
b
|
class BP_Email { |
| 246 | 246 | switch ( $transform ) { |
| 247 | 247 | // Special-case to fill the $template with the email $content. |
| 248 | 248 | case 'add-content': |
| 249 | | $retval = str_replace( '{{{content}}}', nl2br( $this->get_content( 'replace-tokens' ) ), $retval ); |
| | 249 | $retval = str_replace( '{{{content}}}', wpautop( $this->get_content( 'replace-tokens' ) ), $retval ); |
| 250 | 250 | // Fall through. |
| 251 | 251 | |
| 252 | 252 | case 'replace-tokens': |