Skip to content
Docs
Get RestroPress

Filter

rpress_email_template_wpautop

Updated
On this page

Filters whether email content is run through wpautop.

Applied before wpautop() is used on email text. Returning false leaves line breaks untouched, which is useful when the template content is already HTML. The default is true.

Parameters#

ParameterTypeDescription
$valueboolDefault value, true.

Return value#

bool. True to apply wpautop(), false to skip it.

Example#

function my_email_wpautop( $apply ) {
	return false;
}
add_filter( 'rpress_email_template_wpautop', 'my_email_wpautop' );

Notes#

Fired from four places with the same signature: RPRESS_Emails::text_to_html(), the admin email preview text (rpress_email_preview_template_tags), the purchase receipt body (rpress_get_email_body_content) and the order notification body (rpress_get_order_notification_body_content). The filter cannot distinguish between them.

Source#

Applied in:

  • includes/emails/class-rpress-emails.php (line 347), in RPRESS_Emails::text_to_html()
  • includes/emails/template.php (line 80), in rpress_email_preview_template_tags()
  • includes/emails/template.php (line 211), in rpress_get_email_body_content()
  • includes/emails/template.php (line 256), in rpress_get_order_notification_body_content()

See also#

Was this page helpful?