WordPress.org

Support

Support » Plugins and Hacks » Hacks » [Resolved] Need Help with Custom filer-Plugin

[Resolved] Need Help with Custom filer-Plugin

  • Hello recently i have found a hack that allowed me to remove the website field from the comment box.

    Here is the plugin:

    <?php
    /*
    Plugin Name: WordPress MOD
    */
    add_filter(‘comment_form_default_fields’, ‘url_filtered’);
    function url_filtered($fields)
    {
    if(isset($fields[‘url’]))
    unset($fields[‘url’]);
    return $fields;
    }
    ?>

    and now is there any way i could use the similar code to remove this massage from the comment box:

    You may use these HTML tags and attributes: <abbr title=””> <acronym title=””> <b>

    <cite> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> </strong></em>

    Thx for your help!!!

Viewing 4 replies - 1 through 4 (of 4 total)
  • I recommend you have a look at the following thread, as it should answer your question:

    http://wordpress.org/support/topic/remove-you-may-use-these-html-tags-and-attributes?replies=21

    hm.. i am trying to hack it using a plugin like i did here:

    <?php
    /*
    Plugin Name: WordPress MOD
    */
    add_filter(‘comment_form_default_fields’, ‘url_filtered’);
    function url_filtered($fields)
    {
    if(isset($fields[‘url’]))
    unset($fields[‘url’]);
    return $fields;
    }
    ?>

    The link that you gave me was showing how to edit the core of the wp.

    No, that’s not what I was referring to. Rev. Voodoo was telling people NOT to edit the core. His suggested code should work for you:

    function mytheme_init() {
    	add_filter('comment_form_defaults','mytheme_comments_form_defaults');
    }
    add_action('after_setup_theme','mytheme_init');
    
    function mytheme_comments_form_defaults($default) {
    	unset($default['comment_notes_after']);
    	return $default;
    }

    Did you try it? You can use it in your plugin file instead of the theme’s functions.php file.

    BTW, it’s not considered hacking to filter the output via a plugin.

    thx man it worked!!!!!

    Here is the plugin if anyone ever needs it!!

    It removes the website field from comment box and the text that appears before the submit button!

    <?php
    /*
    Plugin Name: WordPress MOD
    */
    add_filter(‘comment_form_default_fields’, ‘url_filtered’);
    function url_filtered($fields)
    {
    if(isset($fields[‘url’]))
    unset($fields[‘url’]);
    return $fields;
    }
    function mytheme_init() {
    add_filter(‘comment_form_defaults’,’mytheme_comments_form_defaults’);
    }
    add_action(‘after_setup_theme’,’mytheme_init’);

    function mytheme_comments_form_defaults($default) {
    unset($default[‘comment_notes_after’]);
    return $default;
    }
    ?>

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Resolved] Need Help with Custom filer-Plugin’ is closed to new replies.