i'm writing a plugin and trying to register a filter, but error happens.
<?php
/*
Plugin Name: my
Plugin URI: http://my.org/
Description: my
Author: my
Version: 1.0
*/
function myfunction1($comment = '') {
}
add_filter('comment_text', 'myfunction1');
function myfunction2($s) {
}
add_filter('mod_rewrite_rules', 'myfunction2');
?>
Then I activate the plugin, the first filter registers good, but the second doesn't. It shows this error when I register it:
Fatal error: Cannot redeclare myfunction1() (previously declared in Z:\home\site\www\wp-content\plugins\hello.php:11) in Z:\home\site\www\wp-content\plugins\hello.php on line 11
Why is it so and how can I register a filter? Thanks.