I'm facing an issue where I'm attempting to programmatically set the description property for a taxonomy term that includes HTML, but the HTML is being rendered as text, rather than being rendered into HTML elements, unless I manually access the term in a browser and save it.
Example
taxonomy_term_save((object)array(
'name' => $name,
'description' => $t('<h5>My description.</h5><p>More info.</p>'),
'vid' => $vocab->vid,
));
When I attempt to render the description, it appears as:
<h5>My description.</h5><p>More info.</p>
However, if I then go to Structure > Taxonomy > My_Vocabulary > My_Term and simply save the term (without any edits), it will then render properly as:
My description.
More info.
I've also made a number of attempts to achieve this through an Entity Metadata Wrapper, but no luck (though I am admittedly not well versed on EMWs).
How can I programmatically force the description to correctly render the HTML without having to manually re-save it?
Any help is appreciated!
format
property can you set tofull_html
, or the name of another more permissive filter?