Divi WordPress Theme
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WordPress fix Switching from Text to Visual editing replaces HTML character entities w/ ascii

Discussion in 'Misc WordPress Requests' started by Chi Is Current, Feb 18, 2018.

  1. Chi Is Current

    Guest

    Switching from Text to Visual editing replaces HTML character entities w/ ascii, by Chi Is Current

    Hello! ~~ Attempting to hide email addresses from SPAM bots, I convert ascii addresses to decimal “character entities” i.e. A = A. This has been working very well. However, I notice when shifting from “Text” editing mode to “Visual” editing mode WP returns decimal “character entities” back to ascii!

    Searching for a fix, I have added the following suggestion to functions.php:

    function override_mce_options($initArray) {
    $opts = '*[*]';
    $initArray['valid_elements'] = $opts;
    $initArray['extended_valid_elements'] = $opts;
    return $initArray;
    }
    add_filter('tiny_mce_before_init', 'override_mce_options');

    without success.

    Can you recommend a way to prevent WP from replacing decimal “character entities” back to ascii when shifting from “Text” editing mode to “Visual” editing mode?

    Thank You for Your Attention! ~~ Jacob

    Switching from Text to Visual editing replaces HTML character entities w/ ascii
     
    #1

Share This Page

Monarch Social Sharing Plugin