wp_mail_content_type

This filter is documented in wp-includes/pluggable.php.

Description

apply_filters( 'wp_mail_content_type', (string) $text_plain ); 

Parameters (1)

0. $text_plain (string) => 'text/plain'
The text plain.

Usage

To run the hook, copy the example below.
  1. $text_plain = apply_filters( 'wp_mail_content_type', $text_plain ); 
  2.  
  3. if ( !empty( $text_plain ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the wp_mail_content_type callback 
  2. function filter_wp_mail_content_type( $text_plain ) { 
  3. // make filter magic happen here... 
  4. return $text_plain
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'wp_mail_content_type', 'filter_wp_mail_content_type', 10, 1 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'wp_mail_content_type', 'filter_wp_mail_content_type', 10, 1 ); 

Defined (1)

The filter is defined in the following location(s).

/bp-core/bp-core-functions.php  
  1. $wp_html_emails = apply_filters( 'wp_mail_content_type', 'text/plain' ) === 'text/html';