This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ define("COMMENTSAFE_VERSION", "1.0.0"); ### WordPress Plugin Interface ### /* Plugin Name: abg CommentSafe Plugin URI: http://abitgone.co.uk/projects/commentsafe Description: A very simple plugin that removes additional, specific tags from comments. Go to Plugins→CommentSafe Options (once you've activated the plugin) for more details and to set your preferred tags. Version: 1.0.0 Author: Anthony Williams Author URI: http://abitgone.co.uk/ */ # # Add menu item to Options menu. # function abg_commentsafe_options() { if (function_exists('add_options_page')) { add_submenu_page( 'plugins.php', 'CommentSafe Options', 'CommentSafe Options', 8, 'abg_commentsafe', 'abg_commentsafe_options_page' ); } } # # Trigger adding the menu option # add_action('admin_menu', 'abg_commentsafe_options'); # # Draw the normal options page # function abg_commentsafe_options_page() { $abg_commentsafe_tags = get_option('abg_commentsafe_tags'); $abg_commentsafe_behaviour = get_option('abg_commentsafe_behaviour'); $saved_tags = ""; if (isset($_POST['submit'])) { $abg_commentsafe_tags = trim($_POST['abg_commentsafe_tags']); $abg_commentsafe_tags = str_replace(" ", "|", trim(preg_replace("/[\s]{2,}/", " ", $abg_commentsafe_tags))); update_option('abg_commentsafe_tags', trim($abg_commentsafe_tags)); $abg_commentsafe_behaviour = $_POST['abg_commentsafe_behaviour']; } switch($abg_commentsafe_behaviour) { case "strip": case "convert": case "remove": // Do nothing break; default: $abg_commentsafe_behaviour = "strip"; } if (isset($_POST['submit'])) { update_option('abg_commentsafe_behaviour', $_POST['abg_commentsafe_behaviour']); } ?>
CommentSafe is a simple plugin that removes additional, specific tags from your comments.