Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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 &#8211; 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 this and nothing works. I'm running WordPress 3.4.1.

share|improve this question
    
Turns out it was my theme doing some extra processing –  C G Sep 30 '12 at 22:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.