• Resolved pleasureinstitute

    (@pleasureinstitute)


    I have a script outside of WordPress that generates an HTML file a few hundred times a day. I figured the best way to get the contents of this file in to a specific page would be a shortcode. I wrote one that looks something like this:

    function get_special_content($atts) {
        remove_filter('the_content', 'wpautop');
        remove_filter('the_content', 'wptexturize');
        return file_get_contents('/somewhere/somefile.html');
    }
    add_shortcode('SPECIAL_SHORTCODE', 'get_special_content');

    It works great, however the problem is that wptexturize is trashing the HTML. I have a few lines that look like this:

    <tr data-notes="Blah - Blah">...</tr>

    However the output that gets sent to the browser looks like this:

    <tr data-notes="Blah – Blah>...</tr>

    Notice that the closing " is removed!

    I thought calling the remove_filter() inside the shortcode function would remove it but apparently not. I’ve also tried setting priorities to 1, 9, 10, 11, and 99. I’ve also tried this and and nothing works.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘wptexturize keeps texturizing my shortcode’ is closed to new replies.