• Resolved foltest

    (@foltest)


    Hi,

    Everytime I try to create a snippet and save it as Javascript code, it’s saved as plain text, so it just prints plain text on the header or footer. The steps are simple:

    • Write javascript code on a new snippet
    • Save it
    • When the page reloads, it’s turned into plain text and saved as that.

    I disabled every addon and it is a fresh wp install.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Mircea Sandu

    (@gripgrip)

    Hi @foltest,

    Can you please check if the Code Type is still JavaScript after saving? Or is it defaulting to HTML?

    The issue might be with the plugin not being able to assign the code type correctly for your snippet.

    Thread Starter foltest

    (@foltest)

    Hi, @gripgrip.

    Yes, as I said, it is saving as plain text fragment. I already uninstalled and reinstalled, but nothing works.

    Thank you.

    Plugin Author Mircea Sandu

    (@gripgrip)

    Hi @foltest,

    If the code type remains HTML after saving, even though you set it to JavaScript, you may be encountering an issue with assigning taxonomy terms.

    We saw this a few times before where after transferring a website or running a search & replace on the whole website taxonomy terms are no longer being added correctly.

    To test this theory: can you please go to the regular Posts > Categories page and add a new category?

    If that also throws an error the issue is likely related to the scenario I described above.

    If that works, we’ll have to look into this in more detail – can you please reach out using the form at https://wpcode.com/contact

    Thanks

    Thread Starter foltest

    (@foltest)

    Hi @gripgrip. Sorry for the late response.

    I tried that and it works perfectly.

    Here is a video of the bug: https://imgur.com/a/1eNPfMD

    Thank you in advance.

    Plugin Author Mircea Sandu

    (@gripgrip)

    Hi @foltest,

    Thank you for the details, that is very weird and it’s not something we encountered before so I’m not sure what is causing this issue without looking further into it.

    Does this happen if you create a new snippet and set it to JavaScript code type?

    Please also consider reaching out to us via the contact form at https://wpcode.com/contact so that you can share more details regarding your setup privately if you want.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Javascript snippet saving as plain text’ is closed to new replies.