<?php
/*
Plugin Name: rm_wpautop
Plugin URI: http://rolandog.com/archives/2008/11/12/wp-plugin-rm-wpautop/
Description: This plugin allows you to remove the wpautop filter by placing a 'wpautop' custom field with a key value of 'false' in your pages or posts, therefore allowing WordPress not to automatically add paragraph or break elements.
Author: Rolando Garza
Author URI: http://rolandog.com/
Version: 0.3
*/
function rm_wpautop($content) {
global $post;
// Get the keys and values of the custom fields:
$rmwpautop = get_post_meta($post->ID, 'wpautop', true);
// Remove the filter
remove_filter('the_content', 'wpautop');
if ('false' === $rmwpautop) {
} else {
// Adds the filter again, if not set to false.
add_filter('the_content', 'wpautop');
}
return $content;
}
// Hook into the Plugin API
add_filter('the_content', 'rm_wpautop', 9);
?>