Heads up!
This article contains PHP code and is intended for developers. We offer this code as a courtesy, but don't provide support for code customizations or 3rd party development.
This article contains PHP code and is intended for developers. We offer this code as a courtesy, but don't provide support for code customizations or 3rd party development.
Use this hook for cases when a plain textarea may be preferred over rich text.
Usage
add_filter( 'frm_rich_text_emails', '__return_false' );
Parameters
- $rich_text_emails (boolean)
- $args (array)
Examples
Disable rich text email
Use this example to disable the rich text email in all forms.
add_filter( 'frm_rich_text_emails', '__return_false' );
Disable rich text email for specific action
add_filter( 'frm_rich_text_emails', 'disable_rich_text_email_for_specific_action', 10, 2 );
function disable_rich_text_email_for_specific_action( $rich_text_emails, $args ) {
$target_action_id = 2381; //Replace 2381 with your email action ID
if ( $target_action_id === $args['form_action']->ID ) {
$rich_text_emails = false;
}
return $rich_text_emails;
}
Learn more on how to find the email action ID.
Disable rich text email for specific form
add_filter( 'frm_rich_text_emails', 'disable_rich_text_email_for_specific_form', 10, 2);
function disable_rich_text_email_for_specific_form( $rich_text_emails, $args ) {
$target_form_id = 338; //Replace 338 with your form ID
if ( $target_form_id === (int) $args['form']->id ) {
$rich_text_emails = false;
}
return $rich_text_emails;
}