• We are posting a small piece of Javascript (a “Buy Now” button from Shopify) into the short description field. We past this under the text tab.

    It pastes fine and and product updates OK, but when we go back to edit the short description, we discover that the single apostrophe has been changed to its HTML entity code (')

    Any ideas why?

    We’re also finding that if we save that version and then go back again, a CDATA tag is placed in the Javascript breaking it entirely.

    https://www.ads-software.com/plugins/woocommerce/

Viewing 1 replies (of 1 total)
  • Short of hacking into the WordPress editor, consider adding your JavaScript as its own file with this snippet in functions.php for your child theme:

    add_action( 'wp_enqueue_scripts', 'add_my_script' );
    function add_my_script() {
      wp_enqueue_script( 'my-js', '/wp-content/uploads/my_script.js', array(), "1", true);
    }

Viewing 1 replies (of 1 total)
  • The topic ‘Short Description field is converting HTML/Javascript into entities – why?’ is closed to new replies.