wp_mail_content_type

wp_mail_content_type

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter
See hook in action

See hook in core

Displaying hooks found in version: wordpress-6.7.2

apply_filters('wp_mail_content_type') is found 2 times:

  • /wp-includes/formatting.php line 6127
    6123
    6124
    6125
    6126
    6127
    6128
    6129
    6130
    6131
    6132
    6133
        $content_type = 'text/plain';
    }
     
    /** This filter is documented in wp-includes/pluggable.php */
    $content_type = apply_filters( 'wp_mail_content_type', $content_type );
     
    if ( 'text/html' === $content_type ) {
        $mail['message'] = wp_staticize_emoji( $mail['message'] );
    }
     
    return $mail;
  • /wp-includes/pluggable.php line 480
    476
    477
    478
    479
    480
    481
    482
    483
    484
    485
    486
    * @since 2.3.0
     *
     * @param string $content_type Default wp_mail() content type.
     */
    $content_type = apply_filters( 'wp_mail_content_type', $content_type );
     
    $phpmailer->ContentType = $content_type;
     
    // Set whether it's plaintext, depending on $content_type.
    if ( 'text/html' === $content_type ) {
        $phpmailer->isHTML( true );

See this hook used in plugins: