- This topic has 3 replies, 2 voices, and was last updated 7 years, 5 months ago by .
Viewing 2 reply threads
Viewing 2 reply threads
- You must be logged in to reply to this topic.
Home › Forums › WordPress Plugins › html in subject line
Hi Vinny –
Very much appreciate the update that decodes quotes in the subject line . . .
Wondering if it’s possible to decode other html that shows up there?
We had – show up there today . . .
Ha — your forum ‘corrected’ my “-” . . . .
If my post is confusing, I had attempted to let you know that our subject line contained: & # 8 2 1 1 ; — (minus the spaces) instead of “-“
It didn’t really correct it, rather it took it at face value and the browser converted it into the character. You’ll still see the entity if you look at the source code.
The trick to get entities to show as their code, is to convert the & into its own entity and type out the rest regularly. &’s entity is &, so you’d want to write &8211;
Cheers!
Hi Chris,
You can add the following hook to your functions.php file:
function chris_decode_entities( $email_subject, $type, $post_id )
{
$email_subject = html_entity_decode( $email_subject );
return $email_subject;
}
add_filter('bbpnns_filter_email_subject_in_build', 'chris_decode_entities', 10, 3 );
That will handle all HTML entities. Make sure you have UTF-8 for subject enabled in case some entities turn out to be UTF-8 wide characters.
Cheers,
Vinny
© UseStrict Consulting - All rights reserved