Filter hook 'wp_mail_content_type'

in WP Core File wp-includes/formatting.php at line 6142

Description

Converts emoji in emails into static images. / function wp_staticize_emoji_for_email( $mail ) { if ( ! isset( $mail['message'] ) ) { return $mail; } /* We can only transform the emoji into images if it's a `text/html` email. To do that, here's a cut down version of the same process that happens in wp_mail() - get the `Content-Type` from the headers, if there is one, then pass it through the {@see 'wp_mail_content_type'} filter, in case a plugin is handling changing the `Content-Type`.

Occurrences

Filename Line Number
wp-includes/formatting.php 6142
wp-includes/pluggable.php 480

Parameters

Type Name Description
array $mail The email data array.

PHP Doc

/**
 * Converts emoji in emails into static images.
 *
 * @since 4.2.0
 *
 * @param array $mail The email data array.
 * @return array The email data array, with emoji in the message staticized.
 */
function wp_staticize_emoji_for_email( $mail ) {
	if ( ! isset( $mail['message'] ) ) {
		return $mail;
	}

	/*
	 * We can only transform the emoji into images if it's a `text/html` email.
	 * To do that, here's a cut down version of the same process that happens
	 * in wp_mail() - get the `Content-Type` from the headers, if there is one,
	 * then pass it through the {@see 'wp_mail_content_type'} filter, in case
	 * a plugin is handling changing the `Content-Type`.
	 */