Support » Plugin: WP SVG Icons » Prevent icon code removal when switching from Text to Visual?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Evan Herman

    (@eherman24)

    Hi jf80,

    This is a known issue when using the plugin. Unfortunately, from the research I’ve done on resolving this, the issue lies with the TinyMCE WYSIWYG text editor. One of the intended functionality of TinyMCE is stripping out any unfiltered HTML from the visual tab.

    The only way I was able to resolve the issue myself was by hacking away at the TinyMCE core (which is less than ideal as it will be overwritten on WP updates).

    Apparently with TinyMCE version 4.0 this issue has been remedied and switching between text and visual tabs no longer strips out the code. We have to wait for the WordPress core team to implement a newer version of TinyMCE before we no longer have this issue.

    Sorry about the inconvenience , I know how frustrating it can be to have code stripped away after spending a good deal of time writing it in the first place.

    Thanks for downloading the plugin!

    -Evan

    Thread Starter jf80

    (@jf80)

    Ok, thanks for responding.

    Plugin Author Evan Herman

    (@eherman24)

    WordPress 3.9 will feature TINYmce v 4.0, which should (finally) resolve the issue of code being stripped.

    I also believe the code may be stripped due to the ampersand (&) in the icon code. Which, if that’s the case, I’ll have to re-code the icon codes my self.

    Thanks,
    Evan

    http://make.wordpress.org/core/2014/01/18/tinymce-4-0-is-in-core/

    I’m on WP 4.0 and still experiencing this issue. Any thoughts on an update or workaround?

    Thanks.

    Plugin Author Evan Herman

    (@eherman24)

    Hi WP Monkey,

    Unfortunately, the fix didn’t make it into the latest core update (4.0). As it sits now, there is no solid work around. A few plugins claim to add the ability to prevent unfiltered HTML from being stripped, but I still have yet to get one of them working properly.

    From the few emails I had with another users of the plugin, we were able to come up with a solid work around.

    Instead of using the ‘data-icon’ parameter on the icon itself, you can create an element and use an appropriate class name to assign the icon. For example, the following will work and will prevent the unfiltered HTML from being stripped out:

    <i class="wp-svg-icon-set1-home"></i>

    That will create a home icon, using the provided class name instead of the alternate methods mentioned in the plugin. You’ll want to make sure that the contents of the element are NOT empty tho, because sometimes the content editor will strip out elements that are empty.

    To be safe, add a space inside of the element :
    <i class="wp-svg-icon-set1-home"> </i>
    (notice the space)

    I am hoping that in the coming days I can loop back around and update the documentation within the plugin, as well as on the site to let users know that this is a valid and working method for generating icons and to prevent this issue. I also need to specify the class name of each icon as they are clicked, so the user knows what classname to use.

    Evan

    I’ve been having a lot of code stripped from my pages, plus I needed to add some header code to only two pages on the site (not all) and I found this plugin works for both well.

    https://wordpress.org/plugins/css-javascript-toolbox/

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Prevent icon code removal when switching from Text to Visual?’ is closed to new replies.