• Resolved Ahni

    (@ahni)


    Hey again. I just noticed, whenever I save a term now it strips out any images and basic html (links, italics) I’ve added in. Up to now I’ve been using this code so that I can use html in descriptions. I also just tested with the plugin “Rich Text Tags, Categories, and Taxonomies” but it’s the same thing. I can add html no problem, but the second I save it it’s gone.

    https://www.ads-software.com/extend/plugins/tag-groups/

Viewing 5 replies - 1 through 5 (of 5 total)
  • You mean it has to do with the plugin? If you disable the plugin, put html in the description and save the term, it is still there?
    The only thing I could imagine where it happens is in the plugin line 227:

    if ( isset($_POST['description']) && ($_POST['description'] != '') ) $term['description'] = stripslashes(sanitize_text_field($_POST['description']));

    You could try to remove the sanitize_text_field( ) and see if that helps.

    Thread Starter Ahni

    (@ahni)

    Yes, it’s definitely a plugin issue. As soon as I disabled it, all my html was preserved as per usual.

    I tried removing sanitize_text_field( ) like you suggested, specifically

    sanitize_text_field($_POST[‘description’])

    Unfortunately, when I saved tried saving a term, it deleted the entire description!

    sorry, my suggestion was somewhat ambiguous. Actually I meant only to take out the function, but leave the inner bit $_POST[‘description’] .
    That line would thus become:

    if ( isset($_POST['description']) && ($_POST['description'] != '') ) $term['description'] = stripslashes($_POST['description']);

    I tested the change here and it seems to make a difference.
    I did not know that html is allowed in the description but it indeed makes sense.

    Thread Starter Ahni

    (@ahni)

    Hooray, it worked!! I owe you one, big time, for making this plugin and for the awesome support. Thank you!

    You are welcome! And thank you for testing!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: Tag Groups] small problem: saving terms strips out html’ is closed to new replies.